Skip to content

Instantly share code, notes, and snippets.

Last active Sep 12, 2018
What would you like to do?
func (n *Node) join(joinNode *internal.Node) error {
// First check if node already present in the circle
// Join this node to the same chord ring as parent
var foo *internal.Node
// // Ask if our id already exists on the ring.
if joinNode != nil {
remoteNode, err := n.findSuccessorRPC(joinNode, n.Id)
if err != nil {
return err
if isEqual(remoteNode.Id, n.Id) {
foo = joinNode
} else {
foo = n.Node
succ, err := n.findSuccessorRPC(foo, n.Id)
if err != nil {
return err
n.successor = succ
return nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment