Class ConsistencyException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- oracle.kv.FastExternalizableException
-
- oracle.kv.FaultException
-
- oracle.kv.ConsistencyException
-
- All Implemented Interfaces:
Serializable
,oracle.kv.impl.util.FastExternalizable
public class ConsistencyException extends FaultException
Thrown when a single or multiple-operation transaction fails because the specifiedConsistency
could not be met, within the allowed timeout period.The likelihood of this exception being thrown depends on the specified
Consistency
and the general health of the KVStore system. The default consistency policy (specified byKVStoreConfig.getConsistency()
) isConsistency.NONE_REQUIRED
. WithConsistency.NONE_REQUIRED
(the default),Consistency.NONE_REQUIRED_NO_MASTER
, orConsistency.ABSOLUTE
, this exception will never be thrown.If the client overrides the default and specifies a
Consistency.Time
orConsistency.Version
setting, then this exception will be thrown when the specified consistency requirement cannot be satisfied within the timeout period associated with the consistency setting. If this exception is encountered frequently, it indicates that the consistency policy requirements are too strict and cannot be met routinely given the load being placed on the system and the hardware resources that are available to service the load.Depending on the nature of the application, when this exception is thrown the client may wish to
- retry the read operation,
- fall back to using a larger timeout or a less restrictive consistency
setting (for example,
Consistency.NONE_REQUIRED
), and resume using the original consistency setting at a later time, or - give up and report an error at a higher level.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class oracle.kv.FaultException
testNoCurrentInMessage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consistency
getConsistency()
Returns the consistency policy that could not be satisfied.void
setConsistency(Consistency consistency)
Sets the consistency policy.-
Methods inherited from class oracle.kv.FaultException
getFaultClassName, getRemoteStackTrace, getResourceId, setResourceId, toString, wasLoggedRemotely
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace
-
-
-
-
Method Detail
-
getConsistency
public Consistency getConsistency()
Returns the consistency policy that could not be satisfied.
-
setConsistency
public void setConsistency(Consistency consistency)
Sets the consistency policy.- Parameters:
consistency
- the consistency policy
-
-