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 | |
| 219 | func 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? |
Tested by
no test coverage detected