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

Method readAll

tempodb/backend/azure/azure.go:504–538  ·  view source on GitHub ↗
(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

502}
503
504func (rw *Azure) readAll(ctx context.Context, name string) ([]byte, azcore.ETag, error) {
505 blobClient := rw.hedgedContainerClient.NewBlockBlobClient(name)
506
507 props, err := blobClient.GetProperties(ctx, &blob.GetPropertiesOptions{})
508 if err != nil {
509 return nil, "", err
510 }
511
512 if props.ContentLength == nil {
513 return nil, "", fmt.Errorf("expected content length but got none for blob %s: %w", name, err)
514 }
515
516 destBuffer := make([]byte, *props.ContentLength)
517
518 if _, err := blobClient.DownloadBuffer(context.Background(), destBuffer, &blob.DownloadBufferOptions{
519 Range: blob.HTTPRange{
520 Offset: 0,
521 Count: *props.ContentLength,
522 },
523 BlockSize: blob.DefaultDownloadBlockSize,
524 Concurrency: maxParallelism,
525 RetryReaderOptionsPerBlock: blob.RetryReaderOptions{
526 MaxRetries: maxRetries,
527 },
528 }); err != nil {
529 return nil, "", err
530 }
531
532 var etag azcore.ETag
533 if props.ETag != nil {
534 etag = *props.ETag
535 }
536
537 return destBuffer, etag, nil
538}

Callers 4

MarkBlockCompactedMethod · 0.95
readAllWithModTimeMethod · 0.95
ReadMethod · 0.95
ReadVersionedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected