com.netflix.astyanax.retry
Interface RetryPolicy

All Known Implementing Classes:
BoundedExponentialBackoff, ConstantBackoff, ExponentialBackoff, RetryNTimes, RunOnce, SleepingRetryPolicy

public interface RetryPolicy

Interface for any retry logic

Author:
elandau

Method Summary
 boolean allowRetry()
          Ask the policy if a retry is allowed.
 void begin()
          Operation is starting
 RetryPolicy duplicate()
          Duplicate this policy into a fresh instance
 void failure(Exception e)
          Operation has failed
 int getAttemptCount()
          Return the number of attempts since begin was called
 void success()
          Operation has completed successfully
 

Method Detail

begin

void begin()
Operation is starting


success

void success()
Operation has completed successfully


failure

void failure(Exception e)
Operation has failed


allowRetry

boolean allowRetry()
Ask the policy if a retry is allowed. This may internally sleep

Returns:

getAttemptCount

int getAttemptCount()
Return the number of attempts since begin was called

Returns:

duplicate

RetryPolicy duplicate()
Duplicate this policy into a fresh instance

Returns:


Copyright © 2012. All Rights Reserved.