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

Method MarkBlockCompacted

tempodb/backend/gcs/compactor.go:17–40  ·  view source on GitHub ↗
(blockID uuid.UUID, tenantID string)

Source from the content-addressed store, hash-verified

15)
16
17func (rw *readerWriter) MarkBlockCompacted(blockID uuid.UUID, tenantID string) error {
18 // move meta file to a new location
19 metaFilename := backend.MetaFileName(blockID, tenantID, rw.cfg.Prefix)
20 compactedMetaFilename := backend.CompactedMetaFileName(blockID, tenantID, rw.cfg.Prefix)
21
22 src := rw.bucket.Object(metaFilename).Retryer(
23 storage.WithBackoff(gax.Backoff{}),
24 storage.WithPolicy(storage.RetryAlways),
25 storage.WithMaxAttempts(rw.cfg.MaxRetries),
26 )
27 dst := rw.bucket.Object(compactedMetaFilename).Retryer(
28 storage.WithBackoff(gax.Backoff{}),
29 storage.WithPolicy(storage.RetryAlways),
30 storage.WithMaxAttempts(rw.cfg.MaxRetries),
31 )
32
33 ctx := context.TODO()
34 _, err := dst.CopierFrom(src).Run(ctx)
35 if err != nil {
36 return err
37 }
38
39 return src.Delete(ctx)
40}
41
42func (rw *readerWriter) ClearBlock(blockID uuid.UUID, tenantID string) error {
43 if len(tenantID) == 0 {

Callers

nothing calls this directly

Calls 4

MetaFileNameFunction · 0.92
CompactedMetaFileNameFunction · 0.92
DeleteMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected