public class TimeConsistencyPolicy extends java.lang.Object implements ReplicaConsistencyPolicy
Effective use of this policy requires that the clocks on the Master and Replica are synchronized by using a protocol like NTP
Consistency policies are specified at either a per-transaction level through
TransactionConfig.setConsistencyPolicy(com.sleepycat.je.ReplicaConsistencyPolicy)
or as an replication node
wide default through ReplicationConfig.setConsistencyPolicy(com.sleepycat.je.ReplicaConsistencyPolicy)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name:"TimeConsistencyPolicy" associated with this policy.
|
Constructor and Description |
---|
TimeConsistencyPolicy(long permissibleLag,
java.util.concurrent.TimeUnit permissibleLagUnit,
long timeout,
java.util.concurrent.TimeUnit timeoutUnit)
Specifies the amount of time by which the Replica is allowed to lag the
master when initiating a transaction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName()
Returns the name:"TimeConsistencyPolicy", associated with this policy.
|
long |
getPermissibleLag(java.util.concurrent.TimeUnit unit)
Returns the allowed time lag associated with this policy.
|
long |
getTimeout(java.util.concurrent.TimeUnit unit)
Returns the consistency timeout associated with this policy.
|
int |
hashCode() |
java.lang.String |
toString() |
public static final java.lang.String NAME
public TimeConsistencyPolicy(long permissibleLag, java.util.concurrent.TimeUnit permissibleLagUnit, long timeout, java.util.concurrent.TimeUnit timeoutUnit)
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.java.lang.IllegalArgumentException
- if the permissibleLagUnit or
timeoutUnit is null.public java.lang.String getName()
getName
in interface ReplicaConsistencyPolicy
NAME
public long getPermissibleLag(java.util.concurrent.TimeUnit unit)
unit
- the TimeUnit
of the returned value.public long getTimeout(java.util.concurrent.TimeUnit unit)
getTimeout
in interface ReplicaConsistencyPolicy
unit
- the TimeUnit
of the returned value.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.