com.sleepycat.je.rep.impl
Class PointConsistencyPolicy

java.lang.Object
  extended by com.sleepycat.je.rep.impl.PointConsistencyPolicy
All Implemented Interfaces:
ReplicaConsistencyPolicy

public class PointConsistencyPolicy
extends Object
implements ReplicaConsistencyPolicy

This is used to ensure that the Replica has finished replaying or proceeded past the vlsn specified by the policy. It's like the externally visible CommitPointConsistencyPolicy, except that the latter restricts consistency points to commit vlsns, whereas this policy lets you sync at uncommitted log entries. This class is not public intentionally; it should only be used by unittests and not be replication source code, because it lives in the test packages.


Field Summary
static String NAME
          The name:"PointConsistencyPolicy" associated with this policy.
 
Constructor Summary
PointConsistencyPolicy(VLSN targetVLSN)
           
PointConsistencyPolicy(VLSN targetVLSN, long timeout, TimeUnit timeoutUnit)
           
 
Method Summary
 void ensureConsistency(EnvironmentImpl replicatorImpl)
          Ensures that the replica has replayed the replication stream to the point identified by the commit token.
 boolean equals(Object obj)
           
 String getName()
          Returns the name:"PointConsistencyPolicy", associated with this policy.
 long getTimeout(TimeUnit unit)
          The timeout associated with the consistency policy.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
The name:"PointConsistencyPolicy" associated with this policy. The name can be used when constructing policy property values for use in je.properties files.

See Also:
Constant Field Values
Constructor Detail

PointConsistencyPolicy

public PointConsistencyPolicy(VLSN targetVLSN)

PointConsistencyPolicy

public PointConsistencyPolicy(VLSN targetVLSN,
                              long timeout,
                              TimeUnit timeoutUnit)
Method Detail

getName

public String getName()
Returns the name:"PointConsistencyPolicy", associated with this policy.

Specified by:
getName in interface ReplicaConsistencyPolicy
See Also:
NAME

ensureConsistency

public void ensureConsistency(EnvironmentImpl replicatorImpl)
                       throws InterruptedException,
                              ReplicaConsistencyException,
                              DatabaseException
Ensures that the replica has replayed the replication stream to the point identified by the commit token. If it isn't the method waits until the constraint is satisfied by the replica.

Specified by:
ensureConsistency in interface ReplicaConsistencyPolicy
Parameters:
replicatorImpl - identifies the replicated environment that must meet this consistency requirement.
Throws:
InterruptedException
ReplicaConsistencyException
DatabaseException

getTimeout

public long getTimeout(TimeUnit unit)
Description copied from interface: ReplicaConsistencyPolicy
The timeout associated with the consistency policy. If consistency cannot be established by the Replica within the timeout period, a ReplicaConsistencyException is thrown by Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig).

Specified by:
getTimeout in interface ReplicaConsistencyPolicy
Returns:
the timeout associated with the policy

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2004-2010 Oracle. All rights reserved.