HasInstance returns whether the ring contains an instance matching the provided instanceID.
(instanceID string)
| 935 | |
| 936 | // HasInstance returns whether the ring contains an instance matching the provided instanceID. |
| 937 | func (r *Ring) HasInstance(instanceID string) bool { |
| 938 | r.mtx.RLock() |
| 939 | defer r.mtx.RUnlock() |
| 940 | |
| 941 | instances := r.ringDesc.GetIngesters() |
| 942 | _, ok := instances[instanceID] |
| 943 | return ok |
| 944 | } |
| 945 | |
| 946 | func (r *Ring) getCachedShuffledSubring(identifier string, size int, zoneStableSharding bool) *Ring { |
| 947 | if r.cfg.SubringCacheDisabled { |
nothing calls this directly
no test coverage detected