Package io.microraft.report
Interface RaftTerm
-
public interface RaftTermContains a snapshot of a Raft node's current state in a term.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RaftEndpointgetLeaderEndpoint()Returns the known Raft leader endpoint in the current term, or null if unknown.intgetTerm()Returns the term this Raft node is currently at.RaftEndpointgetVotedEndpoint()Returns the Raft endpoint that this Raft node has voted for in the current term, or null if none.
-
-
-
Method Detail
-
getTerm
int getTerm()
Returns the term this Raft node is currently at.- Returns:
- the term this Raft node is currently at
-
getLeaderEndpoint
@Nullable RaftEndpoint getLeaderEndpoint()
Returns the known Raft leader endpoint in the current term, or null if unknown. For a non-leader Raft node, if this method returns a non-null Raft endpoint, it means the local Raft node has recently received a heartbeat from the leader.- Returns:
- the known Raft leader endpoint in the current term, or null if unknown
-
getVotedEndpoint
@Nullable RaftEndpoint getVotedEndpoint()
Returns the Raft endpoint that this Raft node has voted for in the current term, or null if none.- Returns:
- the Raft endpoint that this Raft node has voted for in the current term, or null if none
-
-