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.
()
| 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. |
| 356 | func (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. |
no outgoing calls