MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / RemoveCache

Method RemoveCache

consistent/consistent.go:211–219  ·  view source on GitHub ↗

RemoveCache removes an node from the hash cache.

(nodeID proto.NodeID)

Source from the content-addressed store, hash-verified

209
210// RemoveCache removes an node from the hash cache.
211func (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.
222func (c *Consistent) ResetCache() {

Callers 1

RemoveMethod · 0.95

Calls 3

nodeKeyMethod · 0.95
updateSortedHashesMethod · 0.95
hashKeyFunction · 0.85

Tested by

no test coverage detected