Class LoggingRetryPolicy
A retry policy that wraps another policy, logging the decision made by its sub-policy.
Note that this policy only log the Ignore
and Retry
decisions (since Rethrow
decisions just amount to propagate the cassandra exception). The logging is done at the Info
level.
Inheritance
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class LoggingRetryPolicy : IExtendedRetryPolicy, IRetryPolicy
Constructors
LoggingRetryPolicy(IRetryPolicy)
Creates a new IExtendedRetryPolicy that logs the decision of the provided policy
.
Declaration
public LoggingRetryPolicy(IRetryPolicy policy)
Parameters
Type | Name | Description |
---|---|---|
IRetryPolicy | policy | the policy to wrap. The policy created by this
constructor will return the same decision than |
Properties
ChildPolicy
Declaration
public IRetryPolicy ChildPolicy { get; }
Property Value
Type | Description |
---|---|
IRetryPolicy |
Methods
OnReadTimeout(IStatement, ConsistencyLevel, int, int, bool, int)
Declaration
public RetryDecision OnReadTimeout(IStatement query, ConsistencyLevel cl, int requiredResponses, int receivedResponses, bool dataRetrieved, int nbRetry)
Parameters
Type | Name | Description |
---|---|---|
IStatement | query | |
ConsistencyLevel | cl | |
int | requiredResponses | |
int | receivedResponses | |
bool | dataRetrieved | |
int | nbRetry |
Returns
Type | Description |
---|---|
RetryDecision |
OnRequestError(IStatement, Configuration, Exception, int)
Defines whether to retry and at which consistency level on an unexpected error.
This method might be invoked in the following situations:
- On a client timeout, while waiting for the server response (see ReadTimeoutMillis).
- On a socket error (socket closed, etc.).
- When the contacted host replies with an
OVERLOADED
error or aSERVER_ERROR
.
Note that when such an error occurs, there is no guarantee that the mutation has been applied server-side or not.
Declaration
public RetryDecision OnRequestError(IStatement statement, Configuration config, Exception ex, int nbRetry)
Parameters
Type | Name | Description |
---|---|---|
IStatement | statement | The original query that failed. |
Configuration | config | The current cluster configuration. |
Exception | ex | The exception that caused this request to fail. |
int | nbRetry | The number of retries already performed for this operation. |
Returns
Type | Description |
---|---|
RetryDecision |
OnUnavailable(IStatement, ConsistencyLevel, int, int, int)
Declaration
public RetryDecision OnUnavailable(IStatement query, ConsistencyLevel cl, int requiredReplica, int aliveReplica, int nbRetry)
Parameters
Type | Name | Description |
---|---|---|
IStatement | query | |
ConsistencyLevel | cl | |
int | requiredReplica | |
int | aliveReplica | |
int | nbRetry |
Returns
Type | Description |
---|---|
RetryDecision |
OnWriteTimeout(IStatement, ConsistencyLevel, string, int, int, int)
Declaration
public RetryDecision OnWriteTimeout(IStatement query, ConsistencyLevel cl, string writeType, int requiredAcks, int receivedAcks, int nbRetry)
Parameters
Type | Name | Description |
---|---|---|
IStatement | query | |
ConsistencyLevel | cl | |
string | writeType | |
int | requiredAcks | |
int | receivedAcks | |
int | nbRetry |
Returns
Type | Description |
---|---|
RetryDecision |