Interface RaftNodeReport


public interface RaftNodeReport
Contains information about a Raft node's local state related to the execution of the Raft consensus algorithm.

Raft node reports are published either periodically or when there is a change in the local state of a Raft node related to the Raft consensus algorithm. The duration of the periodic report publishing is configured via RaftConfig.RaftConfigBuilder.setRaftNodeReportPublishPeriodSecs(int).

See Also:
  • Method Details

    • getReason

    • getGroupId

      @Nonnull Object getGroupId()
      Returns the unique ID of the Raft group that this Raft node belongs to.
      Returns:
      the unique ID of the Raft group that this Raft node belongs to
    • getEndpoint

      @Nonnull RaftEndpoint getEndpoint()
      Returns the local endpoint of the Raft node.
      Returns:
      the local endpoint of the Raft node
    • getInitialMembers

      @Nonnull RaftGroupMembers getInitialMembers()
      Returns the initial members of the Raft group this Raft node belongs to.
      Returns:
      the initial members of the Raft group this Raft node belongs to
    • getCommittedMembers

      @Nonnull RaftGroupMembers getCommittedMembers()
      Returns the last committed member list of the Raft group this Raft node belongs to.

      Please note that the returned member list is read from the local state and can be different from the currently effective applied member list, if there is an ongoing (appended but not-yet committed) membership change in the group. It can be different from the current committed member list of the Raft group, also if a new membership change is committed by other Raft nodes of the group but not learnt by this Raft node yet.

      Returns:
      the last committed member list of the Raft group this Raft node belongs to
    • getEffectiveMembers

      @Nonnull RaftGroupMembers getEffectiveMembers()
      Returns the currently effective member list of the Raft group this Raft node belongs to.

      Please note that the returned member list is read from the local state and can be different from the committed member list, if there is an ongoing (appended but not-yet committed) membership change in the Raft group.

      Returns:
      the currently effective member list of the Raft group this Raft node belongs to
    • getRole

      @Nonnull RaftRole getRole()
      Returns the role of the Raft node in the current term. If the returned role is RaftRole.LEADER, it means the local Raft node has received heartbeats from the majority in the last RaftConfig.leaderHeartbeatTimeoutSecs seconds.
      Returns:
      the role of the Raft node in the current term
    • getStatus

      @Nonnull RaftNodeStatus getStatus()
      Returns the status of the Raft node.
      Returns:
      the status of the Raft node
    • getTerm

      @Nonnull RaftTerm getTerm()
      Returns the locally known term information.

      Please note that other nodes may have already switched to a higher term.

      Returns:
      the locally known term information
    • getLog

      @Nonnull RaftLogStats getLog()
      Returns statistics about a Raft node's local Raft log.
      Returns:
      statistics about a Raft node's local Raft log
    • getHeartbeatTimestamps

      @Nonnull Map<RaftEndpoint,Long> getHeartbeatTimestamps()
      Returns timestamps of latest heartbeats sent by the non-leader nodes to the leader Raft node, including both RaftRole.FOLLOWER and RaftRole.LEARNER nodes. The leader node's RaftEndpoint is not present in the map. This map is returned non-empty only by the leader Raft node.
      Returns:
      timestamps of latest heartbeats sent by the non-leader nodes
    • getQuorumHeartbeatTimestamp

      @Nonnull Optional<Long> getQuorumHeartbeatTimestamp()
      Returns earliest heartbeat timestamp of the replication quorum. This method returns a non-empty value only for the leader Raft node. For instance, this method returns 8 for the following heartbeat timestamps of 5 Raft nodes, A (leader) ts = -, B (follower) ts = 10, C (follower) ts = 8, D (follower) ts = 6, E (follower) ts = 4. Please note that RaftRole.LEARNER nodes and their heartbeats are excluded in quorum calculations.
      Returns:
      earliest heartbeat timestamp of the replication quorum
    • getLeaderHeartbeatTimestamp

      @Nonnull Optional<Long> getLeaderHeartbeatTimestamp()
      Returns timestamp of the latest heartbeat received from the leader Raft node. This method returns a non-empty value only from a non-leader Raft node if it has ever received a heartbeat from the leader.
      Returns:
      timestamp of the latest heartbeat received from the leader Raft node