Skip to content

Commit

Permalink
nsqd: move diskqueue into nsqio/go-diskqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Jan 11, 2017
1 parent ecfb30f commit b558b1c
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 1,219 deletions.
1 change: 1 addition & 0 deletions Godeps
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ github.com/bitly/timer_metrics afad1794bb13e2a094720aeb27c088aa64564895
github.com/blang/semver 9bf7bff48b0388cb75991e58c6df7d13e982f1f2
github.com/julienschmidt/httprouter 6aacfd5ab513e34f7e64ea9627ab9670371b34e7
github.com/judwhite/go-svc/svc 63c12402f579f0bdf022653c821a1aa5d7544f01
github.com/nsqio/go-diskqueue d7805f889b023afcd5b8933e815ce9ba36327333
3 changes: 2 additions & 1 deletion nsqd/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"sync/atomic"
"time"

"github.com/nsqio/go-diskqueue"
"github.com/nsqio/nsq/internal/pqueue"
"github.com/nsqio/nsq/internal/quantile"
)
Expand Down Expand Up @@ -95,7 +96,7 @@ func NewChannel(topicName string, channelName string, ctx *context,
} else {
// backend names, for uniqueness, automatically include the topic...
backendName := getBackendName(topicName, channelName)
c.backend = newDiskQueue(backendName,
c.backend = diskqueue.New(backendName,
ctx.nsqd.getOpts().DataPath,
ctx.nsqd.getOpts().MaxBytesPerFile,
int32(minValidMsgLength),
Expand Down
14 changes: 0 additions & 14 deletions nsqd/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ func TestPutMessage2Chan(t *testing.T) {
test.Equal(t, msg.Body, outputMsg2.Body)
}

func TestChannelBackendMaxMsgSize(t *testing.T) {
opts := NewOptions()
opts.Logger = test.NewTestLogger(t)
_, _, nsqd := mustStartNSQD(opts)
defer os.RemoveAll(opts.DataPath)
defer nsqd.Exit()

topicName := "test_channel_backend_maxmsgsize" + strconv.Itoa(int(time.Now().Unix()))
topic := nsqd.GetTopic(topicName)
ch := topic.GetChannel("ch")

test.Equal(t, int32(opts.MaxMsgSize+minValidMsgLength), ch.backend.(*diskQueue).maxMsgSize)
}

func TestInFlightWorker(t *testing.T) {
count := 250

Expand Down
Loading

0 comments on commit b558b1c

Please sign in to comment.