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

Method Remove

consistent/consistent.go:152–163  ·  view source on GitHub ↗

Remove removes an node from the hash.

(nodeID proto.NodeID)

Source from the content-addressed store, hash-verified

150
151// Remove removes an node from the hash.
152func (c *Consistent) Remove(nodeID proto.NodeID) (err error) {
153 c.Lock()
154 defer c.Unlock()
155 err = c.persist.DelNode(nodeID)
156 if err != nil {
157 log.WithField("node", nodeID).WithError(err).Error("del node failed")
158 return
159 }
160
161 c.RemoveCache(nodeID)
162 return
163}
164
165// Set sets all the nodes in the hash. If there are existing nodes not
166// present in nodes, they will be removed.

Callers 9

TestConfFunction · 0.45
TestRemoveFunction · 0.45
TestRemoveNonExistingFunction · 0.45
TestGetMultipleRemoveFunction · 0.45
BenchmarkAllocationsFunction · 0.45
BenchmarkMallocFunction · 0.45
BenchmarkCycleFunction · 0.45
BenchmarkCycleLargeFunction · 0.45

Calls 5

RemoveCacheMethod · 0.95
WithFieldFunction · 0.92
ErrorMethod · 0.80
WithErrorMethod · 0.80
DelNodeMethod · 0.65

Tested by 9

TestConfFunction · 0.36
TestRemoveFunction · 0.36
TestRemoveNonExistingFunction · 0.36
TestGetMultipleRemoveFunction · 0.36
BenchmarkAllocationsFunction · 0.36
BenchmarkMallocFunction · 0.36
BenchmarkCycleFunction · 0.36
BenchmarkCycleLargeFunction · 0.36