Package io.permazen.kv.raft
Class CandidateRole
java.lang.Object
io.permazen.kv.raft.Role
io.permazen.kv.raft.NonLeaderRole
io.permazen.kv.raft.CandidateRole
Raft candidate role.
-
Method Summary
Modifier and TypeMethodDescriptionintGet the number of votes received so far.intGet the number of votes required to win the election.toString()Methods inherited from class io.permazen.kv.raft.NonLeaderRole
getElectionTimeout, startElectionMethods inherited from class io.permazen.kv.raft.Role
getKVDatabase, isLeaderLeaseActiveAt, isLeaderLeaseActiveNow
-
Method Details
-
getVotesRequired
public int getVotesRequired()Get the number of votes required to win the election.- Returns:
- required votes
-
getVotesReceived
public int getVotesReceived()Get the number of votes received so far. Includes this node's vote.- Returns:
- received votes
-
toString
-