public static class RetryPolicy.RetryDecision extends Object
There are three possible decisions:
Modifier and Type | Class and Description |
---|---|
static class |
RetryPolicy.RetryDecision.Type
The types of retry decisions.
|
Modifier and Type | Method and Description |
---|---|
ConsistencyLevel |
getRetryConsistencyLevel()
The consistency level for this retry decision.
|
RetryPolicy.RetryDecision.Type |
getType()
The type of this retry decision.
|
static RetryPolicy.RetryDecision |
ignore()
Creates an
RetryPolicy.RetryDecision.Type.IGNORE retry decision. |
boolean |
isRetryCurrent()
Whether this decision is to retry the same host.
|
static RetryPolicy.RetryDecision |
rethrow()
Creates a
RetryPolicy.RetryDecision.Type.RETHROW retry decision. |
static RetryPolicy.RetryDecision |
retry(ConsistencyLevel consistency)
Creates a
RetryPolicy.RetryDecision.Type.RETRY retry decision using
the same host and the provided consistency level. |
String |
toString() |
static RetryPolicy.RetryDecision |
tryNextHost(ConsistencyLevel retryCL)
Creates a
RetryPolicy.RetryDecision.Type.RETRY retry decision using the next host
in the query plan, and using the provided consistency level. |
public RetryPolicy.RetryDecision.Type getType()
public ConsistencyLevel getRetryConsistencyLevel()
RETRY
decisions.
The consistency level is always null
for an
IGNORE
or a RETHROW
decision;
for a RETRY
decision, the consistency level can be null
,
in which case the retry is done at the same consistency level
as in the original attempt.public boolean isRetryCurrent()
RETRY
decisions.true
if the decision is to retry the same host,
false
otherwise. Default is false
.public static RetryPolicy.RetryDecision rethrow()
RetryPolicy.RetryDecision.Type.RETHROW
retry decision.RetryPolicy.RetryDecision.Type.RETHROW
retry decision.public static RetryPolicy.RetryDecision retry(ConsistencyLevel consistency)
RetryPolicy.RetryDecision.Type.RETRY
retry decision using
the same host and the provided consistency level.consistency
- the consistency level to use for the retry.RetryPolicy.RetryDecision.Type.RETRY
decision using
the same host and the provided consistency levelpublic static RetryPolicy.RetryDecision ignore()
RetryPolicy.RetryDecision.Type.IGNORE
retry decision.RetryPolicy.RetryDecision.Type.IGNORE
retry decision.public static RetryPolicy.RetryDecision tryNextHost(ConsistencyLevel retryCL)
RetryPolicy.RetryDecision.Type.RETRY
retry decision using the next host
in the query plan, and using the provided consistency level.RetryPolicy.RetryDecision.Type.RETRY
retry decision using the next host
in the query plan, and using the provided consistency level.