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

Method ShuffleShardSize

ring/partition_ring.go:161–170  ·  view source on GitHub ↗

ShuffleShardSize returns number of partitions that would be in the result of ShuffleShard call with the same size.

(size int)

Source from the content-addressed store, hash-verified

159
160// ShuffleShardSize returns number of partitions that would be in the result of ShuffleShard call with the same size.
161func (r *PartitionRing) ShuffleShardSize(size int) int {
162 if size <= 0 || size > r.activePartitionsCount {
163 return r.activePartitionsCount
164 }
165
166 if size < r.activePartitionsCount {
167 return size
168 }
169 return r.activePartitionsCount
170}
171
172// ShuffleShard returns a subring for the provided identifier (eg. a tenant ID)
173// and size (number of partitions).

Calls

no outgoing calls