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

Method ActivePartitionIDs

ring/partition_ring.go:384–395  ·  view source on GitHub ↗

ActivePartitionIDs returns a sorted list of all ACTIVE 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

382// ActivePartitionIDs returns a sorted list of all ACTIVE partition IDs in the ring.
383// The returned slice is a copy, so the caller can freely manipulate it.
384func (r *PartitionRing) ActivePartitionIDs() []int32 {
385 ids := make([]int32, 0, len(r.desc.Partitions))
386
387 for id, partition := range r.desc.Partitions {
388 if partition.IsActive() {
389 ids = append(ids, id)
390 }
391 }
392
393 slices.Sort(ids)
394 return ids
395}
396
397// InactivePartitionIDs returns a sorted list of all INACTIVE partition IDs in the ring.
398// The returned slice is a copy, so the caller can freely manipulate it.

Calls 1

IsActiveMethod · 0.80