Package com.google.adk.workflow
Class RetryConfig
java.lang.Object
com.google.adk.workflow.RetryConfig
How a node is retried when it fails. The builder initializes each property to its
DEFAULT_ constant, except exceptions() and exceptionClasses(), which start unset.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default forbackoffFactor().static final DurationThe default forinitialDelay().static final doubleThe default forjitter().static final intThe default formaxAttempts().static final DurationThe default formaxDelay(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract doubleReturns the multiplier applied to the delay after each attempt.static RetryConfig.Builderbuilder()Returns the types of the failures to retry on, each also matching its subclasses.Returns the simple type names of the failures to retry on, matched exactly with no subclass match.abstract DurationReturns the delay before the first retry.abstract doublejitter()Returns the randomness factor, not a duration: the delay is spread overdelay * (1 +/- jitter).abstract intReturns the maximum number of attempts, including the first, so 0 or 1 means no retry.abstract DurationmaxDelay()Returns the ceiling on any single delay.abstract RetryConfig.Builder
-
Field Details
-
DEFAULT_MAX_ATTEMPTS
public static final int DEFAULT_MAX_ATTEMPTSThe default formaxAttempts().- See Also:
-
DEFAULT_INITIAL_DELAY
The default forinitialDelay(). -
DEFAULT_MAX_DELAY
The default formaxDelay(). -
DEFAULT_BACKOFF_FACTOR
public static final double DEFAULT_BACKOFF_FACTORThe default forbackoffFactor().- See Also:
-
DEFAULT_JITTER
public static final double DEFAULT_JITTERThe default forjitter().- See Also:
-
-
Constructor Details
-
RetryConfig
public RetryConfig()
-
-
Method Details
-
maxAttempts
public abstract int maxAttempts()Returns the maximum number of attempts, including the first, so 0 or 1 means no retry. -
initialDelay
Returns the delay before the first retry. -
maxDelay
Returns the ceiling on any single delay. -
backoffFactor
public abstract double backoffFactor()Returns the multiplier applied to the delay after each attempt. -
jitter
public abstract double jitter()Returns the randomness factor, not a duration: the delay is spread overdelay * (1 +/- jitter). Zero removes randomness. -
exceptions
Returns the simple type names of the failures to retry on, matched exactly with no subclass match. A failure is retried when it matches this list orexceptionClasses(), and any failure is retried when both are unset. AWorkflowConfigurationExceptionis never retried, even when listed, because a retry fails the same way. -
exceptionClasses
public abstract Optional<com.google.common.collect.ImmutableList<Class<? extends Exception>>> exceptionClasses()Returns the types of the failures to retry on, each also matching its subclasses. A failure is retried when it matches this list orexceptions(), and any failure is retried when both are unset. AWorkflowConfigurationExceptionis never retried, even when its class is listed. -
builder
-
toBuilder
-