|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ReplicatedEnvironment.State>
com.sleepycat.je.rep.ReplicatedEnvironment.State
public static enum ReplicatedEnvironment.State
The replication node state determines the operations that the
application can perform against its replicated environment.
The method ReplicatedEnvironment.getState()
returns the current state.
When the first handle to a ReplicatedEnvironment
is instantiated
and the node is bought up, it always starts out in the
DETACHED
state and then transitions to the
MASTER
or REPLICA
state before returning from
the constructor.
When nodes in the group become unavailable and elections are held, the
node may transition between MASTER
and REPLICA
states.
When the last handle to the environment is closed, the node transitions
back to the DETACHED
state.
The state transitions for a node can be summarized by the regular expression:
DETACHED [ MASTER | REPLICA | UNKNOWN ]+ DETACHED
, with
the following caveats:
MASTER
state never follows a MASTER
state,
since that would represent a redundant transition.
UNKNOWN
state never follows an
UNKNOWN
state, since that would be redundant transition.
REPLICA
state can follow a REPLICA
state, as
long as this node is not the MASTER
.
The initial DETACHED
state is internal to the JE HA
implementation and is not visible to the application.
Enum Constant Summary | |
---|---|
DETACHED
The node is not associated with the group. |
|
MASTER
The node is the unique master of the group and can both read and write to its environment. |
|
REPLICA
The node is a replica that is being updated by the master. |
|
UNKNOWN
The node is not currently in contact with its group, but is actively trying to establish contact and decide upon a master. |
Method Summary | |
---|---|
boolean |
isActive()
|
boolean |
isDetached()
|
boolean |
isMaster()
|
boolean |
isReplica()
|
boolean |
isUnknown()
|
static ReplicatedEnvironment.State |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static ReplicatedEnvironment.State[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final ReplicatedEnvironment.State DETACHED
public static final ReplicatedEnvironment.State UNKNOWN
public static final ReplicatedEnvironment.State MASTER
public static final ReplicatedEnvironment.State REPLICA
Method Detail |
---|
public static ReplicatedEnvironment.State[] values()
for (ReplicatedEnvironment.State c : ReplicatedEnvironment.State.values()) System.out.println(c);
public static ReplicatedEnvironment.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 name
NullPointerException
- if the argument is nullpublic final boolean isMaster()
public final boolean isReplica()
public final boolean isDetached()
public final boolean isUnknown()
public final boolean isActive()
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |