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

Method Partitions

ring/partition_ring.go:344–352  ·  view source on GitHub ↗

Partitions returns the partitions in the ring. The returned slice is a deep copy, so the caller can freely manipulate it.

()

Source from the content-addressed store, hash-verified

342// Partitions returns the partitions in the ring.
343// The returned slice is a deep copy, so the caller can freely manipulate it.
344func (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.

Calls 1

CloneMethod · 0.65