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

Method PartitionOwnerIDsCopy

ring/partition_ring.go:420–427  ·  view source on GitHub ↗

PartitionOwnerIDsCopy is like PartitionOwnerIDs(), but the returned slice is a copy, so the caller can freely manipulate it.

(partitionID int32)

Source from the content-addressed store, hash-verified

418// PartitionOwnerIDsCopy is like PartitionOwnerIDs(), but the returned slice is a copy,
419// so the caller can freely manipulate it.
420func (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).

Callers 1

handleGetRequestMethod · 0.80

Calls 1

CloneMethod · 0.65

Tested by

no test coverage detected