Enum Class ConsensusModule.State

java.lang.Object
java.lang.Enum<ConsensusModule.State>
io.aeron.cluster.ConsensusModule.State
All Implemented Interfaces:
Serializable, Comparable<ConsensusModule.State>, Constable
Enclosing class:
ConsensusModule

public static enum ConsensusModule.State extends Enum<ConsensusModule.State>
Possible states for the ConsensusModule. These will be reflected in the ConsensusModule.Context.moduleStateCounter() counter.
  • Enum Constant Details

    • INIT

      public static final ConsensusModule.State INIT
      Starting up and recovering state.
    • ACTIVE

      public static final ConsensusModule.State ACTIVE
      Active state with ingress and expired timers appended to the log.
    • SUSPENDED

      public static final ConsensusModule.State SUSPENDED
      Suspended processing of ingress and expired timers.
    • SNAPSHOT

      public static final ConsensusModule.State SNAPSHOT
      In the process of taking a snapshot.
    • QUITTING

      public static final ConsensusModule.State QUITTING
      Quitting the cluster and shutting down as soon as services ack without taking a snapshot.
    • TERMINATING

      public static final ConsensusModule.State TERMINATING
      In the process of terminating the node.
    • CLOSED

      public static final ConsensusModule.State CLOSED
      Terminal state.
  • Method Details

    • values

      public static ConsensusModule.State[] 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 ConsensusModule.State 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 final int code()
      Code to be stored in an AtomicCounter for the enum value.
      Returns:
      code to be stored in an AtomicCounter for the enum value.
    • get

      public static ConsensusModule.State get(AtomicCounter counter)
      Get the ConsensusModule.State encoded in an AtomicCounter.
      Parameters:
      counter - to get the current state for.
      Returns:
      the state for the ConsensusModule.
      Throws:
      ClusterException - if the counter is not one of the valid values.
    • get

      public static ConsensusModule.State get(long code)
      Get the ConsensusModule.State corresponding to a particular code.
      Parameters:
      code - representing a ConsensusModule.State.
      Returns:
      the ConsensusModule.State corresponding to the provided code.
      Throws:
      ClusterException - if the code does not correspond to a valid State.
    • find

      public static ConsensusModule.State find(CountersReader counters, int clusterId)
      Get the current state of the ConsensusModule.
      Parameters:
      counters - to search within.
      clusterId - to which the allocated counter belongs.
      Returns:
      the state of the ConsensusModule or null if not found.