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

Method Find

tempodb/backend/azure/azure.go:265–300  ·  view source on GitHub ↗

Find implements backend.Reader

(ctx context.Context, keypath backend.KeyPath, f backend.FindFunc)

Source from the content-addressed store, hash-verified

263
264// Find implements backend.Reader
265func (rw *Azure) Find(ctx context.Context, keypath backend.KeyPath, f backend.FindFunc) (err error) {
266 keypath = backend.KeyPathWithPrefix(keypath, rw.cfg.Prefix)
267
268 prefix := path.Join(keypath...)
269 if len(prefix) > 0 {
270 prefix += dir
271 }
272
273 pager := rw.containerClient.NewListBlobsFlatPager(&container.ListBlobsFlatOptions{
274 Prefix: &prefix,
275 })
276
277 var o string
278 for pager.More() {
279 page, err := pager.NextPage(ctx)
280 if err != nil {
281 return fmt.Errorf("iterating objects: %w", err)
282 }
283
284 for _, b := range page.Segment.BlobItems {
285 if b == nil || b.Name == nil {
286 continue
287 }
288
289 o = strings.TrimSuffix(*b.Name, dir)
290 opts := backend.FindMatch{
291 Key: strings.TrimPrefix(o, rw.cfg.Prefix),
292 Modified: *b.Properties.LastModified,
293 }
294 f(opts)
295 }
296
297 }
298
299 return
300}
301
302// Read implements backend.Reader
303func (rw *Azure) Read(ctx context.Context, name string, keypath backend.KeyPath, _ *backend.CacheInfo) (io.ReadCloser, int64, error) {

Callers

nothing calls this directly

Calls 4

KeyPathWithPrefixFunction · 0.92
fFunction · 0.85
NextPageMethod · 0.80
JoinMethod · 0.65

Tested by

no test coverage detected