Skip to content

Commit

Permalink
Export stream batch size for clients: DefaultStreamBatchSize
Browse files Browse the repository at this point in the history
Change-Id: I27107c721025f075c87739656357c57f2d7ede08
Reviewed-on: http://review.couchbase.org/113355
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Abhinav Dangeti <abhinav@couchbase.com>
  • Loading branch information
abhinavdangeti committed Aug 14, 2019
1 parent d4c5885 commit f3ffcab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
log "github.com/couchbase/clog"
)

var defaultStreamBatchSize = 100
var DefaultStreamBatchSize = 100
var sliceStart = []byte{'['}
var sliceEnd = []byte{']'}
var itemGlue = []byte{','}
Expand Down Expand Up @@ -182,7 +182,7 @@ func (dmh *docMatchHandler) documentMatchHandler(hit *search.DocumentMatch) erro
// remember the ending offset position
dmh.offsets = append(dmh.offsets, uint64(len(dmh.bhits)))
dmh.n++
if dmh.n < defaultStreamBatchSize {
if dmh.n < DefaultStreamBatchSize {
return nil
}
}
Expand Down Expand Up @@ -226,8 +226,8 @@ func (s *streamer) MakeDocumentMatchHandler(
dmh := docMatchHandler{
s: s,
ctx: ctx,
bhits: make([]byte, 0, defaultStreamBatchSize*50),
offsets: make([]uint64, 0, defaultStreamBatchSize),
bhits: make([]byte, 0, DefaultStreamBatchSize*50),
offsets: make([]uint64, 0, DefaultStreamBatchSize),
highlighter: highlighter,
}
dmh.bhits = append(dmh.bhits, sliceStart...)
Expand Down

0 comments on commit f3ffcab

Please sign in to comment.