MCPcopy Create free account
hub / github.com/cortexproject/cortex / ShuffleShard

Method ShuffleShard

pkg/ring/ring.go:749–751  ·  view source on GitHub ↗

ShuffleShard returns a subring for the provided identifier (eg. a tenant ID) and size (number of instances). The size is expected to be a multiple of the number of zones and the returned subring will contain the same number of instances per zone as far as there are enough registered instances in the

(identifier string, size int)

Source from the content-addressed store, hash-verified

747// - Shuffling: probabilistically, for a large enough cluster each identifier gets a different
748// set of instances, with a reduced number of overlapping instances between two identifiers.
749func (r *Ring) ShuffleShard(identifier string, size int) ReadRing {
750 return r.shuffleShardWithCache(identifier, size, false)
751}
752
753func (r *Ring) ShuffleShardWithZoneStability(identifier string, size int) ReadRing {
754 return r.shuffleShardWithCache(identifier, size, true)

Calls 1

shuffleShardWithCacheMethod · 0.95