|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.Durability
public class Durability
Durability defines the overall durability characteristics associated with a
transaction. When operating on a local environment the durability of a
transaction is completely determined by the local Durability.SyncPolicy
that is
in effect. When using replication, the overall durability is a function of
the local Durability.SyncPolicy
plus the Durability.ReplicaAckPolicy
used by the
master and the Durability.SyncPolicy
in effect at each Replica.
Nested Class Summary | |
---|---|
static class |
Durability.ReplicaAckPolicy
A replicated environment makes it possible to increase an application's transaction commit guarantees by committing changes to its replicas on the network. |
static class |
Durability.SyncPolicy
Defines the synchronization policy to be used when committing a transaction. |
Field Summary | |
---|---|
static Durability |
COMMIT_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_NO_SYNC for local commit synchronization. |
static Durability |
COMMIT_SYNC
A convenience constant that defines a durability policy with COMMIT_SYNC for local commit synchronization. |
static Durability |
COMMIT_WRITE_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_WRITE_NO_SYNC for local commit synchronization. |
static Durability |
READ_ONLY_TXN
A convenience constant that defines a durability policy, with ReplicaAckPolicy.NONE for use with a read only transaction. |
Constructor Summary | |
---|---|
Durability(Durability.SyncPolicy localSync,
Durability.SyncPolicy replicaSync,
Durability.ReplicaAckPolicy replicaAck)
Creates an instance of a Durability specification. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
Durability.SyncPolicy |
getLocalSync()
Returns the transaction synchronization policy to be used locally when committing a transaction. |
Durability.ReplicaAckPolicy |
getReplicaAck()
Returns the replica acknowledgment policy used by the master when committing changes to a replicated environment. |
Durability.SyncPolicy |
getReplicaSync()
Returns the transaction synchronization policy to be used by the replica as it replays a transaction that needs an acknowledgment. |
int |
hashCode()
|
static Durability |
parse(String durabilityString)
Parses the string and returns the durability it represents. |
String |
toString()
Returns the string representation of durability in the format defined by string form of the Durability constructor. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Durability COMMIT_SYNC
public static final Durability COMMIT_NO_SYNC
public static final Durability COMMIT_WRITE_NO_SYNC
public static final Durability READ_ONLY_TXN
ReplicaAckPolicy.NONE
for use with a read only transaction.
A read only transaction on a Master, using this Durability, will thus
not be held up, or throw InsufficientReplicasException
, if
the Master is not in contact with a sufficient number of Replicas at the
time the transaction was initiated.
It's worth noting that since the transaction is read only, the sync
policies, although specified as NO_SYNC
, do not really
matter.
Constructor Detail |
---|
public Durability(Durability.SyncPolicy localSync, Durability.SyncPolicy replicaSync, Durability.ReplicaAckPolicy replicaAck)
localSync
- the SyncPolicy to be used when committing the
transaction locally.replicaSync
- the SyncPolicy to be used remotely, as part of a
transaction acknowledgment, at a Replica node.replicaAck
- the acknowledgment policy used when obtaining
transaction acknowledgments from Replicas.Method Detail |
---|
public static Durability parse(String durabilityString)
SyncPolicy[,SyncPolicy[,ReplicaAckPolicy]]
The first SyncPolicy in the above format applies to the Master, and the optional second SyncPolicy to the replica. Specific SyncPolicy or ReplicaAckPolicy values are denoted by the name of the enumeration value.
For example, the string:sync,sync,quorum describes a durability
policy where the master and replica both use Durability.SyncPolicy.SYNC
to commit transactions and Durability.ReplicaAckPolicy.SIMPLE_MAJORITY
to
acknowledge a transaction commit.
Durability.SyncPolicy.NO_SYNC
, is the default value for a node's
SyncPolicy.
Durability.ReplicaAckPolicy.SIMPLE_MAJORITY
is the default for the
ReplicaAckPolicy.
durabilityString
- the durability string in the above format
durabilityString
argument was itself null.
IllegalArgumentException
- if the durabilityString is invalid.public String toString()
toString
in class Object
parse(String)
public Durability.SyncPolicy getLocalSync()
public Durability.SyncPolicy getReplicaSync()
public Durability.ReplicaAckPolicy getReplicaAck()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |