Package io.permazen.kv.raft
Class NonLeaderRole
java.lang.Object
io.permazen.kv.raft.Role
io.permazen.kv.raft.NonLeaderRole
- Direct Known Subclasses:
CandidateRole
,FollowerRole
-
Method Summary
Modifier and TypeMethodDescriptionGet the election timer deadline, if currently running.void
Force an immediate election timeout.Methods inherited from class io.permazen.kv.raft.Role
getKVDatabase, isLeaderLeaseActiveAt, isLeaderLeaseActiveNow, toString
-
Method Details
-
getElectionTimeout
Get the election timer deadline, if currently running.For a follower that is not a member of its cluster, this will return null because no election timer is running. For all other cases, this will return the time at which the election timer expires.
- Returns:
- current election timer expiration deadline, or null if not running
-
startElection
public void startElection()Force an immediate election timeout.- Throws:
IllegalStateException
- if this role is no longer active or election timer is not running
-