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

Method finishBlock

tempodb/encoding/vparquet5/compactor.go:265–300  ·  view source on GitHub ↗
(ctx context.Context, block *streamingBlock, l log.Logger)

Source from the content-addressed store, hash-verified

263}
264
265func (c *Compactor) finishBlock(ctx context.Context, block *streamingBlock, l log.Logger) error {
266 _, span := tracer.Start(ctx, "vparquet.compactor.finishBlock")
267 defer span.End()
268
269 bytesFlushed, err := block.Complete()
270 if err != nil {
271 return fmt.Errorf("error completing block: %w", err)
272 }
273
274 level.Info(l).Log("msg", "wrote compacted block",
275 "version", block.meta.Version,
276 "tenantID", block.meta.TenantID,
277 "blockID", block.meta.BlockID.String(),
278 "startTime", block.meta.StartTime.String(),
279 "endTime", block.meta.EndTime.String(),
280 "totalObjects", block.meta.TotalObjects,
281 "size", block.meta.Size_,
282 "compactionLevel", block.meta.CompactionLevel,
283 "totalRecords", block.meta.TotalObjects,
284 "bloomShardCount", block.meta.BloomShardCount,
285 "footerSize", block.meta.FooterSize,
286 "replicationFactor", block.meta.ReplicationFactor,
287 "dedicatedColumns", fmt.Sprintf("%+v", block.meta.DedicatedColumns),
288 )
289
290 span.AddEvent("wrote compacted block")
291 span.SetAttributes(
292 attribute.String("blockID", block.meta.BlockID.String()),
293 )
294
295 compactionLevel := int(block.meta.CompactionLevel) - 1
296 if c.opts.BytesWritten != nil {
297 c.opts.BytesWritten(compactionLevel, bytesFlushed)
298 }
299 return nil
300}
301
302type rowPool struct {
303 pool sync.Pool

Callers 1

CompactMethod · 0.95

Calls 4

StartMethod · 0.65
LogMethod · 0.65
CompleteMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected