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

Method SetFlushed

modules/livestore/local_block.go:118–132  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

116}
117
118func (c *LocalBlock) SetFlushed(ctx context.Context) error {
119 flushedTime := time.Now()
120 flushedBytes, err := flushedTime.MarshalText()
121 if err != nil {
122 return fmt.Errorf("error marshalling flush time to text: %w", err)
123 }
124
125 err = c.writer.Write(ctx, nameFlushed, (uuid.UUID)(c.BlockMeta().BlockID), c.BlockMeta().TenantID, flushedBytes, nil)
126 if err != nil {
127 return fmt.Errorf("error writing local block flushed file: %w", err)
128 }
129
130 c.flushedTime.Store(flushedTime.Unix())
131 return nil
132}
133
134func (c *LocalBlock) Write(ctx context.Context, w backend.Writer) error {
135 if err := encoding.CopyBlock(ctx, c.BlockMeta(), c.reader, w); err != nil {

Calls 4

NowMethod · 0.65
WriteMethod · 0.65
BlockMetaMethod · 0.65
StoreMethod · 0.65