Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je.rep
Class InsufficientReplicasException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.sleepycat.je.DatabaseException
                  extended by com.sleepycat.je.OperationFailureException
                      extended by com.sleepycat.je.rep.InsufficientReplicasException
All Implemented Interfaces:
Serializable

public class InsufficientReplicasException
extends OperationFailureException

Thrown by Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) and Transaction.commit() when these operations are initiated at a Master which is not in contact with a quorum of Replicas as determined by the Durability.ReplicaAckPolicy that is in effect for the operation.

See Also:
Serialized Form

Constructor Summary
InsufficientReplicasException(com.sleepycat.je.txn.Locker locker, Durability.ReplicaAckPolicy ackPolicy, int requiredAckCount, Set<String> availableReplicas)
          Creates a Commit exception.
 
Method Summary
 Set<String> getAvailableReplicas()
          Returns the set of Replicas that were in contact with the master at the time of the commit operation.
 Durability.ReplicaAckPolicy getCommitPolicy()
          Returns the Replica ack policy that was in effect for the transaction.
 int getRequiredNodeCount()
          Returns the number of nodes that were required to be active in order to satisfy the Replica ack policy.
 
Methods inherited from class com.sleepycat.je.DatabaseException
getMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InsufficientReplicasException

public InsufficientReplicasException(com.sleepycat.je.txn.Locker locker,
                                     Durability.ReplicaAckPolicy ackPolicy,
                                     int requiredAckCount,
                                     Set<String> availableReplicas)
Creates a Commit exception.

Parameters:
ackPolicy - the ack policy that could not be implemented
requiredAckCount - the replica acks required to satisfy the policy
availableReplicas - the set of available Replicas
Method Detail

getCommitPolicy

public Durability.ReplicaAckPolicy getCommitPolicy()
Returns the Replica ack policy that was in effect for the transaction.

Returns:
the Replica ack policy

getRequiredNodeCount

public int getRequiredNodeCount()
Returns the number of nodes that were required to be active in order to satisfy the Replica ack policy.

Returns:
the required number of nodes

getAvailableReplicas

public Set<String> getAvailableReplicas()
Returns the set of Replicas that were in contact with the master at the time of the commit operation.

Returns:
a set of Replica node names

Berkeley DB Java Edition
version 5.0.34

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