Oracle NoSQL Database
version 11gR2.2.0.26

oracle.kv
Class Consistency

java.lang.Object
  extended by oracle.kv.Consistency
All Implemented Interfaces:
Serializable, oracle.kv.impl.util.FastExternalizable
Direct Known Subclasses:
Consistency.Time, Consistency.Version

public abstract class Consistency
extends Object
implements oracle.kv.impl.util.FastExternalizable, Serializable

Used to provide consistency guarantees for read operations.

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:
Serialized Form

Nested Class Summary
static class Consistency.Time
          A consistency policy which describes the amount of time the Replica is allowed to lag the Master.
static class Consistency.Version
          A consistency policy which ensures that the environment on a Replica node is at least as current as denoted by the specified Key-Value pair Version.
 
Field Summary
static Consistency ABSOLUTE
          A consistency policy that requires that a transaction be serviced on the Master so that consistency is absolute.
static Consistency 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.
 
Method Summary
static Consistency fromByteArray(byte[] keyBytes)
          Deserializes the given bytes that were returned earlier by toByteArray() and returns the resulting Consistency.
abstract  String getName()
          Returns the name used to identify the policy.
 byte[] toByteArray()
          Returns this Consistency as a serialized byte array, such that fromByteArray(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
writeFastExternal
 

Field Detail

NONE_REQUIRED

public static final Consistency 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

public static final Consistency ABSOLUTE
A consistency policy that requires that a transaction be serviced on the Master so that consistency is absolute.

Method Detail

toByteArray

public byte[] toByteArray()
Returns this Consistency as a serialized byte array, such that fromByteArray(byte[]) may be used to reconstitute the Consistency.


fromByteArray

public static Consistency fromByteArray(byte[] keyBytes)
Deserializes the given bytes that were returned earlier by toByteArray() and returns the resulting Consistency.


getName

public abstract String getName()
Returns the name used to identify the policy.


Oracle NoSQL Database
version 11gR2.2.0.26

Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.