MCPcopy
hub / github.com/dgraph-io/dgraph / amLeader

Method amLeader

dgraph/cmd/zero/raft.go:56–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56func (n *node) amLeader() bool {
57 if n.Raft() == nil {
58 return false
59 }
60 r := n.Raft()
61 return r.Status().Lead == r.Status().ID
62}
63
64func (n *node) AmLeader() bool {
65 // Return false if the node is not the leader. Otherwise, check the lastQuorum as well.

Callers 2

AmLeaderMethod · 0.95
checkQuorumMethod · 0.95

Calls 2

RaftMethod · 0.80
StatusMethod · 0.80

Tested by

no test coverage detected