Partitions returns the partitions in the ring. The returned slice is a deep copy, so the caller can freely manipulate it.
()
| 342 | // Partitions returns the partitions in the ring. |
| 343 | // The returned slice is a deep copy, so the caller can freely manipulate it. |
| 344 | func (r *PartitionRing) Partitions() []PartitionDesc { |
| 345 | res := make([]PartitionDesc, 0, len(r.desc.Partitions)) |
| 346 | |
| 347 | for _, partition := range r.desc.Partitions { |
| 348 | res = append(res, partition.Clone()) |
| 349 | } |
| 350 | |
| 351 | return res |
| 352 | } |
| 353 | |
| 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. |