MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / joinPeers

Method joinPeers

worker/draft.go:1896–1909  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1894}
1895
1896func (n *node) joinPeers() error {
1897 pl, err := n.leaderBlocking()
1898 if err != nil {
1899 return err
1900 }
1901
1902 c := pb.NewRaftClient(pl.Get())
1903 glog.Infof("Calling JoinCluster via leader: %s", pl.Addr)
1904 if _, err := c.JoinCluster(n.ctx, n.RaftContext); err != nil {
1905 return errors.Wrapf(err, "error while joining cluster")
1906 }
1907 glog.Infof("Done with JoinCluster call\n")
1908 return nil
1909}
1910
1911// Checks if its a peer from the leader of the group.
1912func (n *node) isMember() (bool, error) {

Callers

nothing calls this directly

Calls 5

leaderBlockingMethod · 0.95
JoinClusterMethod · 0.95
NewRaftClientFunction · 0.92
InfofMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected