public enum NodeState extends Enum<NodeState>
Enum Constant and Description |
---|
DOWN
A node is considered down in either of the following situations: 1) the driver has lost all
connections to the node (and is currently trying to reconnect), or 2) the driver is not
actively trying to connect to the node (because it's ignored by the
LoadBalancingPolicy ), but it has received a topology event indicating that the node is down. |
FORCED_DOWN
The node was forced down externally, the driver will never try to reconnect to it, whatever the
LoadBalancingPolicy says. |
UNKNOWN
The driver has never tried to connect to the node, nor received any topology events about it.
|
UP
A node is considered up in either of the following situations: 1) the driver has at least one
active connection to the node, or 2) the driver is not actively trying to connect to the node
(because it's ignored by the
LoadBalancingPolicy ), but it has received a topology event
indicating that the node is up. |
Modifier and Type | Method and Description |
---|---|
static NodeState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NodeState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NodeState UNKNOWN
This happens when nodes are first added to the cluster, and will persist if your LoadBalancingPolicy
decides to ignore them. Since the driver does not connect to them, the
only way it can assess their states is from topology events.
public static final NodeState UP
LoadBalancingPolicy
), but it has received a topology event
indicating that the node is up.public static final NodeState DOWN
LoadBalancingPolicy
), but it has received a topology event indicating that the node is down.public static final NodeState FORCED_DOWN
LoadBalancingPolicy
says.
This is used for edge error cases, for example when the driver detects that it's trying to
connect to a node that does not belong to the Cassandra cluster (e.g. a wrong address was
provided in the contact points). It can also be triggered explicitly
by components (for example a
custom load balancing policy) that want to limit the number of nodes that the driver connects
to.
public static NodeState[] values()
for (NodeState c : NodeState.values()) System.out.println(c);
public static NodeState 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 nullCopyright © 2017–2024. All rights reserved.