MCPcopy
hub / github.com/grafana/tempo / populate

Method populate

pkg/io/buffered.go:65–77  ·  view source on GitHub ↗
(buf *readerBuffer)

Source from the content-addressed store, hash-verified

63}
64
65func (r *BufferedReaderAt) populate(buf *readerBuffer) (int, error) {
66 // read
67 n, err := r.ra.ReadAt(buf.buf, buf.off)
68
69 // if err is fatal we need to invalidate the buffer by setting it back to 0s (uninitialized)
70 if isFatalError(err) {
71 buf.buf = buf.buf[:0]
72 buf.count = 0
73 buf.off = 0
74 }
75
76 return n, err
77}
78
79func calculateBounds(offset, length int64, bufferSize int, readerAtSize int64) (newOffset, newLength int64) {
80 // Increase to minimim read size

Callers 2

ReadAtMethod · 0.95

Calls 2

isFatalErrorFunction · 0.70
ReadAtMethod · 0.65

Tested by 1