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

Method readValueBytes

value.go:1591–1599  ·  view source on GitHub ↗

readValueBytes return vlog entry slice and read locked log file. Caller should take care of logFile unlocking.

(vp valuePointer, s *y.Slice)

Source from the content-addressed store, hash-verified

1589// readValueBytes return vlog entry slice and read locked log file. Caller should take care of
1590// logFile unlocking.
1591func (vlog *valueLog) readValueBytes(vp valuePointer, s *y.Slice) ([]byte, *logFile, error) {
1592 lf, err := vlog.getFileRLocked(vp)
1593 if err != nil {
1594 return nil, nil, err
1595 }
1596
1597 buf, err := lf.read(vp, s)
1598 return buf, lf, err
1599}
1600
1601func (vlog *valueLog) pickLog(head valuePointer, tr trace.Trace) (files []*logFile) {
1602 vlog.filesLock.RLock()

Callers 4

ReadMethod · 0.95
doRunGCMethod · 0.95
TestValueBasicFunction · 0.80
BenchmarkReadWriteFunction · 0.80

Calls 2

getFileRLockedMethod · 0.95
readMethod · 0.45

Tested by 2

TestValueBasicFunction · 0.64
BenchmarkReadWriteFunction · 0.64