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

Function writeBlockMeta

tempodb/encoding/vparquet3/copy.go:74–113  ·  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

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

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