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

Method Read

tempodb/backend/s3/s3.go:546–557  ·  view source on GitHub ↗

Read implements backend.Reader

(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo)

Source from the content-addressed store, hash-verified

544
545// Read implements backend.Reader
546func (rw *readerWriter) Read(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo) (io.ReadCloser, int64, error) {
547 derivedCtx, span := tracer.Start(ctx, "s3.Read")
548 defer span.End()
549
550 keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix)
551 b, err := rw.readAll(derivedCtx, backend.ObjectFileName(keypath, name))
552 if err != nil {
553 return nil, 0, readError(err)
554 }
555
556 return io.NopCloser(bytes.NewReader(b)), int64(len(b)), err
557}
558
559// ReadRange implements backend.Reader
560func (rw *readerWriter) ReadRange(ctx context.Context, name string, keypath backend.KeyPath, offset uint64, buffer []byte, _ *backend.CacheInfo) error {

Callers

nothing calls this directly

Calls 5

readAllMethod · 0.95
KeyPathWithPrefixFunction · 0.92
ObjectFileNameFunction · 0.92
readErrorFunction · 0.70
StartMethod · 0.65

Tested by

no test coverage detected