public static enum Replica.State extends Enum<Replica.State>
/live_nodes in ZK, the replica's state should be
discarded.| 枚举常量和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Replica.State |
getState(String stateStr)
Converts the state string to a State instance.
|
String |
toString() |
static Replica.State |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static Replica.State[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
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.Statepublic static Replica.State[] values()
for (Replica.State c : Replica.State.values()) System.out.println(c);
public static Replica.State valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public String toString()
toString 在类中 Enum<Replica.State>public static Replica.State getState(String stateStr)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.