module Cassandra::Retry::Policy
@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.
Public Instance Methods
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.
@param statement [Cassandra::Statement] the original statement that timed out @param consistency [Symbol] the original consistency level for the
request, one of {Cassandra::CONSISTENCIES}
@param required [Integer] the number of responses required to achieve
requested consistency level
@param received [Integer] the number of responses received by the time
the query timed out
@param retrieved [Boolean] whether actual data (as opposed to data
checksum) was present in the received responses.
@param retries [Integer] the number of retries already performed
@return [Cassandra::Policies::Retry::Decision] a retry decision
@see Cassandra::Retry::Policy#try_again
@see Cassandra::Retry::Policy#reraise
@see Cassandra::Retry::Policy#ignore
# File lib/cassandra/retry.rb 46 def read_timeout(statement, consistency, required, received, retrieved, retries) 47 end
Decides wether to retry a write and at what consistency level.
@param statement [Cassandra::Statement] the original statement that timed out @param consistency [Symbol] the original consistency level for the
request, one of {Cassandra::CONSISTENCIES}
@param type [Symbol] One of {Cassandra::WRITE_TYPES} @param required [Integer] the number of acks required to achieve
requested consistency level
@param received [Integer] the number of acks received by the time the
query timed out
@param retries [Integer] the number of retries already performed
@return [Cassandra::Policies::Retry::Decision] a retry decision
@see Cassandra::Retry::Policy#try_again
@see Cassandra::Retry::Policy#reraise
@see Cassandra::Retry::Policy#ignore
# File lib/cassandra/retry.rb 66 def write_timeout(statement, consistency, type, required, received, retries) 67 end
Private Instance Methods
Returns a decision that signals to driver to ignore the error
@return [Cassandra::Policies::Retry::Decision] tell driver to ignore
the error and return an empty result to the application
# File lib/cassandra/retry.rb 111 def ignore 112 DECISION_IGNORE 113 end
Returns a decision that signals to driver to reraise original error to the application
@return [Cassandra::Policies::Retry::Decision] tell driver to reraise
# File lib/cassandra/retry.rb 103 def reraise 104 DECISION_RERAISE 105 end
Returns a decision that signals retry at a given consistency
@param consistency [Symbol] consistency level for the retry, one of
{Cassandra::CONSISTENCIES}
@return [Cassandra::Policies::Retry::Decision] tell driver to retry
# File lib/cassandra/retry.rb 95 def try_again(consistency) 96 Decisions::Retry.new(consistency) 97 end
Returns a decision that signals to the driver attempt execution on the next host in the load balancing plan
@return [Cassandra::Policies::Retry::Decision] tell the driver to
re-execute the statement on another host
# File lib/cassandra/retry.rb 120 def try_next_host 121 DECISION_TRY_NEXT_HOST 122 end