PartitionOwnerIDsCopy is like PartitionOwnerIDs(), but the returned slice is a copy, so the caller can freely manipulate it.
(partitionID int32)
| 418 | // PartitionOwnerIDsCopy is like PartitionOwnerIDs(), but the returned slice is a copy, |
| 419 | // so the caller can freely manipulate it. |
| 420 | func (r *PartitionRing) PartitionOwnerIDsCopy(partitionID int32) []string { |
| 421 | ids := r.ownersByPartition[partitionID] |
| 422 | if len(ids) == 0 { |
| 423 | return nil |
| 424 | } |
| 425 | |
| 426 | return slices.Clone(ids) |
| 427 | } |
| 428 | |
| 429 | // MultiPartitionOwnerIDs returns the ownerIDs of the given partitionID removing the suffix added to support ownership of multiple partitions. |
| 430 | // The slice returned will try to use the provided buf, and it can be modified (it will modify the buf if it was used). |