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

Method prefetchValue

iterator.go:220–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218}
219
220func (item *Item) prefetchValue() {
221 val, cb, err := item.yieldItemValue()
222 defer runCallback(cb)
223
224 item.err = err
225 item.status = prefetched
226 if val == nil {
227 return
228 }
229 if item.db.opt.ValueLogLoadingMode == options.MemoryMap {
230 buf := item.slice.Resize(len(val))
231 copy(buf, val)
232 item.val = buf
233 } else {
234 item.val = val
235 }
236}
237
238// EstimatedSize returns the approximate size of the key-value pair.
239//

Callers 1

fillMethod · 0.80

Calls 3

yieldItemValueMethod · 0.95
runCallbackFunction · 0.85
ResizeMethod · 0.80

Tested by

no test coverage detected