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

Function writeBlockMeta

tempodb/encoding/vparquet4/copy.go:73–112  ·  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

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

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