Skip to content

Commit ad38e3f

Browse files
committed
nsqd: switch to golang/snappy
1 parent bdb2919 commit ad38e3f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Godeps

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ github.com/nsqio/go-nsq 642a3f9935f12cb3b747294318d730f56f4c34b4
44
github.com/bitly/go-simplejson 18db6e68d8fd9cbf2e8ebe4c81a78b96fd9bf05a
55
github.com/bmizerany/perks/quantile 6cb9d9d729303ee2628580d9aec5db968da3a607
66
github.com/mreiferson/go-options 7ae3226d3e1fa6a0548f73089c72c96c141f3b95
7-
github.com/mreiferson/go-snappystream 028eae7ab5c4c9e2d1cb4c4ca1e53259bbe7e504 # v0.2.3
7+
github.com/golang/snappy d9eb7a3d35ec988b8585d4a0068e462c27d28380
88
github.com/bitly/timer_metrics afad1794bb13e2a094720aeb27c088aa64564895
99
github.com/blang/semver 9bf7bff48b0388cb75991e58c6df7d13e982f1f2
1010
github.com/julienschmidt/httprouter 6aacfd5ab513e34f7e64ea9627ab9670371b34e7

nsqd/client_v2.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"sync/atomic"
1111
"time"
1212

13-
"github.com/mreiferson/go-snappystream"
13+
"github.com/golang/snappy"
1414
"github.com/nsqio/nsq/internal/auth"
1515
)
1616

@@ -533,8 +533,8 @@ func (c *clientV2) UpgradeSnappy() error {
533533
conn = c.tlsConn
534534
}
535535

536-
c.Reader = bufio.NewReaderSize(snappystream.NewReader(conn, snappystream.SkipVerifyChecksum), defaultBufferSize)
537-
c.Writer = bufio.NewWriterSize(snappystream.NewWriter(conn), c.OutputBufferSize)
536+
c.Reader = bufio.NewReaderSize(snappy.NewReader(conn), defaultBufferSize)
537+
c.Writer = bufio.NewWriterSize(snappy.NewWriter(conn), c.OutputBufferSize)
538538

539539
atomic.StoreInt32(&c.Snappy, 1)
540540

nsqd/protocol_v2_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"testing"
2424
"time"
2525

26-
"github.com/mreiferson/go-snappystream"
26+
"github.com/golang/snappy"
2727
"github.com/nsqio/go-nsq"
2828
"github.com/nsqio/nsq/internal/protocol"
2929
"github.com/nsqio/nsq/internal/test"
@@ -1112,15 +1112,15 @@ func TestSnappy(t *testing.T) {
11121112
test.Nil(t, err)
11131113
test.Equal(t, true, r.Snappy)
11141114

1115-
compressConn := snappystream.NewReader(conn, snappystream.SkipVerifyChecksum)
1115+
compressConn := snappy.NewReader(conn)
11161116
resp, _ := nsq.ReadResponse(compressConn)
11171117
frameType, data, _ := nsq.UnpackResponse(resp)
11181118
t.Logf("frameType: %d, data: %s", frameType, data)
11191119
test.Equal(t, frameTypeResponse, frameType)
11201120
test.Equal(t, []byte("OK"), data)
11211121

11221122
msgBody := make([]byte, 128000)
1123-
w := snappystream.NewWriter(conn)
1123+
w := snappy.NewWriter(conn)
11241124

11251125
rw := readWriter{compressConn, w}
11261126

@@ -1308,7 +1308,7 @@ func TestTLSSnappy(t *testing.T) {
13081308
test.Equal(t, frameTypeResponse, frameType)
13091309
test.Equal(t, []byte("OK"), data)
13101310

1311-
compressConn := snappystream.NewReader(tlsConn, snappystream.SkipVerifyChecksum)
1311+
compressConn := snappy.NewReader(tlsConn)
13121312

13131313
resp, _ = nsq.ReadResponse(compressConn)
13141314
frameType, data, _ = nsq.UnpackResponse(resp)

nsqd/stats_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/mreiferson/go-snappystream"
11+
"github.com/golang/snappy"
1212
"github.com/nsqio/nsq/internal/http_api"
1313
"github.com/nsqio/nsq/internal/test"
1414
)
@@ -67,8 +67,8 @@ func TestClientAttributes(t *testing.T) {
6767
test.Nil(t, err)
6868
test.Equal(t, true, resp.Snappy)
6969

70-
r := snappystream.NewReader(conn, snappystream.SkipVerifyChecksum)
71-
w := snappystream.NewWriter(conn)
70+
r := snappy.NewReader(conn)
71+
w := snappy.NewWriter(conn)
7272
readValidate(t, r, frameTypeResponse, "OK")
7373

7474
topicName := "test_client_attributes" + strconv.Itoa(int(time.Now().Unix()))

0 commit comments

Comments
 (0)