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

Function store

tempodb/backend/cache/cache.go:219–227  ·  tempodb/backend/cache/cache.go::store
(ctx context.Context, cache cache.Cache, role cache.Role, key string, val []byte)

Source from the content-addressed store, hash-verified

217}
218
219func store(ctx context.Context, cache cache.Cache, role cache.Role, key string, val []byte) {
220 write := val
221 if needsCopy(role) {
222 write = make([]byte, len(val))
223 copy(write, val)
224 }
225
226 cache.Store(ctx, []string{key}, [][]byte{write})
227}
228
229// needsCopy returns true if the role should be copied into a new buffer before being written to the cache
230// todo: should this be signalled through cacheinfo instead?

Callers 2

ReadMethod · 0.70
ReadRangeMethod · 0.70

Calls 2

needsCopyFunction · 0.85
StoreMethod · 0.65

Tested by

no test coverage detected