DefaultRetryPolicyOnReadTimeout Method |
Defines whether to retry and at which consistency level on a read timeout.
This method triggers a maximum of one retry, and only if enough replica
had responded to the read request but data was not retrieved amongst those.
Indeed, that case usually means that enough replica are alive to satisfy the
consistency but the coordinator picked a dead one for data retrieval, not
having detected that replica as dead yet. The reasoning for retrying then is
that by the time we get the timeout the dead replica will likely have been
detected as dead and the retry has a high change of success.
Namespace: CassandraAssembly: Cassandra (in Cassandra.dll) Version: 3.2.0
Syntax public RetryDecision OnReadTimeout(
IStatement query,
ConsistencyLevel cl,
int requiredResponses,
int receivedResponses,
bool dataRetrieved,
int nbRetry
)
Parameters
- query
- Type: CassandraIStatement
the original query that timed out. - cl
- Type: CassandraConsistencyLevel
the original consistency level of the read that timed out.
- requiredResponses
- Type: SystemInt32
the number of responses that were required
to achieve the requested consistency level. - receivedResponses
- Type: SystemInt32
the number of responses that had been
received by the time the timeout exception was raised. - dataRetrieved
- Type: SystemBoolean
whether actual data (by opposition to data
checksum) was present in the received responses. - nbRetry
- Type: SystemInt32
the number of retry already performed for this
operation.
Return Value
Type:
RetryDecisionRetryDecision.Retry(cl) if no retry attempt has yet
been tried and
receivedResponses >= requiredResponses &&
!dataRetrieved,
RetryDecision.Rethrow()
otherwise.
Implements
IRetryPolicyOnReadTimeout(IStatement, ConsistencyLevel, Int32, Int32, Boolean, Int32)See Also