RemoveCache removes an node from the hash cache.
(nodeID proto.NodeID)
| 209 | |
| 210 | // RemoveCache removes an node from the hash cache. |
| 211 | func (c *Consistent) RemoveCache(nodeID proto.NodeID) { |
| 212 | c.cacheLock.Lock() |
| 213 | defer c.cacheLock.Unlock() |
| 214 | |
| 215 | for i := 0; i < c.NumberOfReplicas; i++ { |
| 216 | delete(c.circle, hashKey(c.nodeKey(nodeID, i))) |
| 217 | } |
| 218 | c.updateSortedHashes() |
| 219 | } |
| 220 | |
| 221 | // ResetCache removes all node from the hash cache. |
| 222 | func (c *Consistent) ResetCache() { |
no test coverage detected