Remove removes an node from the hash.
(nodeID proto.NodeID)
| 150 | |
| 151 | // Remove removes an node from the hash. |
| 152 | func (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. |