Package oracle.kv
Class Durability
- java.lang.Object
-
- oracle.kv.Durability
-
- All Implemented Interfaces:
Serializable
,oracle.kv.impl.util.FastExternalizable
public class Durability extends Object implements oracle.kv.impl.util.FastExternalizable, Serializable
Defines the durability characteristics associated with a standalone write (put or update) operation, or in the case ofKVStore.execute
with a set of operations performed in a single transaction.The overall durability is a function of the
Durability.SyncPolicy
andDurability.ReplicaAckPolicy
in effect for the Master, and theDurability.SyncPolicy
in effect for each Replica.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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
Fields Modifier and Type Field Description static Durability
COMMIT_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_NO_SYNC for Master commit synchronization.static Durability
COMMIT_SYNC
A convenience constant that defines a durability policy with COMMIT_SYNC for Master commit synchronization.static Durability
COMMIT_WRITE_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_WRITE_NO_SYNC for Master commit synchronization.
-
Constructor Summary
Constructors Constructor Description Durability(Durability.SyncPolicy masterSync, Durability.SyncPolicy replicaSync, Durability.ReplicaAckPolicy replicaAck)
Creates an instance of a Durability specification.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static Durability
fromByteArray(byte[] keyBytes)
Deserializes the given bytes that were returned earlier bytoByteArray()
and returns the resulting Durability.Durability.SyncPolicy
getMasterSync()
Returns the transaction synchronization policy to be used on the Master 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()
byte[]
toByteArray()
Returns this Durability as a serialized byte array, such thatfromByteArray(byte[])
may be used to reconstitute the Durability.String
toString()
-
-
-
Field Detail
-
COMMIT_SYNC
public static final Durability COMMIT_SYNC
A convenience constant that defines a durability policy with COMMIT_SYNC for Master commit synchronization. The policies default to COMMIT_NO_SYNC for commits of replicated transactions that need acknowledgment and SIMPLE_MAJORITY for the acknowledgment policy.
-
COMMIT_NO_SYNC
public static final Durability COMMIT_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_NO_SYNC for Master commit synchronization. The policies default to COMMIT_NO_SYNC for commits of replicated transactions that need acknowledgment and SIMPLE_MAJORITY for the acknowledgment policy.
-
COMMIT_WRITE_NO_SYNC
public static final Durability COMMIT_WRITE_NO_SYNC
A convenience constant that defines a durability policy with COMMIT_WRITE_NO_SYNC for Master commit synchronization. The policies default to COMMIT_NO_SYNC for commits of replicated transactions that need acknowledgment and SIMPLE_MAJORITY for the acknowledgment policy.
-
-
Constructor Detail
-
Durability
public Durability(Durability.SyncPolicy masterSync, Durability.SyncPolicy replicaSync, Durability.ReplicaAckPolicy replicaAck)
Creates an instance of a Durability specification.- Parameters:
masterSync
- the SyncPolicy to be used when committing the transaction on the Master.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
-
toByteArray
public byte[] toByteArray()
Returns this Durability as a serialized byte array, such thatfromByteArray(byte[])
may be used to reconstitute the Durability. Values returned by calls to this method can be used with current and newer releases, but are not guaranteed to be compatible with earlier releases.
-
fromByteArray
public static Durability fromByteArray(byte[] keyBytes)
Deserializes the given bytes that were returned earlier bytoByteArray()
and returns the resulting Durability. Values created with either the current or earlier releases can be used with this method, but values created by later releases are not guaranteed to be compatible.
-
getMasterSync
public Durability.SyncPolicy getMasterSync()
Returns the transaction synchronization policy to be used on the Master when committing a transaction.
-
getReplicaSync
public Durability.SyncPolicy getReplicaSync()
Returns the transaction synchronization policy to be used by the replica as it replays a transaction that needs an acknowledgment.
-
getReplicaAck
public Durability.ReplicaAckPolicy getReplicaAck()
Returns the replica acknowledgment policy used by the master when committing changes to a replicated environment.
-
-