Class QueryConsistencyException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.datastax.driver.core.exceptions.DriverException
-
- com.datastax.driver.core.exceptions.QueryExecutionException
-
- com.datastax.driver.core.exceptions.QueryConsistencyException
-
- All Implemented Interfaces:
CoordinatorException,Serializable
- Direct Known Subclasses:
CASWriteUnknownException,ReadFailureException,ReadTimeoutException,WriteFailureException,WriteTimeoutException
public abstract class QueryConsistencyException extends QueryExecutionException implements CoordinatorException
A failure to reach the required consistency level during the execution of a query.Such an exception is returned when the query has been tried by Cassandra but cannot be achieved with the requested consistency level because either:
- the coordinator did not receive enough replica responses within the rpc timeout set for Cassandra;
- some replicas replied with an error.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedQueryConsistencyException(EndPoint endPoint, String msg, ConsistencyLevel consistency, int received, int required)protectedQueryConsistencyException(EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, int received, int required)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description InetSocketAddressgetAddress()Deprecated.ConsistencyLevelgetConsistencyLevel()The consistency level of the operation that failed.EndPointgetEndPoint()The connection information of the coordinator host that was contacted.InetAddressgetHost()Deprecated.intgetReceivedAcknowledgements()The number of replicas that had acknowledged/responded to the operation before it failed.intgetRequiredAcknowledgements()The minimum number of replica acknowledgements/responses that were required to fulfill the operation.-
Methods inherited from class com.datastax.driver.core.exceptions.DriverException
copy
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
QueryConsistencyException
protected QueryConsistencyException(EndPoint endPoint, String msg, ConsistencyLevel consistency, int received, int required)
-
QueryConsistencyException
protected QueryConsistencyException(EndPoint endPoint, String msg, Throwable cause, ConsistencyLevel consistency, int received, int required)
-
-
Method Detail
-
getConsistencyLevel
public ConsistencyLevel getConsistencyLevel()
The consistency level of the operation that failed.- Returns:
- the consistency level of the operation that failed.
-
getReceivedAcknowledgements
public int getReceivedAcknowledgements()
The number of replicas that had acknowledged/responded to the operation before it failed.- Returns:
- the number of replica that had acknowledged/responded the operation before it failed.
-
getRequiredAcknowledgements
public int getRequiredAcknowledgements()
The minimum number of replica acknowledgements/responses that were required to fulfill the operation.- Returns:
- The minimum number of replica acknowledgements/response that were required to fulfill the operation.
-
getEndPoint
public EndPoint getEndPoint()
The connection information of the coordinator host that was contacted. May benullif the coordinator is not known.Note that this is the information of the host that coordinated the query, not the one that timed out.
- Specified by:
getEndPointin interfaceCoordinatorException
-
getAddress
@Deprecated public InetSocketAddress getAddress()
Deprecated.Description copied from interface:CoordinatorExceptionThe full address of the coordinator host that was contacted; may benullif the coordinator is not known.- Specified by:
getAddressin interfaceCoordinatorException
-
getHost
@Deprecated public InetAddress getHost()
Deprecated.Description copied from interface:CoordinatorExceptionThe coordinator host that was contacted; may benullif the coordinator is not known.- Specified by:
getHostin interfaceCoordinatorException
-
-