Abstract
Actual retry policies supplied as :retry_policy option to Cassandra.cluster don’t need to inherit this class, only implement its methods. This class exists for documentation purposes only.

Mixed into

Methods

read_timeout

(statement, consistency, required, received, retrieved, retries)

Decides wether to retry a read and at what consistency level.

Note
this method may be called even if required_responses >= received responses if data_present is false.
Parameters:
Name Type Details
statement Statement the original statement that timed out
consistency Symbol the original consistency level for the request, one of CONSISTENCIES
required Integer the number of responses required to achieve requested consistency level
received Integer the number of responses received by the time the query timed out
retrieved Boolean whether actual data (as opposed to data checksum) was present in the received responses.
retries Integer the number of retries already performed
Returns:
Type Details
Cassandra::Policies::Retry::Decision a retry decision
See Also:

write_timeout

(statement, consistency, type, required, received, retries)

Decides wether to retry a write and at what consistency level.

Parameters:
Name Type Details
statement Statement the original statement that timed out
consistency Symbol the original consistency level for the request, one of CONSISTENCIES
type Symbol One of WRITE_TYPES
required Integer the number of acks required to achieve requested consistency level
received Integer the number of acks received by the time the query timed out
retries Integer the number of retries already performed
Returns:
Type Details
Cassandra::Policies::Retry::Decision a retry decision
See Also:

unavailable

(statement, consistency, required, alive, retries)

Decides wether to retry and at what consistency level on an Unavailable exception.

Parameters:
Name Type Details
statement Statement the original Statement that timed out
consistency Symbol the original consistency level for the request, one of CONSISTENCIES
required Integer the number of replicas required to achieve requested consistency level
alive Integer the number of replicas available for the request
retries Integer the number of retries already performed
Returns:
Type Details
Cassandra::Policies::Retry::Decision a retry decision
See Also:

try_again

(consistency)

Returns a decision that signals retry at a given consistency

Parameters:
Name Type Details
consistency Symbol consistency level for the retry, one of CONSISTENCIES
Returns:
Type Details
Cassandra::Policies::Retry::Decision tell driver to retry

reraise

Returns a decision that signals to driver to reraise original error to the application

Returns:
Type Details
Cassandra::Policies::Retry::Decision tell driver to reraise

ignore

Returns a decision that signals to driver to ignore the error

Returns:
Type Details
Cassandra::Policies::Retry::Decision tell driver to ignore the error and return an empty result to the application

try_next_host

Returns a decision that signals to the driver attempt execution on the next host in the load balancing plan

Returns:
Type Details
Cassandra::Policies::Retry::Decision tell the driver to re-execute the statement on another host