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

Method ShuffleShardWithLookback

pkg/ring/ring.go:764–771  ·  view source on GitHub ↗

ShuffleShardWithLookback is like ShuffleShard() but the returned subring includes all instances that have been part of the identifier's shard since "now - lookbackPeriod". The returned subring may be unbalanced with regard to zones and should never be used for write operations (read only). This fu

(identifier string, size int, lookbackPeriod time.Duration, now time.Time)

Source from the content-addressed store, hash-verified

762//
763// This function doesn't support caching.
764func (r *Ring) ShuffleShardWithLookback(identifier string, size int, lookbackPeriod time.Duration, now time.Time) ReadRing {
765 // Nothing to do if the shard size is not smaller than the actual ring.
766 if size <= 0 || r.InstancesCount() <= size {
767 return r
768 }
769
770 return r.shuffleShard(identifier, size, lookbackPeriod, now, false)
771}
772
773func (r *Ring) shuffleShardWithCache(identifier string, size int, zoneStableSharding bool) ReadRing {
774 // Nothing to do if the shard size is not smaller than the actual ring.

Calls 2

InstancesCountMethod · 0.95
shuffleShardMethod · 0.95