public static enum Replica.State extends Enum<Replica.State>
/live_nodes
in ZK, the replica's state should be
discarded.Enum Constant and Description |
---|
ACTIVE
The replica is ready to receive updates and queries.
|
DOWN
The first state before
RECOVERING . |
RECOVERING
The node is recovering from the leader.
|
RECOVERY_FAILED
Recovery attempts have not worked, something is not right.
|
Modifier and Type | Field and Description |
---|---|
String |
shortName
short name for a state.
|
Modifier and Type | Method and 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.
|
public static final Replica.State ACTIVE
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)
).
public static final Replica.State DOWN
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.
public static final Replica.State RECOVERING
public static final Replica.State RECOVERY_FAILED
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.
public final String shortName
PerReplicaStates.State
public static Replica.State[] values()
for (Replica.State c : Replica.State.values()) System.out.println(c);
public static Replica.State valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String toString()
toString
in class Enum<Replica.State>
public static Replica.State getState(String stateStr)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.