Class Consistency
- All Implemented Interfaces:
Serializable
,oracle.kv.impl.util.FastExternalizable
- Direct Known Subclasses:
Consistency.NoneRequired
,Consistency.Time
,Consistency.Version
In general, read operations may be serviced either at a Master or Replica
node. When serviced at the Master node, consistency is always absolute. If
absolute consistency is required, ABSOLUTE
may be specified to
force the operation to be serviced at the Master. For other types of
consistency, when the operation is serviced at a Replica node, the
transaction will not begin until the consistency policy is satisfied.
The Consistency is specified as an argument to all read operations, for
example, get
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
A consistency policy which describes the amount of time the Replica is allowed to lag the Master.static class
A consistency policy which ensures that the environment on a Replica node is at least as current as denoted by the specified Key-Value pairConsistency.Version
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Consistency
A consistency policy that requires that a transaction be serviced on the Master so that consistency is absolute.static final Consistency
A consistency policy that lets a transaction on a replica using this policy proceed regardless of the state of the Replica relative to the Master.static final Consistency
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic Consistency
fromByteArray
(byte[] keyBytes) Deserializes the given bytes that were returned earlier bytoByteArray()
and returns the resulting Consistency.abstract String
getName()
Returns the name used to identify the policy.byte[]
Returns this Consistency as a serialized byte array, such thatfromByteArray(byte[])
may be used to reconstitute the Consistency.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface oracle.kv.impl.util.FastExternalizable
deserializedForm, writeFastExternal
-
Field Details
-
NONE_REQUIRED
A consistency policy that lets a transaction on a replica using this policy proceed regardless of the state of the Replica relative to the Master. -
ABSOLUTE
A consistency policy that requires that a transaction be serviced on the Master so that consistency is absolute. -
NONE_REQUIRED_NO_MASTER
Deprecated.as of 4.3, useNONE_REQUIRED
or read zones insteadA consistency policy that requires that a read operation be serviced on a replica; never the Master. When this consistency policy is used, the read operation will not be performed if the only node available is the Master.For read-heavy applications (ex. analytics), it may be desirable to reduce the load on the master by restricting the read requests to only the replicas in the store. It is important to note however, that the secondary zones feature is preferred over this consistency policy as the mechanism for achieving this sort of read isolation. But for cases where the use of secondary zones is either impractical or not desired, this consistency policy can be used to achieve a similar effect; without employing the additional resources that secondary zones may require.
-
-
Method Details
-
toByteArray
public byte[] toByteArray()Returns this Consistency as a serialized byte array, such thatfromByteArray(byte[])
may be used to reconstitute the Consistency. 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
Deserializes the given bytes that were returned earlier bytoByteArray()
and returns the resulting Consistency. 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. -
getName
Returns the name used to identify the policy.
-
NONE_REQUIRED
or read zones instead