forLiveStoreRing runs f, in parallel, for instances selected from the live-store ring.
(ctx context.Context, f forEachFn)
| 314 | |
| 315 | // forLiveStoreRing runs f, in parallel, for instances selected from the live-store ring. |
| 316 | func (q *Querier) forLiveStoreRing(ctx context.Context, f forEachFn) ([]any, error) { |
| 317 | if ctx.Err() != nil { |
| 318 | _ = level.Debug(log.Logger).Log("forLiveStoreRing context error", "ctx.Err()", ctx.Err().Error()) |
| 319 | return nil, ctx.Err() |
| 320 | } |
| 321 | |
| 322 | ctx, span := tracer.Start(ctx, "Querier.forLiveStoreRing") |
| 323 | defer span.End() |
| 324 | |
| 325 | if q.partitionRing == nil { |
| 326 | return nil, errors.New("forLiveStoreRing: partition ring is not configured") |
| 327 | } |
| 328 | |
| 329 | rs, err := q.partitionRing.GetReplicationSetsForOperation(ring.Read) |
| 330 | if err != nil { |
| 331 | return nil, fmt.Errorf("error finding partition ring replicas: %w", err) |
| 332 | } |
| 333 | return forPartitionRingReplicaSets(ctx, q, rs, f) |
| 334 | } |
| 335 | |
| 336 | // forLiveStoreMetricsRing runs f, in parallel, for instances selected from the live-store ring. |
| 337 | func (q *Querier) forLiveStoreMetricsRing(ctx context.Context, f forEachMetricsFn) ([]any, error) { |
no test coverage detected