InsufficientReplicasException (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep

## Class InsufficientReplicasException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.sleepycat.je.DatabaseException
        - - com.sleepycat.je.OperationFailureException
          - - 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

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 (including the master) 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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, 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 (including the master) 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

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.