ShuffleShardSize returns number of partitions that would be in the result of ShuffleShard call with the same size.
(size int)
| 159 | |
| 160 | // ShuffleShardSize returns number of partitions that would be in the result of ShuffleShard call with the same size. |
| 161 | func (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). |
no outgoing calls