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

Method MarkBlocklistCompacted

tempodb/compactor.go:351–364  ·  view source on GitHub ↗

MarkCompacted marks the old blocks as compacted and adds the new blocks to the blocklist. No backend changes are made.

(tenantID string, oldBlocks, newBlocks []*backend.BlockMeta)

Source from the content-addressed store, hash-verified

349
350// MarkCompacted marks the old blocks as compacted and adds the new blocks to the blocklist. No backend changes are made.
351func (rw *readerWriter) MarkBlocklistCompacted(tenantID string, oldBlocks, newBlocks []*backend.BlockMeta) error {
352 // Converted outgoing blocks into compacted entries.
353 newCompactions := make([]*backend.CompactedBlockMeta, 0, len(oldBlocks))
354 for _, newBlock := range oldBlocks {
355 newCompactions = append(newCompactions, &backend.CompactedBlockMeta{
356 BlockMeta: *newBlock,
357 CompactedTime: time.Now(),
358 })
359 }
360
361 rw.blocklist.Update(tenantID, newBlocks, oldBlocks, newCompactions, nil)
362
363 return nil
364}
365
366func markCompacted(rw *readerWriter, tenantID string, oldBlocks, newBlocks []*backend.BlockMeta) error {
367 // Check if we have any errors, but continue marking the blocks as compacted

Callers

nothing calls this directly

Calls 2

NowMethod · 0.65
UpdateMethod · 0.45

Tested by

no test coverage detected