public class LinearDelayRetryPolicy extends RetryPolicy
RetryPolicy that defines a maximum number of retries, and a
constant delay for retry attempts.| Constructor and Description |
|---|
LinearDelayRetryPolicy(int maxRetries,
int delayMs,
boolean noDelayOnFirstRetry,
double jitter)
Creates a new
LinearDelayRetryPolicy with the specified maximum
number of retries, and a constant delay for retry attempts. |
| Modifier and Type | Method and Description |
|---|---|
long |
getDelayMs(int attemptNo)
Returns the delay in milliseconds for the specified attempt number.
|
getMaxRetries, retryOn, run, runpublic LinearDelayRetryPolicy(int maxRetries,
int delayMs,
boolean noDelayOnFirstRetry,
double jitter)
LinearDelayRetryPolicy with the specified maximum
number of retries, and a constant delay for retry attempts.maxRetries - A positive value representing the number of retry
attempts allowed by the LinearDelayRetryPolicy.delayMs - A positive value representing the constant delay between
retry attempts, in milliseconds.noDelayOnFirstRetry - true for the first retry to be attempted
immediately, otherwise false for the first retry to be
attempted after delayMs.jitter - The factor multiplier to be applied to delayMs to
thereafter be added to the delay for each retry.IllegalArgumentException - If delayMs, maxRetries or
jitter is negative.public long getDelayMs(int attemptNo)
RetryPolicygetDelayMs in class RetryPolicyattemptNo - The attempt number, starting with 1.Copyright © 2020 LightStep. All rights reserved.