public static class RetryPolicies.MultipleLinearRandomRetry extends Object implements RetryPolicy
Modifier and Type | Class and Description |
---|---|
static class |
RetryPolicies.MultipleLinearRandomRetry.Pair
Pairs of numRetries and sleepSeconds
|
RetryPolicy.RetryAction
Constructor and Description |
---|
RetryPolicies.MultipleLinearRandomRetry(List<RetryPolicies.MultipleLinearRandomRetry.Pair> pairs) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object that) |
int |
hashCode() |
static RetryPolicies.MultipleLinearRandomRetry |
parseCommaSeparatedString(String s)
Parse the given string as a MultipleLinearRandomRetry object.
|
RetryPolicy.RetryAction |
shouldRetry(Exception e,
int curRetry,
int failovers,
boolean isIdempotentOrAtMostOnce)
Determines whether the framework should retry a method for the given
exception, and the number of retries that have been made for that operation
so far.
|
String |
toString() |
public RetryPolicies.MultipleLinearRandomRetry(List<RetryPolicies.MultipleLinearRandomRetry.Pair> pairs)
public RetryPolicy.RetryAction shouldRetry(Exception e, int curRetry, int failovers, boolean isIdempotentOrAtMostOnce) throws Exception
RetryPolicy
Determines whether the framework should retry a method for the given exception, and the number of retries that have been made for that operation so far.
shouldRetry
in interface RetryPolicy
e
- The exception that caused the method to failcurRetry
- The number of times the method has been retriedfailovers
- The number of times the method has failed over to a
different backend implementationisIdempotentOrAtMostOnce
- true
if the method is
Idempotent
or AtMostOnce
and so can reasonably be
retried on failover when we don't know if the previous attempt
reached the server or nottrue
if the method should be retried,
false
if the method should not be retried but
shouldn't fail with an exception (only for void methods)Exception
- The re-thrown exception e
indicating that
the method failed and should not be retried furtherpublic static RetryPolicies.MultipleLinearRandomRetry parseCommaSeparatedString(String s)
Copyright © 2013 Apache Software Foundation. All rights reserved.