public class UnavailableException extends QueryExecutionException
This exception is processed by RetryPolicy.onUnavailableVerdict(Request,
ConsistencyLevel, int, int, 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 the AllNodesFailedException
thrown to the client.
Constructor and Description |
---|
UnavailableException(Node coordinator,
ConsistencyLevel consistencyLevel,
int required,
int alive) |
Modifier and Type | Method and Description |
---|---|
DriverException |
copy()
Copy the exception.
|
int |
getAlive()
The number of replicas that were known to be alive by the coordinator node when it tried to
execute the operation.
|
ConsistencyLevel |
getConsistencyLevel()
The consistency level of the operation triggering this exception.
|
int |
getRequired()
The number of replica acknowledgements/responses required to perform the operation (with its
required consistency level).
|
getCoordinator
getExecutionInfo, setExecutionInfo
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public UnavailableException(@NonNull Node coordinator, @NonNull ConsistencyLevel consistencyLevel, int required, int alive)
@NonNull public ConsistencyLevel getConsistencyLevel()
public int getRequired()
public int getAlive()
@NonNull public DriverException copy()
DriverException
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).
copy
in class DriverException
Copyright © 2017–2024. All rights reserved.