Package io.microraft
Enum RaftNodeStatus
- All Implemented Interfaces:
Serializable
,Comparable<RaftNodeStatus>
,java.lang.constant.Constable
Statuses of a Raft node during its own and its Raft group's lifecycle.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA Raft node stays in this status when there is no ongoing membership change or a Raft group termination process.Initial status of a Raft node.A Raft node moves to this status either when it is removed from the Raft group member list, or it is being terminated on its own, for instance, because its JVM is shutting down.A Raft node moves to this status when a Raft group membership change operation is appended to its Raft log and stays in this status until the membership change is either committed or reverted. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isTerminal
(RaftNodeStatus status) Returns true if the given Raft node status is a terminal.static RaftNodeStatus
Returns the enum constant of this type with the specified name.static RaftNodeStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INITIAL
Initial status of a Raft node. It stays in this status until it is started. -
ACTIVE
A Raft node stays in this status when there is no ongoing membership change or a Raft group termination process. Operations are committed in this status. -
UPDATING_RAFT_GROUP_MEMBER_LIST
A Raft node moves to this status when a Raft group membership change operation is appended to its Raft log and stays in this status until the membership change is either committed or reverted. New operations can be replicated while there is an ongoing membership change in the Raft group, but no other membership change, or leadership transfer can be triggered until the ongoing membership change process is completed. -
TERMINATED
A Raft node moves to this status either when it is removed from the Raft group member list, or it is being terminated on its own, for instance, because its JVM is shutting down.A Raft node stops running the Raft consensus algorithm in this status.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isTerminal
Returns true if the given Raft node status is a terminal. A Raft node stops running the Raft consensus algorithm in a terminal status.- Parameters:
status
- the status object to check- Returns:
- true if the given status is terminal, false otherwise
-