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)
| 762 | // |
| 763 | // This function doesn't support caching. |
| 764 | func (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 | |
| 773 | func (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. |