0
0
Fork 0

Merge pull request #835 from steveyen/use-1MB-buffer-for-file-merger

scorch zap file merger uses 1MB buffered writer
This commit is contained in:
Steve Yen 2018-03-18 09:06:52 -07:00 committed by GitHub
commit 6693a89441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,8 @@ import (
"github.com/golang/snappy"
)
var DefaultFileMergerBufferSize = 1024 * 1024
const docDropped = math.MaxUint64 // sentinel docNum to represent a deleted doc
// Merge takes a slice of zap segments and bit masks describing which
@ -55,7 +57,7 @@ func Merge(segments []*Segment, drops []*roaring.Bitmap, path string,
}
// buffer the output
br := bufio.NewWriter(f)
br := bufio.NewWriterSize(f, DefaultFileMergerBufferSize)
// wrap it for counting (tracking offsets)
cr := NewCountHashWriter(br)