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

Method MarkBlockCompacted

tempodb/backend/azure/compactor.go:24–49  ·  view source on GitHub ↗
(blockID uuid.UUID, tenantID string)

Source from the content-addressed store, hash-verified

22}
23
24func (rw *Azure) MarkBlockCompacted(blockID uuid.UUID, tenantID string) error {
25 if len(tenantID) == 0 {
26 return backend.ErrEmptyTenantID
27 }
28 if blockID == uuid.Nil {
29 return backend.ErrEmptyBlockID
30 }
31
32 // move meta file to a new location
33 metaFilename := backend.MetaFileName(blockID, tenantID, rw.cfg.Prefix)
34 compactedMetaFilename := backend.CompactedMetaFileName(blockID, tenantID, rw.cfg.Prefix)
35 ctx := context.TODO()
36
37 src, _, err := rw.readAll(ctx, metaFilename)
38 if err != nil {
39 return err
40 }
41
42 err = rw.writeAll(ctx, compactedMetaFilename, src)
43 if err != nil {
44 return err
45 }
46
47 // delete the old file
48 return rw.Delete(ctx, metaFilename, []string{}, nil)
49}
50
51func (rw *Azure) ClearBlock(blockID uuid.UUID, tenantID string) error {
52 var warning error

Callers

nothing calls this directly

Calls 5

readAllMethod · 0.95
writeAllMethod · 0.95
DeleteMethod · 0.95
MetaFileNameFunction · 0.92
CompactedMetaFileNameFunction · 0.92

Tested by

no test coverage detected