|
Oracle NoSQL Database version 11gR2.2.0.26 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.kv.Consistency
oracle.kv.Consistency.Time
public static class Consistency.Time
A consistency policy which describes the amount of time the Replica is allowed to lag the Master. The application can use this policy to ensure that the Replica node sees all transactions that were committed on the Master before the lag interval.
Effective use of this policy requires that the clocks on the Master and Replica are synchronized by using a protocol like NTP.
Besides the lag time, this class has a timeout
attribute. The timeout controls how long a Replica may wait
for the desired consistency to be achieved before giving
up.
All KVStore read operations support a Consistency specification, as well as a separate operation timeout. The KVStore client driver implements a read operation by choosing a node (usually a Replica) from the proper replication group, and sending it a request. If the Replica cannot guarantee the desired Consistency within the Consistency timeout, it replies to the request with a failure indication. If there is still time remaining within the operation timeout, the client driver picks another node and tries the request again (transparent to the application).
It makes sense to think of the operation timeout as the maximum amount of time the application is willing to wait for the operation to complete. The Consistency timeout is like a performance hint to the implementation, suggesting that it can generally expect that a healthy Replica usually should be able to become consistent within the given amount of time, and that if it doesn't, then it is probably more likely worth the overhead of abandoning the request attempt and retrying with a different replica. Note that for the Consistency timeout to be meaningful it must be smaller than the operation timeout.
Choosing a value for the operation timeout depends on the needs of the application. Finding a good Consistency timeout value is more likely to depend on observations made of real system performance.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.kv.Consistency |
---|
Consistency.Time, Consistency.Version |
Field Summary |
---|
Fields inherited from class oracle.kv.Consistency |
---|
ABSOLUTE, NONE_REQUIRED |
Constructor Summary | |
---|---|
Consistency.Time(long permissibleLag,
TimeUnit permissibleLagUnit,
long timeout,
TimeUnit timeoutUnit)
Specifies the amount of time by which the Replica is allowed to lag the master when initiating a transaction. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getName()
Returns the name used to identify the policy. |
long |
getPermissibleLag(TimeUnit unit)
Returns the allowed time lag associated with this policy. |
long |
getTimeout(TimeUnit unit)
Returns the consistency timeout associated with this policy. |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class oracle.kv.Consistency |
---|
fromByteArray, toByteArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.kv.impl.util.FastExternalizable |
---|
writeFastExternal |
Constructor Detail |
---|
public Consistency.Time(long permissibleLag, TimeUnit permissibleLagUnit, long timeout, TimeUnit timeoutUnit)
Effective use of this policy requires that the clocks on the Master and Replica are synchronized by using a protocol like NTP.
permissibleLag
- the time interval by which the Replica may be
out of date with respect to the Master when a transaction is
initiated on the Replica.permissibleLagUnit
- the TimeUnit
for the
permissibleLag parameter.timeout
- the amount of time to wait for the consistency to be
reached.timeoutUnit
- the TimeUnit
for the timeout parameter.Method Detail |
---|
public String getName()
Consistency
getName
in class Consistency
public long getPermissibleLag(TimeUnit unit)
unit
- the TimeUnit
of the returned value.
public long getTimeout(TimeUnit unit)
unit
- the TimeUnit
of the returned value.
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
Oracle NoSQL Database version 11gR2.2.0.26 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |