Package com.uber.cadence.common
Class RetryOptions
- java.lang.Object
-
- com.uber.cadence.common.RetryOptions
-
public final class RetryOptions extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetryOptions.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RetryOptions
addDoNotRetry(java.lang.Class<? extends java.lang.Throwable>... doNotRetry)
long
calculateSleepTime(long attempt)
boolean
equals(java.lang.Object o)
double
getBackoffCoefficient()
java.util.List<java.lang.Class<? extends java.lang.Throwable>>
getDoNotRetry()
java.time.Duration
getExpiration()
java.time.Duration
getInitialInterval()
int
getMaximumAttempts()
java.time.Duration
getMaximumInterval()
int
hashCode()
static RetryOptions
merge(MethodRetry r, RetryOptions o)
Merges annotation with explicitly provided RetryOptions.RetryOptions
merge(RetryOptions o)
The parameter options takes precedence.boolean
shouldRethrow(java.lang.Throwable e, long attempt, long elapsed, long sleepTime)
java.lang.String
toString()
void
validate()
-
-
-
Method Detail
-
merge
public static RetryOptions merge(MethodRetry r, RetryOptions o)
Merges annotation with explicitly provided RetryOptions. If there is conflict RetryOptions takes precedence.
-
merge
public RetryOptions merge(RetryOptions o)
The parameter options takes precedence.
-
addDoNotRetry
@SafeVarargs public final RetryOptions addDoNotRetry(java.lang.Class<? extends java.lang.Throwable>... doNotRetry)
-
getInitialInterval
public java.time.Duration getInitialInterval()
-
getBackoffCoefficient
public double getBackoffCoefficient()
-
getExpiration
public java.time.Duration getExpiration()
-
getMaximumAttempts
public int getMaximumAttempts()
-
getMaximumInterval
public java.time.Duration getMaximumInterval()
-
validate
public void validate()
-
getDoNotRetry
public java.util.List<java.lang.Class<? extends java.lang.Throwable>> getDoNotRetry()
- Returns:
- null if not configured. When merging with annotation it makes a difference. null means use values from an annotation. Empty list means do not retry on anything.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
calculateSleepTime
public long calculateSleepTime(long attempt)
-
shouldRethrow
public boolean shouldRethrow(java.lang.Throwable e, long attempt, long elapsed, long sleepTime)
-
-