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

Method AmLeader

worker/draft.go:2027–2033  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2025}
2026
2027func (n *node) AmLeader() bool {
2028 if n.Raft() == nil {
2029 return false
2030 }
2031 r := n.Raft()
2032 return r.Status().Lead == r.Status().ID
2033}
2034
2035func (n *node) monitorRaftMetrics() {
2036 ticker := time.Tick(5 * time.Second)

Callers 14

checkpointAndCloseMethod · 0.95
calculateTabletSizesMethod · 0.95
isGroupOneLeaderFunction · 0.45
proposeDeleteOrSendFunction · 0.45
proposeRestoreOrSendFunction · 0.45
handleRestoreProposalFunction · 0.45
processCDCEventsMethod · 0.45
ProposeDrainFunction · 0.45
applyStateMethod · 0.45
doSendMembershipMethod · 0.45
runSchemaMutationFunction · 0.45

Calls 2

RaftMethod · 0.80
StatusMethod · 0.80

Tested by

no test coverage detected