Enum Class Replica.State

java.lang.Object
java.lang.Enum<Replica.State>
org.apache.solr.common.cloud.Replica.State
All Implemented Interfaces:
Serializable, Comparable<Replica.State>, java.lang.constant.Constable
Enclosing class:
Replica

public static enum Replica.State extends Enum<Replica.State>
The replica's state. In general, if the node the replica is hosted on is not under /live_nodes in ZK, the replica's state should be discarded.
  • Enum Constant Details

    • ACTIVE

      public static final Replica.State ACTIVE
      The replica is ready to receive updates and queries.

      NOTE: when the node the replica is hosted on crashes, the replica's state may remain ACTIVE in ZK. To determine if the replica is truly active, you must also verify that its node is under /live_nodes in ZK (or use ClusterState.liveNodesContain(String)).

    • DOWN

      public static final Replica.State DOWN
      The first state before RECOVERING. A node in this state should be actively trying to move to RECOVERING.

      NOTE: a replica's state may appear DOWN in ZK also when the node it's hosted on gracefully shuts down. This is a "best effort" though, and should not be relied on.

    • RECOVERING

      public static final Replica.State RECOVERING
      The node is recovering from the leader. This might involve peer-sync, full replication or finding out things are already in sync.
    • RECOVERY_FAILED

      public static final Replica.State RECOVERY_FAILED
      Recovery attempts has not worked, something is not right.

      NOTE: This state doesn't matter if the node is not part of /live_nodes in ZK; in that case the node is not part of the cluster, and it's state should be discarded.

  • Field Details

    • shortName

      public final String shortName
      short name for a state. Used to encode this in the state node see PerReplicaStates.State
    • longName

      public final String longName
  • Method Details

    • values

      public static Replica.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 Replica.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
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Replica.State>
    • getState

      public static Replica.State getState(String stateStr)
      Converts the state string to a State instance.