Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  *      Copyright (C) 2012 DataStax Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
  *   You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.datastax.driver.core.policies;
A retry policy that never retry (nor ignore).

All of the methods of this retry policy unconditionally return RetryPolicy.RetryDecision.rethrow(). If this policy is used, retry will have to be implemented in business code.

public class FallthroughRetryPolicy implements RetryPolicy {
    public static final FallthroughRetryPolicy INSTANCE = new FallthroughRetryPolicy();
    private FallthroughRetryPolicy() {}

    
Defines whether to retry and at which consistency level on a read timeout.

Parameters:
query the original query that timeouted.
cl the original consistency level of the read that timeouted.
requiredResponses the number of responses that were required to achieve the requested consistency level.
receivedResponses the number of responses that had been received by the time the timeout exception was raised.
dataRetrieved whether actual data (by opposition to data checksum) was present in the received responses.
nbRetry the number of retry already performed for this operation.
Returns:
RetryDecision.rethrow().
    @Override
    public RetryDecision onReadTimeout(Query queryConsistencyLevel clint requiredResponsesint receivedResponsesboolean dataRetrievedint nbRetry) {
        return RetryDecision.rethrow();
    }

    
Defines whether to retry and at which consistency level on a write timeout.

Parameters:
query the original query that timeouted.
cl the original consistency level of the write that timeouted.
writeType the type of the write that timeouted.
requiredAcks the number of acknowledgments that were required to achieve the requested consistency level.
receivedAcks the number of acknowledgments that had been received by the time the timeout exception was raised.
nbRetry the number of retry already performed for this operation.
Returns:
RetryDecision.rethrow().
    @Override
    public RetryDecision onWriteTimeout(Query queryConsistencyLevel clWriteType writeTypeint requiredAcksint receivedAcksint nbRetry) {
        return RetryDecision.rethrow();
    }

    
Defines whether to retry and at which consistency level on an unavailable exception.

Parameters:
query the original query for which the consistency level cannot be achieved.
cl the original consistency level for the operation.
requiredReplica the number of replica that should have been (known) alive for the operation to be attempted.
aliveReplica the number of replica that were know to be alive by the coordinator of the operation.
nbRetry the number of retry already performed for this operation.
Returns:
RetryDecision.rethrow().
    @Override
    public RetryDecision onUnavailable(Query queryConsistencyLevel clint requiredReplicaint aliveReplicaint nbRetry) {
        return RetryDecision.rethrow();
    }
New to GrepCode? Check out our FAQ X