Class ReadTimeoutException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.datastax.oss.driver.api.core.DriverException
-
- com.datastax.oss.driver.api.core.servererrors.CoordinatorException
-
- com.datastax.oss.driver.api.core.servererrors.QueryExecutionException
-
- com.datastax.oss.driver.api.core.servererrors.QueryConsistencyException
-
- com.datastax.oss.driver.api.core.servererrors.ReadTimeoutException
-
- All Implemented Interfaces:
Serializable
public class ReadTimeoutException extends QueryConsistencyException
A server-side timeout during a read query.This exception is processed by
RetryPolicy.onReadTimeoutVerdict(Request, ConsistencyLevel, int, int, boolean, int), which will decide if it is rethrown directly to the client or if the request should be retried. If all other tried nodes also fail, this exception will appear in theAllNodesFailedExceptionthrown to the client.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReadTimeoutException(Node coordinator, ConsistencyLevel consistencyLevel, int received, int blockFor, boolean dataPresent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DriverExceptioncopy()Copy the exception.booleanwasDataPresent()Whether the actual data was amongst the received replica responses.-
Methods inherited from class com.datastax.oss.driver.api.core.servererrors.QueryConsistencyException
getBlockFor, getConsistencyLevel, getReceived
-
Methods inherited from class com.datastax.oss.driver.api.core.servererrors.CoordinatorException
getCoordinator
-
Methods inherited from class com.datastax.oss.driver.api.core.DriverException
getExecutionInfo, setExecutionInfo
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ReadTimeoutException
public ReadTimeoutException(@NonNull Node coordinator, @NonNull ConsistencyLevel consistencyLevel, int received, int blockFor, boolean dataPresent)
-
-
Method Detail
-
wasDataPresent
public boolean wasDataPresent()
Whether the actual data was amongst the received replica responses.During reads, Cassandra doesn't request data from every replica to minimize internal network traffic. Instead, some replicas are only asked for a checksum of the data. A read timeout may occur even if enough replicas have responded to fulfill the consistency level, if only checksum responses have been received. This method allows to detect that case.
-
copy
@NonNull public DriverException copy()
Description copied from class:DriverExceptionCopy the exception.This returns a new exception, equivalent to the original one, except that because a new object is created in the current thread, the top-most element in the stacktrace of the exception will refer to the current thread. The original exception may or may not be included as the copy's cause, depending on whether that is deemed useful (this is left to the discretion of each implementation).
This is intended for the synchronous wrapper methods of the driver, in order to produce a more user-friendly stack trace (that includes the line in the user code where the driver rethrew the error).
- Specified by:
copyin classDriverException
-
-