Package org.apache.solr.common.cloud
Enum Class Replica.State
- All Implemented Interfaces:
Serializable,Comparable<Replica.State>,java.lang.constant.Constable
- Enclosing class:
Replica
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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe replica is ready to receive updates and queries.The first state beforeRECOVERING.The node is recovering from the leader.Recovery attempts has not worked, something is not right. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Replica.StateConverts the state string to a State instance.toString()static Replica.StateReturns the enum constant of this class with the specified name.static Replica.State[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
nodeis under/live_nodesin ZK (or useClusterState.liveNodesContain(String)). -
DOWN
The first state beforeRECOVERING. A node in this state should be actively trying to move toRECOVERING.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
The node is recovering from the leader. This might involve peer-sync, full replication or finding out things are already in sync. -
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_nodesin ZK; in that case the node is not part of the cluster, and it's state should be discarded.
-
-
Field Details
-
shortName
short name for a state. Used to encode this in the state node seePerReplicaStates.State -
longName
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
toString
- Overrides:
toStringin classEnum<Replica.State>
-
getState
Converts the state string to a State instance.
-