Skip to content

Commit

Permalink
Clarify entry encoding with comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed May 15, 2017
1 parent 0c0bc08 commit bc04380
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions badger/value.go
Expand Up @@ -587,8 +587,9 @@ func (l *valueLog) Write(reqs []*request) {
}

p.Fid = uint32(curlf.fid)
p.Offset = uint64(curlf.offset) + uint64(l.buf.Len())
p.Len = uint32(entryEncoder.Encode(e, &l.buf))
p.Offset = uint64(curlf.offset) + uint64(l.buf.Len()) // Use the offset including buffer length so far.
plen := entryEncoder.Encode(e, &l.buf) // Now encode the entry into buffer.
p.Len = uint32(plen)
b.Ptrs = append(b.Ptrs, p)

if p.Offset > uint64(l.opt.ValueLogFileSize) {
Expand Down

0 comments on commit bc04380

Please sign in to comment.