(ctx context.Context, req *tempopb.SearchRequest, _ common.SearchOptions)
| 597 | } |
| 598 | |
| 599 | func (b *walBlock) Search(ctx context.Context, req *tempopb.SearchRequest, _ common.SearchOptions) (*tempopb.SearchResponse, error) { |
| 600 | ctx, span := tracer.Start(ctx, "walBlock.Search") |
| 601 | defer span.End() |
| 602 | |
| 603 | results := &tempopb.SearchResponse{ |
| 604 | Metrics: &tempopb.SearchMetrics{}, |
| 605 | } |
| 606 | |
| 607 | for i, blockFlush := range b.readFlushes() { |
| 608 | file, err := blockFlush.file(ctx) |
| 609 | if err != nil { |
| 610 | return nil, fmt.Errorf("error opening file %s: %w", blockFlush.path, err) |
| 611 | } |
| 612 | |
| 613 | defer file.Close() |
| 614 | pf := file.parquetFile |
| 615 | |
| 616 | r, err := searchParquetFile(ctx, pf, req, pf.RowGroups(), b.meta.DedicatedColumns) |
| 617 | if err != nil { |
| 618 | return nil, fmt.Errorf("error searching block [%s %d]: %w", b.meta.BlockID.String(), i, err) |
| 619 | } |
| 620 | |
| 621 | results.Traces = append(results.Traces, r.Traces...) |
| 622 | results.Metrics.InspectedBytes += file.r.BytesRead() |
| 623 | results.Metrics.InspectedTraces += uint32(pf.NumRows()) |
| 624 | if len(results.Traces) >= int(req.Limit) { |
| 625 | break |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | return results, nil |
| 630 | } |
| 631 | |
| 632 | func (b *walBlock) SearchTags(ctx context.Context, scope traceql.AttributeScope, cb common.TagsCallback, mcb common.MetricsCallback, _ common.SearchOptions) error { |
| 633 | ctx, span := tracer.Start(ctx, "walBlock.SearchTags") |
nothing calls this directly
no test coverage detected