MCPcopy
hub / github.com/dgraph-io/badger / fill

Method fill

iterator.go:676–695  ·  view source on GitHub ↗
(item *Item)

Source from the content-addressed store, hash-verified

674}
675
676func (it *Iterator) fill(item *Item) {
677 vs := it.iitr.Value()
678 item.meta = vs.Meta
679 item.userMeta = vs.UserMeta
680 item.expiresAt = vs.ExpiresAt
681
682 item.version = y.ParseTs(it.iitr.Key())
683 item.key = y.SafeCopy(item.key, y.ParseKey(it.iitr.Key()))
684
685 item.vptr = y.SafeCopy(item.vptr, vs.Value)
686 item.val = nil
687 if it.opt.PrefetchValues {
688 item.wg.Add(1)
689 go func() {
690 // FIXME we are not handling errors here.
691 item.prefetchValue()
692 item.wg.Done()
693 }()
694 }
695}
696
697func (it *Iterator) prefetch() {
698 prefetchSize := 2

Callers 1

parseItemMethod · 0.95

Calls 8

ParseTsFunction · 0.92
SafeCopyFunction · 0.92
ParseKeyFunction · 0.92
prefetchValueMethod · 0.80
ValueMethod · 0.65
KeyMethod · 0.65
AddMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected