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

Method Search

tempodb/encoding/vparquet4/block_search.go:89–116  ·  view source on GitHub ↗
(ctx context.Context, req *tempopb.SearchRequest, opts common.SearchOptions)

Source from the content-addressed store, hash-verified

87}
88
89func (b *backendBlock) Search(ctx context.Context, req *tempopb.SearchRequest, opts common.SearchOptions) (_ *tempopb.SearchResponse, err error) {
90 derivedCtx, span := tracer.Start(ctx, "parquet.backendBlock.Search",
91 trace.WithAttributes(
92 attribute.String("blockID", b.meta.BlockID.String()),
93 attribute.String("tenantID", b.meta.TenantID),
94 attribute.Int64("blockSize", int64(b.meta.Size_)),
95 ))
96 defer span.End()
97
98 pf, rr, err := b.openForSearch(derivedCtx, opts)
99 if err != nil {
100 return nil, fmt.Errorf("unexpected error opening parquet file: %w", err)
101 }
102 defer func() { span.SetAttributes(attribute.Int64("inspectedBytes", int64(rr.BytesRead()))) }()
103
104 // Get list of row groups to inspect. Ideally we use predicate pushdown
105 // here to keep only row groups that can potentially satisfy the request
106 // conditions, but don't have it figured out yet.
107 rgs := rowGroupsFromFile(pf, opts)
108 results, err := searchParquetFile(derivedCtx, pf, req, rgs, b.meta.DedicatedColumns)
109 if err != nil {
110 return nil, err
111 }
112 results.Metrics.InspectedBytes += rr.BytesRead()
113 results.Metrics.InspectedTraces += uint32(b.meta.TotalObjects)
114
115 return results, nil
116}
117
118func makePipelineWithRowGroups(ctx context.Context, req *tempopb.SearchRequest, pf *parquet.File, rgs []parquet.RowGroup, dc backend.DedicatedColumns) pq.Iterator {
119 makeIter := makeIterFunc(ctx, rgs, pf)

Callers

nothing calls this directly

Calls 6

openForSearchMethod · 0.95
rowGroupsFromFileFunction · 0.70
searchParquetFileFunction · 0.70
StartMethod · 0.65
StringMethod · 0.45
BytesReadMethod · 0.45

Tested by

no test coverage detected