Click or drag to resize
DefaultRetryPolicy.OnWriteTimeout Method
Defines whether to retry and at which consistency level on a write timeout.

This method triggers a maximum of one retry, and only in the case of a WriteType.BATCH_LOG write. The reasoning for the retry in that case is that write to the distributed batch log is tried by the coordinator of the write against a small subset of all the node alive in the local datacenter. Hence, a timeout usually means that none of the nodes in that subset were alive but the coordinator hasn't' detected them as dead. By the time we get the timeout the dead nodes will likely have been detected as dead and the retry has thus a high change of success.

Namespace: Cassandra
Assembly: Cassandra (in Cassandra.dll) Version: 3.0.5 (git 25b8d4e)
Syntax
C#
public RetryDecision OnWriteTimeout(
	IStatement query,
	ConsistencyLevel cl,
	string writeType,
	int requiredAcks,
	int receivedAcks,
	int nbRetry
)

Parameters

query
Type: Cassandra.IStatement
the original query that timeouted.
cl
Type: Cassandra.ConsistencyLevel
the original consistency level of the write that timeouted.
writeType
Type: System.String
the type of the write that timeouted.
requiredAcks
Type: System.Int32
the number of acknowledgments that were required to achieve the requested consistency level.
receivedAcks
Type: System.Int32
the number of acknowledgments that had been received by the time the timeout exception was raised.
nbRetry
Type: System.Int32
the number of retry already performed for this operation.

Return Value

Type: RetryDecision
RetryDecision.retry(cl) if no retry attempt has yet been tried and writeType == WriteType.BATCH_LOG, RetryDecision.rethrow() otherwise.

Implements

IRetryPolicy.OnWriteTimeout(IStatement, ConsistencyLevel, String, Int32, Int32, Int32)
See Also