Package oracle.kv

# Class DurabilityException

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

All Implemented Interfaces:
  `Serializable`, `oracle.kv.impl.util.FastExternalizable`

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

  Modifier and Type
  Method
  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.
  `boolean`
  `getNoSideEffects()`
  Return whether it known that the operation that produced this exception did not have side effects.
  `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

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace`

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

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

  ### Methods inherited from interface oracle.kv.impl.util.FastExternalizable

  `deserializedForm`

- ## Method Details

  - ### 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.

  - ### getNoSideEffects

    public boolean getNoSideEffects()
    Return whether it known that the operation that produced this exception did not have side effects. Applications that receive an exception of this class when performing a modify operation and find that this method returns true can safely assume that none of the changes requested by the operation have been performed. If the return value is false, then the operation may or may not have had side effects.
    Returns:
      true if it known that the operation that produced this exception did not have side effects, otherwise false.