public enum ElectionState extends Enum<ElectionState>
ConsensusModule which get represented by a code() stored in a
Counter of the type ConsensusModule.Configuration.ELECTION_STATE_TYPE_ID.| Enum Constant and Description |
|---|
CANDIDATE_BALLOT
Await ballot outcome from members on candidacy for leadership.
|
CANVASS
Canvass members for current state and to assess if a successful leadership attempt can be mounted.
|
CLOSED
Election is closed after new leader is established.
|
FOLLOWER_BALLOT
Await ballot outcome after voting for a candidate.
|
FOLLOWER_CATCHUP
Catch-up to leader until live log can be added and merged.
|
FOLLOWER_CATCHUP_AWAIT
Await joining a replay from leader to catch-up.
|
FOLLOWER_CATCHUP_INIT
Initialise catch-up in preparation of receiving a replay from the leader to catch up in current term.
|
FOLLOWER_LOG_AWAIT
Await joining the live log from the leader.
|
FOLLOWER_LOG_INIT
Initialise follower in preparation for joining the live log.
|
FOLLOWER_LOG_REPLICATION
Replicate missing log entries from the leader.
|
FOLLOWER_READY
Publish append position to leader to signify ready for new term.
|
FOLLOWER_REPLAY
Replay local log in preparation for following new leader.
|
INIT
Consolidate local state and prepare for new leadership.
|
LEADER_INIT
Initialise state for new leadership term.
|
LEADER_LOG_REPLICATION
Wait for followers to replicate any missing log entries to track commit position.
|
LEADER_READY
Publish new leadership term and commit position, while awaiting followers ready.
|
LEADER_REPLAY
Replay local log in preparation for new leadership term.
|
NOMINATE
Nominate member for new leadership by requesting votes.
|
| Modifier and Type | Method and Description |
|---|---|
int |
code()
Code stored in a
Counter to represent the election state. |
static ElectionState |
get(AtomicCounter counter)
Get the
ElectionState value based on the value stored in an AtomicCounter. |
static ElectionState |
get(long code)
Get the enum value for a given code stored in a counter.
|
static ElectionState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ElectionState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ElectionState INIT
public static final ElectionState CANVASS
public static final ElectionState NOMINATE
public static final ElectionState CANDIDATE_BALLOT
public static final ElectionState FOLLOWER_BALLOT
public static final ElectionState LEADER_LOG_REPLICATION
public static final ElectionState LEADER_REPLAY
public static final ElectionState LEADER_INIT
public static final ElectionState LEADER_READY
public static final ElectionState FOLLOWER_LOG_REPLICATION
public static final ElectionState FOLLOWER_REPLAY
public static final ElectionState FOLLOWER_CATCHUP_INIT
public static final ElectionState FOLLOWER_CATCHUP_AWAIT
public static final ElectionState FOLLOWER_CATCHUP
public static final ElectionState FOLLOWER_LOG_INIT
public static final ElectionState FOLLOWER_LOG_AWAIT
public static final ElectionState FOLLOWER_READY
public static final ElectionState CLOSED
public static ElectionState[] values()
for (ElectionState c : ElectionState.values()) System.out.println(c);
public static ElectionState valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int code()
Counter to represent the election state.Counter to represent the election state.public static ElectionState get(long code)
code - representing election state.public static ElectionState get(AtomicCounter counter)
ElectionState value based on the value stored in an AtomicCounter.counter - to read the value for matching against code().ElectionState value based on the value stored in an AtomicCounter.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.