MCPcopy Create free account
hub / github.com/dadgar/onecache / ringCopy

Method ringCopy

onecache/ring.go:114–127  ·  view source on GitHub ↗

ringCopy returns a copy of the consistentRing.

()

Source from the content-addressed store, hash-verified

112
113// ringCopy returns a copy of the consistentRing.
114func (c *consistentRing) ringCopy() ring {
115 c.lock.Lock()
116 defer c.lock.Unlock()
117
118 ring := &consistentRing{
119 self: c.self,
120 ring: consistent.New(),
121 replicas: c.replicas,
122 }
123
124 m := c.ring.Members()
125 ring.ring.Set(m)
126 return ring
127}
128
129// add adds a node to the consistent ring.
130func (c *consistentRing) add(node string) {

Callers

nothing calls this directly

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected