Class RetryDecision
A retry decision to adopt on a Cassandra exception (read/write timeout or unavailable exception).
There is three possible decision:
- Rethrow: no retry should be attempted and an exception should be thrown
- Retry: the operation will be retried. The consistency level of the retry should be specified.
- Ignore: no retry should be attempted and the exception should be ignored. In that case, the operation that triggered the Cassandra exception will return an empty result set.
Inheritance
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class RetryDecision
Properties
DecisionType
Gets the type of this retry decision.
Declaration
public RetryDecision.RetryDecisionType DecisionType { get; }
Property Value
Type | Description |
---|---|
RetryDecision.RetryDecisionType |
RetryConsistencyLevel
Gets the consistency level for a retry decision or null
if
this retry decision is an Ignore
or a
Rethrow
.
Declaration
public ConsistencyLevel? RetryConsistencyLevel { get; }
Property Value
Type | Description |
---|---|
ConsistencyLevel? |
UseCurrentHost
Determines whether the retry policy uses the same host for retry decision. Default: true.
Declaration
public bool UseCurrentHost { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Ignore()
Creates an Ignore retry decision.
Declaration
public static RetryDecision Ignore()
Returns
Type | Description |
---|---|
RetryDecision | an Ignore retry decision. |
Rethrow()
Creates a Rethrow retry decision.
Declaration
public static RetryDecision Rethrow()
Returns
Type | Description |
---|---|
RetryDecision | a Rethrow retry decision. |
Retry(ConsistencyLevel?, bool)
Creates a decision to retry using the provided consistency level.
Declaration
public static RetryDecision Retry(ConsistencyLevel? consistency, bool useCurrentHost)
Parameters
Type | Name | Description |
---|---|---|
ConsistencyLevel? | consistency | the consistency level to use for the retry. |
bool | useCurrentHost | Determines if the retry is made using the current host. |
Returns
Type | Description |
---|---|
RetryDecision | a Retry with consistency level |
Retry(ConsistencyLevel?)
Creates a decision to retry using the provided consistency level on the same host.
Declaration
public static RetryDecision Retry(ConsistencyLevel? consistency)
Parameters
Type | Name | Description |
---|---|---|
ConsistencyLevel? | consistency | the consistency level to use for the retry. |
Returns
Type | Description |
---|---|
RetryDecision | a Retry with consistency level |