Interface RaftNodeReport
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)
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Denotes the reason for a given report -
Method Summary
Modifier and TypeMethodDescriptionReturns the last committed member list of the Raft group this Raft node belongs to.Returns the currently effective member list of the Raft group this Raft node belongs to.Returns the local endpoint of the Raft node.Returns the unique ID of the Raft group that this Raft node belongs to.Returns timestamps of latest heartbeats sent by the non-leader nodes to the leader Raft node, including bothRaftRole.FOLLOWER
andRaftRole.LEARNER
nodes.Returns the initial members of the Raft group this Raft node belongs to.Returns timestamp of the latest heartbeat received from the leader Raft node.getLog()
Returns statistics about a Raft node's local Raft log.Returns earliest heartbeat timestamp of the replication quorum.getRole()
Returns the role of the Raft node in the current term.Returns the status of the Raft node.getTerm()
Returns the locally known term information.
-
Method Details
-
getReason
RaftNodeReport.RaftNodeReportReason getReason() -
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
Returns the local endpoint of the Raft node.- Returns:
- the local endpoint of the Raft node
-
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
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
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
Returns the role of the Raft node in the current term. If the returned role isRaftRole.LEADER
, it means the local Raft node has received heartbeats from the majority in the lastRaftConfig.leaderHeartbeatTimeoutSecs
seconds.- Returns:
- the role of the Raft node in the current term
-
getStatus
Returns the status of the Raft node.- Returns:
- the status of the Raft node
-
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
Returns statistics about a Raft node's local Raft log.- Returns:
- statistics about a Raft node's local Raft log
-
getHeartbeatTimestamps
Returns timestamps of latest heartbeats sent by the non-leader nodes to the leader Raft node, including bothRaftRole.FOLLOWER
andRaftRole.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
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 thatRaftRole.LEARNER
nodes and their heartbeats are excluded in quorum calculations.- Returns:
- earliest heartbeat timestamp of the replication quorum
-
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
-