public static class RetryPolicy.RetryDecision extends Object
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 consistency)
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 previous 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.
If the provided consistency level is null
, the retry will be done at the same consistency level as
the previous attempt.
Beware that serial
consistency levels
should never be passed to this method; attempting to do so would trigger an
InvalidQueryException
.consistency
- the consistency level to use for the retry; if null
,
the same level as the previous attempt will be used.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 consistency)
RetryPolicy.RetryDecision.Type.RETRY
retry decision using the next host
in the query plan, and using the provided consistency level.
If the provided consistency level is null
, the retry will be done at the same consistency level as
the previous attempt.
Beware that serial
consistency levels
should never be passed to this method; attempting to do so would trigger an
InvalidQueryException
.consistency
- the consistency level to use for the retry; if null
,
the same level as the previous attempt will be used.RetryPolicy.RetryDecision.Type.RETRY
retry decision using the next host
in the query plan, and using the provided consistency level.