Package io.microraft
Enum MembershipChangeMode
- All Implemented Interfaces:
Serializable
,Comparable<MembershipChangeMode>
,java.lang.constant.Constable
Types of membership changes that occur on Raft groups.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDenotes that a new Raft endpoint will be added to the Raft group as aRaftRole.LEARNER
.Denotes that either a new Raft endpoint will be added to the Raft group as aRaftRole.FOLLOWER
, or an existing (i.e.,RaftRole.LEARNER
Raft endpoint in the Raft group will be promoted to theRaftRole.FOLLOWER
role.Denotes that a Raft endpoint will be removed from the Raft group. -
Method Summary
Modifier and TypeMethodDescriptionstatic MembershipChangeMode
Returns the enum constant of this type with the specified name.static MembershipChangeMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ADD_LEARNER
Denotes that a new Raft endpoint will be added to the Raft group as aRaftRole.LEARNER
. The quorum size of the Raft group will not change after the new Raft endpoint is added, since the number of voting members stays the same. Once the new Raft endpoint catches up with the leader, it can be promoted to the voting member role viaADD_OR_PROMOTE_TO_FOLLOWER
. -
ADD_OR_PROMOTE_TO_FOLLOWER
Denotes that either a new Raft endpoint will be added to the Raft group as aRaftRole.FOLLOWER
, or an existing (i.e.,RaftRole.LEARNER
Raft endpoint in the Raft group will be promoted to theRaftRole.FOLLOWER
role. The quorum size of the Raft group is re-calculated based on the new number of voting members. -
REMOVE_MEMBER
Denotes that a Raft endpoint will be removed from the Raft group.
-
-
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
-