Class HeartbeatException
- 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.connection.HeartbeatException
-
- All Implemented Interfaces:
Serializable
public class HeartbeatException extends DriverException
Thrown when a heartbeat query fails.Heartbeat queries are sent automatically on idle connections, to ensure that they are still alive. If a heartbeat query fails, the connection is closed, and all pending queries are aborted. The exception will be passed to
RetryPolicy.onRequestAbortedVerdict(Request, Throwable, int), which decides what to do next (the default policy retries the query on the next node).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HeartbeatException(SocketAddress address, String message, ExecutionInfo executionInfo, Throwable cause)HeartbeatException(SocketAddress address, String message, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DriverExceptioncopy()Copy the exception.SocketAddressgetAddress()The address of the node that encountered the error.-
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
-
HeartbeatException
public HeartbeatException(@NonNull SocketAddress address, @Nullable String message, @Nullable Throwable cause)
-
HeartbeatException
public HeartbeatException(SocketAddress address, String message, ExecutionInfo executionInfo, Throwable cause)
-
-
Method Detail
-
getAddress
@NonNull public SocketAddress getAddress()
The address of the node that encountered the error.
-
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
-
-