PendingPartitionIDs returns a sorted list of all PENDING partition IDs in the ring. The returned slice is a copy, so the caller can freely manipulate it.
()
| 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. |
| 369 | func (r *PartitionRing) PendingPartitionIDs() []int32 { |
| 370 | ids := make([]int32, 0, len(r.desc.Partitions)) |
| 371 | |
| 372 | for id, partition := range r.desc.Partitions { |
| 373 | if partition.IsPending() { |
| 374 | ids = append(ids, id) |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | slices.Sort(ids) |
| 379 | return ids |
| 380 | } |
| 381 | |
| 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. |