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

Method CompactedBlockMeta

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

Source from the content-addressed store, hash-verified

90}
91
92func (rw *Azure) CompactedBlockMeta(blockID uuid.UUID, tenantID string) (*backend.CompactedBlockMeta, error) {
93 if len(tenantID) == 0 {
94 return nil, backend.ErrEmptyTenantID
95 }
96 if blockID == uuid.Nil {
97 return nil, backend.ErrEmptyBlockID
98 }
99 name := backend.CompactedMetaFileName(blockID, tenantID, rw.cfg.Prefix)
100
101 bytes, modTime, err := rw.readAllWithModTime(context.Background(), name)
102 if err != nil {
103 return nil, readError(err)
104 }
105
106 out := &backend.CompactedBlockMeta{}
107 err = json.Unmarshal(bytes, out)
108 if err != nil {
109 return nil, err
110 }
111 out.CompactedTime = modTime
112
113 return out, nil
114}
115
116func (rw *Azure) readAllWithModTime(ctx context.Context, name string) ([]byte, time.Time, error) {
117 bytes, _, err := rw.readAll(ctx, name)

Callers

nothing calls this directly

Calls 4

readAllWithModTimeMethod · 0.95
CompactedMetaFileNameFunction · 0.92
readErrorFunction · 0.70
UnmarshalMethod · 0.65

Tested by

no test coverage detected