Package org.cache2k.addon
Class UniversalResilienceConfig.Builder
- java.lang.Object
-
- org.cache2k.addon.UniversalResilienceConfig.Builder
-
- All Implemented Interfaces:
org.cache2k.config.ConfigBuilder<UniversalResilienceConfig.Builder,UniversalResilienceConfig>
,org.cache2k.config.SectionBuilder<UniversalResilienceConfig.Builder,UniversalResilienceConfig>
- Enclosing class:
- UniversalResilienceConfig
public static class UniversalResilienceConfig.Builder extends Object implements org.cache2k.config.SectionBuilder<UniversalResilienceConfig.Builder,UniversalResilienceConfig>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UniversalResilienceConfig.Builder
backoffMultiplier(double v)
Multiplier for exponential backoff if multiple exceptions occur in sequence.UniversalResilienceConfig
config()
UniversalResilienceConfig.Builder
maxRetryInterval(long v, TimeUnit u)
If a loader exception happens, this is the maximum time interval after a retry attempt is made.UniversalResilienceConfig.Builder
minRetryInterval(Duration v)
A minimum value of retry interval if its not explicitly set and derived from resilience duration or expireAfterWrite.UniversalResilienceConfig.Builder
resilienceDuration(long v, TimeUnit u)
Time span the cache will suppress loader exceptions if a value is available from a previous load.UniversalResilienceConfig.Builder
retryInterval(long v, TimeUnit u)
If a loader exception happens, this is the time interval after a retry attempt is made.UniversalResilienceConfig.Builder
retryPercentOfResilienceDuration(int v)
If retry values are not specified and a resilience duration available, calculates the retry interval time from the resilience duration.
-
-
-
Method Detail
-
retryInterval
public final UniversalResilienceConfig.Builder retryInterval(long v, TimeUnit u)
If a loader exception happens, this is the time interval after a retry attempt is made. If not specified, 10% ofmaxRetryInterval(long, java.util.concurrent.TimeUnit)
.
-
maxRetryInterval
public final UniversalResilienceConfig.Builder maxRetryInterval(long v, TimeUnit u)
If a loader exception happens, this is the maximum time interval after a retry attempt is made. For retries an exponential backoff algorithm is used. It starts with the retry time and then increases the time to the maximum according to an exponential pattern.By default identical to
resilienceDuration(long, java.util.concurrent.TimeUnit)
-
resilienceDuration
public final UniversalResilienceConfig.Builder resilienceDuration(long v, TimeUnit u)
Time span the cache will suppress loader exceptions if a value is available from a previous load. After the time span is passed the cache will start propagating loader exceptions.
-
backoffMultiplier
public final UniversalResilienceConfig.Builder backoffMultiplier(double v)
Multiplier for exponential backoff if multiple exceptions occur in sequence. Default is1.5
.
-
minRetryInterval
public final UniversalResilienceConfig.Builder minRetryInterval(Duration v)
A minimum value of retry interval if its not explicitly set and derived from resilience duration or expireAfterWrite.
-
retryPercentOfResilienceDuration
public final UniversalResilienceConfig.Builder retryPercentOfResilienceDuration(int v)
If retry values are not specified and a resilience duration available, calculates the retry interval time from the resilience duration. Default 10, meaning 10 percent.
-
config
public UniversalResilienceConfig config()
- Specified by:
config
in interfaceorg.cache2k.config.ConfigBuilder<UniversalResilienceConfig.Builder,UniversalResilienceConfig>
-
-