GetInstanceState returns the current state of an instance or an error if the instance does not exist in the ring.
(instanceID string)
| 912 | // GetInstanceState returns the current state of an instance or an error if the |
| 913 | // instance does not exist in the ring. |
| 914 | func (r *Ring) GetInstanceState(instanceID string) (InstanceState, error) { |
| 915 | r.mtx.RLock() |
| 916 | defer r.mtx.RUnlock() |
| 917 | |
| 918 | instances := r.ringDesc.GetIngesters() |
| 919 | instance, ok := instances[instanceID] |
| 920 | if !ok { |
| 921 | return PENDING, ErrInstanceNotFound |
| 922 | } |
| 923 | |
| 924 | return instance.GetState(), nil |
| 925 | } |
| 926 | |
| 927 | // GetInstanceIdByAddr implements ReadRing. |
| 928 | func (r *Ring) GetInstanceIdByAddr(addr string) (string, error) { |
nothing calls this directly
no test coverage detected