public class TimeConsistencyPolicy extends 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 String |
NAME
The name:"TimeConsistencyPolicy" associated with this policy.
|
Constructor and Description |
---|
TimeConsistencyPolicy(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.
|
Modifier and Type | Method and Description |
---|---|
void |
ensureConsistency(com.sleepycat.je.dbi.EnvironmentImpl replicatorImpl) |
boolean |
equals(Object obj) |
String |
getName()
Returns the name:"TimeConsistencyPolicy", associated with this 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() |
public static final String NAME
public TimeConsistencyPolicy(long permissibleLag, TimeUnit permissibleLagUnit, long timeout, 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.IllegalArgumentException
- if the permissibleLagUnit or
timeoutUnit is null.public String getName()
getName
in interface ReplicaConsistencyPolicy
NAME
public long getPermissibleLag(TimeUnit unit)
unit
- the TimeUnit
of the returned value.public long getTimeout(TimeUnit unit)
getTimeout
in interface ReplicaConsistencyPolicy
unit
- the TimeUnit
of the returned value.public void ensureConsistency(com.sleepycat.je.dbi.EnvironmentImpl replicatorImpl) throws InterruptedException, ReplicaConsistencyException
ensureConsistency
in interface ReplicaConsistencyPolicy
replicatorImpl
- identifies the replicated environment that must meet
this consistency requirement.InterruptedException
ReplicaConsistencyException
Copyright (c) 2002, 2015 Oracle and/or its affiliates. All rights reserved.