public class RetryNTimes extends ExponentialBackoffRetry
| Constructor and Description |
|---|
RetryNTimes(int maxRetries,
long backoffMs,
int backoffCeiling) |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxRetries()
Return maximal count of retries
|
long |
nextRetryMs(int retryCount,
long elapsedTimeMs)
Called when an operation is failed for some reason to determine if it should be retried.
|
RetryNTimes |
withBackoffCeiling(int ceiling)
Create new retry policy with specified backoff ceiling
|
RetryNTimes |
withBackoffMs(long ms)
Create new retry policy with specified backoff duration
|
RetryNTimes |
withMaxRetries(int maxRetries)
Create new retry policy with specified max retries count
|
backoffTimeMillis, getBackoffCeiling, getBackoffMillispublic RetryNTimes(int maxRetries,
long backoffMs,
int backoffCeiling)
public long nextRetryMs(int retryCount,
long elapsedTimeMs)
RetryPolicyretryCount - the number of times retried so far (0 the first time)elapsedTimeMs - the elapsed time in ms since the operation was attemptedpublic int getMaxRetries()
public RetryNTimes withMaxRetries(int maxRetries)
maxRetries - new value of max count of retriespublic RetryNTimes withBackoffMs(long ms)
ms - new backoff duration in millisecondspublic RetryNTimes withBackoffCeiling(int ceiling)
ceiling - new backoff ceilingCopyright © 2024. All rights reserved.