MCPcopy
hub / github.com/chaozh/MIT-6.824 / GetState

Method GetState

src/raft/raft.go:71–77  ·  view source on GitHub ↗

return currentTerm and whether this server believes it is the leader.

()

Source from the content-addressed store, hash-verified

69// return currentTerm and whether this server
70// believes it is the leader.
71func (rf *Raft) GetState() (int, bool) {
72
73 var term int
74 var isleader bool
75 // Your code here (2A).
76 return term, isleader
77}
78
79//
80// save Raft's persistent state to stable storage,

Callers 8

LeaderMethod · 0.80
LeaderMethod · 0.80
TestConcurrentStarts2BFunction · 0.80
TestCount2BFunction · 0.80
checkOneLeaderMethod · 0.80
checkTermsMethod · 0.80
checkNoLeaderMethod · 0.80
waitMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestConcurrentStarts2BFunction · 0.64
TestCount2BFunction · 0.64