Package io.microraft
Enum MembershipChangeMode
- java.lang.Object
-
- java.lang.Enum<MembershipChangeMode>
-
- io.microraft.MembershipChangeMode
-
- All Implemented Interfaces:
Serializable
,Comparable<MembershipChangeMode>
public enum MembershipChangeMode extends Enum<MembershipChangeMode>
Types of membership changes that occur on Raft groups.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD_LEARNER
Denotes that a new Raft endpoint will be added to the Raft group as aRaftRole.LEARNER
.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.REMOVE_MEMBER
Denotes that a Raft endpoint will be removed from the Raft group.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MembershipChangeMode
valueOf(String name)
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 Detail
-
ADD_LEARNER
public static final MembershipChangeMode 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
public static final MembershipChangeMode 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
public static final MembershipChangeMode REMOVE_MEMBER
Denotes that a Raft endpoint will be removed from the Raft group.
-
-
Method Detail
-
values
public static MembershipChangeMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MembershipChangeMode c : MembershipChangeMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MembershipChangeMode valueOf(String name)
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
-
-