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

Method ReadVersioned

tempodb/backend/gcs/gcs.go:439–452  ·  view source on GitHub ↗
(ctx context.Context, name string, keypath backend.KeyPath)

Source from the content-addressed store, hash-verified

437}
438
439func (rw *readerWriter) ReadVersioned(ctx context.Context, name string, keypath backend.KeyPath) (io.ReadCloser, backend.Version, error) {
440 keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix)
441 derivedCtx, span := tracer.Start(ctx, "gcs.ReadVersioned", trace.WithAttributes(
442 attribute.String("object", name),
443 ))
444 defer span.End()
445
446 b, attrs, err := rw.readAll(derivedCtx, backend.ObjectFileName(keypath, name))
447 if err != nil {
448 span.SetStatus(codes.Error, "")
449 return nil, "", readError(err)
450 }
451 return io.NopCloser(bytes.NewReader(b)), toVersion(attrs.Generation), nil
452}
453
454func toVersion(generation int64) backend.Version {
455 return backend.Version(fmt.Sprint(generation))

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected