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

Method HasInstance

pkg/ring/ring.go:937–944  ·  view source on GitHub ↗

HasInstance returns whether the ring contains an instance matching the provided instanceID.

(instanceID string)

Source from the content-addressed store, hash-verified

935
936// HasInstance returns whether the ring contains an instance matching the provided instanceID.
937func (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
946func (r *Ring) getCachedShuffledSubring(identifier string, size int, zoneStableSharding bool) *Ring {
947 if r.cfg.SubringCacheDisabled {

Callers

nothing calls this directly

Calls 1

GetIngestersMethod · 0.80

Tested by

no test coverage detected