Package org.apache.solr.common.cloud
Enum Replica.State
- java.lang.Object
-
- java.lang.Enum<Replica.State>
-
- org.apache.solr.common.cloud.Replica.State
-
- All Implemented Interfaces:
Serializable
,Comparable<Replica.State>
- 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 Summary
Enum Constants Enum Constant Description ACTIVE
The replica is ready to receive updates and queries.DOWN
The first state beforeRECOVERING
.RECOVERING
The node is recovering from the leader.RECOVERY_FAILED
Recovery attempts have not worked, something is not right.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Replica.State
getState(String stateStr)
Converts the state string to a State instance.String
toString()
static Replica.State
valueOf(String name)
Returns the enum constant of this type with the specified name.static Replica.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 useClusterState.liveNodesContain(String)
).
-
DOWN
public static final Replica.State 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
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 have 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 Detail
-
shortName
public final String shortName
short name for a state. Used to encode this in the state node seePerReplicaStates.State
-
longName
public final String longName
-
-
Method Detail
-
values
public static Replica.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Replica.State c : Replica.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Replica.State valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
public String toString()
- Overrides:
toString
in classEnum<Replica.State>
-
getState
public static Replica.State getState(String stateStr)
Converts the state string to a State instance.
-
-