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

Method Read

tempodb/backend/gcs/gcs.go:363–375  ·  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

361
362// Read implements backend.Reader
363func (rw *readerWriter) Read(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo) (io.ReadCloser, int64, error) {
364 keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix)
365 derivedCtx, span := tracer.Start(ctx, "gcs.Read")
366 defer span.End()
367
368 span.SetAttributes(attribute.String("object", name))
369
370 b, _, err := rw.readAll(derivedCtx, backend.ObjectFileName(keypath, name))
371 if err != nil {
372 span.SetStatus(codes.Error, "")
373 }
374 return io.NopCloser(bytes.NewReader(b)), int64(len(b)), readError(err)
375}
376
377// ReadRange implements backend.Reader
378func (rw *readerWriter) ReadRange(ctx context.Context, name string, keypath backend.KeyPath, offset uint64, buffer []byte, _ *backend.CacheInfo) error {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected