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 Type
    Method
    Description
    long
    Returns the index of the highest log entry known to be committed.
    id()
    Returns the identifier of the local node.
    long
    Returns the index of the highest log entry applied to the state machine.
    Returns the identifier of the current leader node.
    long
    Returns the current term number.
  • Method Details

    • id

      String id()
      Returns the identifier of the local node.
      Returns:
      the local node identifier
    • leader

      String leader()
      Returns the identifier of the current leader node.

      May return null if no leader is currently known or during leader election periods.

      Returns:
      the leader node identifier, or null if 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