MCPcopy
hub / github.com/grafana/dskit / HasInstance

Method HasInstance

ring/ring.go:1287–1294  ·  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

1285
1286// HasInstance returns whether the ring contains an instance matching the provided instanceID.
1287func (r *Ring) HasInstance(instanceID string) bool {
1288 r.mtx.RLock()
1289 defer r.mtx.RUnlock()
1290
1291 instances := r.ringDesc.GetIngesters()
1292 _, ok := instances[instanceID]
1293 return ok
1294}
1295
1296func (r *Ring) getCachedShuffledSubring(identifier string, size int) *Ring {
1297 if r.cfg.SubringCacheDisabled {

Callers

nothing calls this directly

Calls 1

GetIngestersMethod · 0.80

Tested by

no test coverage detected