newConsistentRing returns a constinent ring and takes the name of this node and the number of its replicas.
(name string, replicas int)
| 45 | // newConsistentRing returns a constinent ring and takes the name of this node |
| 46 | // and the number of its replicas. |
| 47 | func newConsistentRing(name string, replicas int) *consistentRing { |
| 48 | return &consistentRing{ |
| 49 | self: name, |
| 50 | ring: consistent.New(), |
| 51 | replicas: replicas, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // getOwnedKeys returns the set of keys owned by this node. |
| 56 | func (c *consistentRing) getOwnedKeys(keys []string) []string { |