Enum Class ElectionState

java.lang.Object
java.lang.Enum<ElectionState>
io.aeron.cluster.ElectionState
All Implemented Interfaces:
Serializable, Comparable<ElectionState>, Constable

public enum ElectionState extends Enum<ElectionState>
Election states for a ConsensusModule which get represented by a code() stored in a Counter of the type ConsensusModule.Configuration.ELECTION_STATE_TYPE_ID.
  • Enum Constant Details

    • INIT

      public static final ElectionState INIT
      Consolidate local state and prepare for new leadership.
    • CANVASS

      public static final ElectionState CANVASS
      Canvass members for current state and to assess if a successful leadership attempt can be mounted.
    • NOMINATE

      public static final ElectionState NOMINATE
      Nominate member for new leadership by requesting votes.
    • CANDIDATE_BALLOT

      public static final ElectionState CANDIDATE_BALLOT
      Await ballot outcome from members on candidacy for leadership.
    • FOLLOWER_BALLOT

      public static final ElectionState FOLLOWER_BALLOT
      Await ballot outcome after voting for a candidate.
    • LEADER_LOG_REPLICATION

      public static final ElectionState LEADER_LOG_REPLICATION
      Wait for followers to replicate any missing log entries to track commit position.
    • LEADER_REPLAY

      public static final ElectionState LEADER_REPLAY
      Replay local log in preparation for new leadership term.
    • LEADER_INIT

      public static final ElectionState LEADER_INIT
      Initialise state for new leadership term.
    • LEADER_READY

      public static final ElectionState LEADER_READY
      Publish new leadership term and commit position, while awaiting followers ready.
    • FOLLOWER_LOG_REPLICATION

      public static final ElectionState FOLLOWER_LOG_REPLICATION
      Replicate missing log entries from the leader.
    • FOLLOWER_REPLAY

      public static final ElectionState FOLLOWER_REPLAY
      Replay local log in preparation for following new leader.
    • FOLLOWER_CATCHUP_INIT

      public static final ElectionState FOLLOWER_CATCHUP_INIT
      Initialise catch-up in preparation of receiving a replay from the leader to catch up in current term.
    • FOLLOWER_CATCHUP_AWAIT

      public static final ElectionState FOLLOWER_CATCHUP_AWAIT
      Await joining a replay from leader to catch-up.
    • FOLLOWER_CATCHUP

      public static final ElectionState FOLLOWER_CATCHUP
      Catch-up to leader until live log can be added and merged.
    • FOLLOWER_LOG_INIT

      public static final ElectionState FOLLOWER_LOG_INIT
      Initialise follower in preparation for joining the live log.
    • FOLLOWER_LOG_AWAIT

      public static final ElectionState FOLLOWER_LOG_AWAIT
      Await joining the live log from the leader.
    • FOLLOWER_READY

      public static final ElectionState FOLLOWER_READY
      Publish append position to leader to signify ready for new term.
    • CLOSED

      public static final ElectionState CLOSED
      Election is closed after new leader is established.
  • Method Details

    • values

      public static ElectionState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ElectionState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public int code()
      Code stored in a Counter to represent the election state.
      Returns:
      code stored in a Counter to represent the election state.
    • get

      public static ElectionState get(long code)
      Get the enum value for a given code stored in a counter.
      Parameters:
      code - representing election state.
      Returns:
      the enum value for a given code stored in a counter.
    • get

      public static ElectionState get(AtomicCounter counter)
      Get the ElectionState value based on the value stored in an AtomicCounter.
      Parameters:
      counter - to read the value for matching against code().
      Returns:
      the ElectionState value based on the value stored in an AtomicCounter.