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

Method Search

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

Source from the content-addressed store, hash-verified

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