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

Method tenantIndexProto

tempodb/backend/raw.go:297–316  ·  view source on GitHub ↗
(ctx context.Context, tenantID string)

Source from the content-addressed store, hash-verified

295}
296
297func (r *reader) tenantIndexProto(ctx context.Context, tenantID string) (*TenantIndex, error) {
298 readerPb, size, err := r.r.Read(ctx, TenantIndexNamePb, KeyPath([]string{tenantID}), nil)
299 if err != nil {
300 return nil, fmt.Errorf("failed to read tenant index proto: %w", err)
301 }
302 defer readerPb.Close()
303
304 bytesPb, err := tempo_io.ReadAllWithEstimate(readerPb, size)
305 if err != nil {
306 return nil, fmt.Errorf("failed to read all with estimate: %w", err)
307 }
308
309 out := &TenantIndex{}
310 err = out.unmarshalPb(bytesPb)
311 if err != nil {
312 return nil, fmt.Errorf("failed to unmarshal tenant index proto: %w", err)
313 }
314
315 return out, nil
316}
317
318// Find implements backend.Reader
319func (r *reader) Find(ctx context.Context, keypath KeyPath, f FindFunc) error {

Callers 1

TenantIndexMethod · 0.95

Calls 4

unmarshalPbMethod · 0.95
KeyPathTypeAlias · 0.85
ReadMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected