Class RetryConfig.BuilderBase.RetryConfigImpl
java.lang.Object
io.helidon.faulttolerance.RetryConfig.BuilderBase.RetryConfigImpl
- All Implemented Interfaces:
Prototype.Api, Prototype.Factory<Retry>, RetryConfig, Supplier<Retry>
- Enclosing class:
RetryConfig.BuilderBase<BUILDER extends RetryConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends RetryConfig>
protected static class RetryConfig.BuilderBase.RetryConfigImpl
extends Object
implements RetryConfig, Supplier<Retry>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface RetryConfig
RetryConfig.Builder, RetryConfig.BuilderBase<BUILDER, PROTOTYPE>Modifier and TypeInterfaceDescriptionstatic classFluent API builder forRetry.static classRetryConfig.BuilderBase<BUILDER extends RetryConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends RetryConfig>Fluent API builder base forRetryConfig. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRetryConfigImpl(RetryConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionapplyOn()These throwables will be considered retriable.build()Create a new runtime instance from this prototype.intcalls()Number of calls, including the initial call and retries, which must be at least1.delay()Non-negative base delay between the initial call and retries, which defaults to200 ms.doubleDelay multiplier that must be-1or finite and non-negative;-1selects2unless either jitter option is configured, and an explicit multiplier is applied before jitter.booleanFlag to enable metrics for this instance.booleanget()inthashCode()jitter()Absolute random jitter that must bePT-1S(disabled) or non-negative; it cannot be combined withjitter-factor, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.doubleRelative random jitter that must be-1(disabled) or from0(inclusive) to1(exclusive); it cannot be combined withjitter, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.maxDelay()Optional non-negative maximum delay applied after jitter; when absent, the delay is not capped.name()Name for debugging, error reporting, monitoring.Positive overall timeout used to bound the complete retry sequence.Explicitly configured retry policy.skipOn()These throwables will not be considered retriable, all other will.toString()
-
Field Details
-
DEFAULT_CALLS
static final int DEFAULT_CALLSDefault calls to make.- See Also:
-
DEFAULT_DELAY
-
DEFAULT_OVERALL_TIMEOUT
-
-
Constructor Details
-
RetryConfigImpl
Create an instance providing a builder.- Parameters:
builder- extending builder base of this prototype
-
-
Method Details
-
build
Create a new runtime instance from this prototype.- Specified by:
buildin interfacePrototype.Factory<Retry>- Returns:
- new configured runtime instance
-
get
-
name
Description copied from interface:RetryConfigName for debugging, error reporting, monitoring.- Specified by:
namein interfaceRetryConfig- Returns:
- name of this retry
-
calls
public int calls()Description copied from interface:RetryConfigNumber of calls, including the initial call and retries, which must be at least1.- Specified by:
callsin interfaceRetryConfig- Returns:
- number of desired calls, must be 1 (means no retries) or higher.
-
delay
Description copied from interface:RetryConfigNon-negative base delay between the initial call and retries, which defaults to200 ms.- Specified by:
delayin interfaceRetryConfig- Returns:
- delay between retries (combines with retry policy)
-
delayFactor
public double delayFactor()Description copied from interface:RetryConfigDelay multiplier that must be-1or finite and non-negative;-1selects2unless either jitter option is configured, and an explicit multiplier is applied before jitter.- Specified by:
delayFactorin interfaceRetryConfig- Returns:
- delay factor for delaying retry policy
-
jitter
Description copied from interface:RetryConfigAbsolute random jitter that must bePT-1S(disabled) or non-negative; it cannot be combined withjitter-factor, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.- Specified by:
jitterin interfaceRetryConfig- Returns:
- jitter
-
jitterFactor
public double jitterFactor()Description copied from interface:RetryConfigRelative random jitter that must be-1(disabled) or from0(inclusive) to1(exclusive); it cannot be combined withjitter, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present. A value of0.2applies a random jitter of up to twenty percent in either direction.- Specified by:
jitterFactorin interfaceRetryConfig- Returns:
- relative jitter factor
-
maxDelay
Description copied from interface:RetryConfigOptional non-negative maximum delay applied after jitter; when absent, the delay is not capped.- Specified by:
maxDelayin interfaceRetryConfig- Returns:
- maximum delay, if configured
-
overallTimeout
Description copied from interface:RetryConfigPositive overall timeout used to bound the complete retry sequence.- Specified by:
overallTimeoutin interfaceRetryConfig- Returns:
- overall timeout
-
skipOn
Description copied from interface:RetryConfigThese throwables will not be considered retriable, all other will.- Specified by:
skipOnin interfaceRetryConfig- Returns:
- throwable classes to skip retries
- See Also:
-
applyOn
Description copied from interface:RetryConfigThese throwables will be considered retriable.- Specified by:
applyOnin interfaceRetryConfig- Returns:
- throwable classes to trigger retries
- See Also:
-
retryPolicy
Description copied from interface:RetryConfigExplicitly configured retry policy. The most recently configured policy-related option takes precedence. Configuring calls, delay, delay factor, jitter, jitter factor, or maximum delay after this option clears it so a new policy is derived from those settings.- Specified by:
retryPolicyin interfaceRetryConfig- Returns:
- retry policy
-
enableMetrics
public boolean enableMetrics()Description copied from interface:RetryConfigFlag to enable metrics for this instance. The value of this flag is combined with the global config entryFaultTolerance.FT_METRICS_DEFAULT_ENABLED. If either of these flags istrue, then metrics will be enabled for the instance.- Specified by:
enableMetricsin interfaceRetryConfig- Returns:
- metrics enabled flag
-
toString
-
equals
-
hashCode
-