Package io.permazen.kv.raft
Class FollowerRole
java.lang.Object
io.permazen.kv.raft.Role
io.permazen.kv.raft.NonLeaderRole
io.permazen.kv.raft.FollowerRole
Raft follower role.
-
Method Summary
Modifier and TypeMethodDescriptionGet the address of my leader, if known.Get the identity of my leader, if known.int
Determine the number of nodes (including this node) that this node has successfully probed when probing for a majority of nodes withPingRequest
s prior to reverting to a candidate.Get the identity of the node that this node voted for this term, if any.boolean
Determine whether this node is currently in the process of receiving a whole database snapshot download.toString()
Methods inherited from class io.permazen.kv.raft.NonLeaderRole
getElectionTimeout, startElection
Methods inherited from class io.permazen.kv.raft.Role
getKVDatabase, isLeaderLeaseActiveAt, isLeaderLeaseActiveNow
-
Method Details
-
getLeaderIdentity
Get the identity of my leader, if known.- Returns:
- leader identity, or null if not known
-
getLeaderAddress
Get the address of my leader, if known.- Returns:
- leader address, or null if not known
-
getVotedFor
Get the identity of the node that this node voted for this term, if any.- Returns:
- node voted for, or null if none
-
isInstallingSnapshot
public boolean isInstallingSnapshot()Determine whether this node is currently in the process of receiving a whole database snapshot download.- Returns:
- true if snapshot install is in progress
-
getNodesProbed
public int getNodesProbed()Determine the number of nodes (including this node) that this node has successfully probed when probing for a majority of nodes withPingRequest
s prior to reverting to a candidate.- Returns:
- the number of other nodes this node has successfully probed, or -1 if not probing
-
toString
-