oracle.kv

## Class DurabilityException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - oracle.kv.FaultException
        - - oracle.kv.DurabilityException

- All Implemented Interfaces:
    Serializable

      public class DurabilityException
      extends FaultException

  Thrown when write operations cannot be initiated because a quorum of Replicas as determined by the `Durability.ReplicaAckPolicy` was not available.

  The likelihood of this exception being thrown depends on the number of nodes per replication group, the rate of node failures and how quickly a failed node is restored to operation, and the specified `ReplicaAckPolicy`. The `ReplicaAckPolicy` for the default durability policy (specified by `KVStoreConfig.getDurability()`) is `Durability.ReplicaAckPolicy.SIMPLE_MAJORITY`. With `SIMPLE_MAJORITY`, this exception is thrown only when the majority of nodes in a replication group are unavailable, and in a well-maintained KVStore system with at least three nodes per replication group this exception should rarely be thrown.

  If the client overrides the default and specifies `Durability.ReplicaAckPolicy.ALL`, then this exception will be thrown when any node in a replication group is unavailable; in other words, it is much more likely to be thrown. If the client specifies `Durability.ReplicaAckPolicy.NONE`, then this exception will never be thrown.

  When this exception is thrown the KVStore service will perform administrative notifications so that actions can be taken to correct the problem. Depending on the nature of the application, the client may wish to

  - retry the write operation immediately,
  - fall back to a read-only mode and resume write operations at a later time, or
  - give up and report an error at a higher level.
  See Also:
    Serialized Form

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `getAvailableReplicas()` Returns the set of Replicas that were available at the time of the operation.
    `Durability.ReplicaAckPolicy` | `getCommitPolicy()` Returns the Replica ack policy that was in effect for the operation.
    `int` | `getRequiredNodeCount()` Returns the number of nodes that were required to be active in order to satisfy the Replica ack policy associated with the operation.

    - ### Methods inherited from class oracle.kv.FaultException

      `getFaultClassName, getRemoteStackTrace, toString, wasLoggedRemotely`

    - ### Methods inherited from class java.lang.Throwable

      `fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getCommitPolicy

          public Durability.ReplicaAckPolicy getCommitPolicy()

      Returns the Replica ack policy that was in effect for the operation.

    - #### getRequiredNodeCount

          public int getRequiredNodeCount()

      Returns the number of nodes that were required to be active in order to satisfy the Replica ack policy associated with the operation.

    - #### getAvailableReplicas

          public Set<String> getAvailableReplicas()

      Returns the set of Replicas that were available at the time of the operation.

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