public static enum RaftProxy.State extends Enum<RaftProxy.State>
Throughout the lifetime of a client, the client will transition through various states according to its
ability to communicate with the cluster within the context of a RaftProxy. In some cases, client
state changes may be indicative of a loss of guarantees. Users of the client should
watch the state of the client to determine when guarantees
are lost and react to changes in the client's ability to communicate with the cluster.
client.onStateChange(state -> {
switch (state) {
case CONNECTED:
// The client is healthy
break;
case SUSPENDED:
// The client cannot connect to the cluster and operations may be unsafe
break;
case CLOSED:
// The client has been closed and pending operations have failed
break;
}
});
So long as the client is in the CONNECTED state, all guarantees with respect to reads and writes will
be maintained, and a loss of the CONNECTED state may indicate a loss of linearizability. See the specific
states for more info.| Enum Constant and Description |
|---|
CLOSED
Indicates that the client is closed.
|
CONNECTED
Indicates that the client is connected and its session is open.
|
SUSPENDED
Indicates that the client is suspended and its session may or may not be expired.
|
| Modifier and Type | Method and Description |
|---|---|
static RaftProxy.State |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RaftProxy.State[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RaftProxy.State CONNECTED
public static final RaftProxy.State SUSPENDED
public static final RaftProxy.State CLOSED
public static RaftProxy.State[] values()
for (RaftProxy.State c : RaftProxy.State.values()) System.out.println(c);
public static RaftProxy.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 nullCopyright © 2013–2017. All rights reserved.