(ctx context.Context, tenantID string)
| 295 | } |
| 296 | |
| 297 | func (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 |
| 319 | func (r *reader) Find(ctx context.Context, keypath KeyPath, f FindFunc) error { |
no test coverage detected