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

Function writeBlockMeta

tempodb/encoding/vparquet5/copy.go:64–103  ·  view source on GitHub ↗
(ctx context.Context, w backend.Writer, meta *backend.BlockMeta, bloom *common.ShardedBloomFilter, index *index)

Source from the content-addressed store, hash-verified

62}
63
64func writeBlockMeta(ctx context.Context, w backend.Writer, meta *backend.BlockMeta, bloom *common.ShardedBloomFilter, index *index) error {
65 // bloom
66 blooms, err := bloom.Marshal()
67 if err != nil {
68 return err
69 }
70
71 cacheInfo := &backend.CacheInfo{
72 Meta: meta,
73 Role: cache.RoleBloom,
74 }
75 for i, bloom := range blooms {
76 nameBloom := common.BloomName(i)
77 err := w.Write(ctx, nameBloom, (uuid.UUID)(meta.BlockID), meta.TenantID, bloom, cacheInfo)
78 if err != nil {
79 return fmt.Errorf("unexpected error writing bloom-%d: %w", i, err)
80 }
81 }
82
83 // Index
84 i, err := index.Marshal()
85 if err != nil {
86 return err
87 }
88 err = w.Write(ctx, common.NameIndex, (uuid.UUID)(meta.BlockID), meta.TenantID, i, &backend.CacheInfo{
89 Meta: meta,
90 Role: cache.RoleTraceIDIdx,
91 })
92 if err != nil {
93 return err
94 }
95
96 // meta
97 err = w.WriteBlockMeta(ctx, meta)
98 if err != nil {
99 return fmt.Errorf("unexpected error writing meta: %w", err)
100 }
101
102 return nil
103}

Callers 1

CompleteMethod · 0.70

Calls 4

BloomNameFunction · 0.92
MarshalMethod · 0.65
WriteMethod · 0.65
WriteBlockMetaMethod · 0.65

Tested by

no test coverage detected