Interface JGroupsRaftState
public interface JGroupsRaftState
Read-only view of the current Raft protocol state.
This interface provides access to key Raft state variables for monitoring and observability purposes. All values reflect the local node's view of the cluster state at the time of access.
- Since:
- 2.0
- Author:
- José Bolina
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the index of the highest log entry known to be committed.id()Returns the identifier of the local node.longReturns the index of the highest log entry applied to the state machine.leader()Returns the identifier of the current leader node.longterm()Returns the current term number.
-
Method Details
-
id
-
leader
String leader()Returns the identifier of the current leader node.May return
nullif no leader is currently known or during leader election periods.- Returns:
- the leader node identifier, or
nullif unknown
-
term
long term()Returns the current term number.Terms are used to detect obsolete information and ensure logical time ordering in the Raft algorithm.
- Returns:
- the current term
-
commitIndex
long commitIndex()Returns the index of the highest log entry known to be committed.Committed entries are guaranteed to be durable and will not be lost.
- Returns:
- the commit index
-
lastApplied
long lastApplied()Returns the index of the highest log entry applied to the state machine.This value is always less than or equal to the commit index;'.
- Returns:
- the last applied index
-