Package io.unitycatalog.client.retry
Class JitterDelayRetryPolicy.Builder
java.lang.Object
io.unitycatalog.client.retry.JitterDelayRetryPolicy.Builder
- Enclosing class:
JitterDelayRetryPolicy
Builder for creating
JitterDelayRetryPolicy instances with custom configuration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newJitterDelayRetryPolicywith the configured parameters.delayJitterFactor(double delayJitterFactor) Sets the jitter factor to randomize delays and prevent synchronized retries.delayMultiplier(double delayMultiplier) Sets the multiplier for exponential backoff.initDelayMs(long initDelayMs) Sets the initial delay in milliseconds before the first retry.maxAttempts(int maxAttempts) Sets the maximum number of attempts (including the initial request).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
maxAttempts
Sets the maximum number of attempts (including the initial request).- Parameters:
maxAttempts- the maximum number of attempts- Returns:
- this builder instance
-
initDelayMs
Sets the initial delay in milliseconds before the first retry.- Parameters:
initDelayMs- the initial delay in milliseconds- Returns:
- this builder instance
-
delayMultiplier
Sets the multiplier for exponential backoff.For example, with an initial delay of 100ms and a multiplier of 2.0:
- Attempt 1: 100ms * 2.0^0 = 100ms
- Attempt 2: 100ms * 2.0^1 = 200ms
- Attempt 3: 100ms * 2.0^2 = 400ms
- Parameters:
delayMultiplier- the exponential backoff multiplier- Returns:
- this builder instance
-
delayJitterFactor
Sets the jitter factor to randomize delays and prevent synchronized retries.The jitter factor should be in the range [0, 1). A factor of 0.5 means the actual delay will be randomized between 50% and 150% of the calculated base delay. A factor of 0 disables jitter.
- Parameters:
delayJitterFactor- the jitter factor (0 to disable, typically 0.1-0.5)- Returns:
- this builder instance
-
build
Builds a newJitterDelayRetryPolicywith the configured parameters.- Returns:
- a new retry policy instance
-