MCPcopy
hub / github.com/grafana/dskit / PartitionIDs

Method PartitionIDs

ring/partition_ring.go:356–365  ·  view source on GitHub ↗

PartitionIDs returns a sorted list of all partition IDs in the ring. The returned slice is a copy, so the caller can freely manipulate it.

()

Source from the content-addressed store, hash-verified

354// PartitionIDs returns a sorted list of all partition IDs in the ring.
355// The returned slice is a copy, so the caller can freely manipulate it.
356func (r *PartitionRing) PartitionIDs() []int32 {
357 ids := make([]int32, 0, len(r.desc.Partitions))
358
359 for id := range r.desc.Partitions {
360 ids = append(ids, id)
361 }
362
363 slices.Sort(ids)
364 return ids
365}
366
367// PendingPartitionIDs returns a sorted list of all PENDING partition IDs in the ring.
368// The returned slice is a copy, so the caller can freely manipulate it.

Calls

no outgoing calls