com.sleepycat.je
Interface ReplicaConsistencyPolicy

All Known Implementing Classes:
CommitPointConsistencyPolicy, NoConsistencyRequiredPolicy, PointConsistencyPolicy, TimeConsistencyPolicy

public interface ReplicaConsistencyPolicy

The interface for Consistency policies used to provide consistency guarantees at a Replica. ReplicaConsistencyPolicies are only used by Berkeley DB JE High Availability.

A transaction initiated at a Replica will wait in the Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) method until the consistency policy is satisfied. 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)

See Also:
Managing Consistency

Method Summary
 void ensureConsistency(EnvironmentImpl repInstance)
           
 String getName()
          Returns the name used to identify the policy.
 long getTimeout(TimeUnit unit)
          The timeout associated with the consistency policy.
 

Method Detail

ensureConsistency

void ensureConsistency(EnvironmentImpl repInstance)
                       throws InterruptedException
Parameters:
repInstance - identifies the replicated environment that must meet this consistency requirement.
Throws:
InterruptedException

getName

String getName()
Returns the name used to identify the policy. The name is used when constructing policy property values for use in je.properties files.


getTimeout

long getTimeout(TimeUnit unit)
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).

Returns:
the timeout associated with the policy


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