Class AimdLimitConfig.BuilderBase.AimdLimitConfigImpl
java.lang.Object
io.helidon.common.concurrency.limits.AimdLimitConfig.BuilderBase.AimdLimitConfigImpl
- All Implemented Interfaces:
- Prototype.Api,- Prototype.Factory<AimdLimit>,- AimdLimitConfig,- Supplier<AimdLimit>
- Enclosing class:
- AimdLimitConfig.BuilderBase<BUILDER extends AimdLimitConfig.BuilderBase<BUILDER,- PROTOTYPE>, - PROTOTYPE extends AimdLimitConfig> 
protected static class AimdLimitConfig.BuilderBase.AimdLimitConfigImpl
extends Object
implements AimdLimitConfig, Supplier<AimdLimit>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.helidon.common.concurrency.limits.AimdLimitConfigAimdLimitConfig.Builder, AimdLimitConfig.BuilderBase<BUILDER extends AimdLimitConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AimdLimitConfig> 
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAimdLimitConfigImpl(AimdLimitConfig.BuilderBase<?, ?> builder) Create an instance providing a builder.
- 
Method SummaryModifier and TypeMethodDescriptiondoubleBackoff ratio to use for the algorithm.build()Create a new instance of the runtime type from this config object.clock()A clock that supplies nanosecond time.booleanWhether to collect metrics for the AIMD implementation.booleanbooleanfair()Whether theSemaphoreshould beSemaphore.isFair().get()inthashCode()intInitial limit.intmaxLimit()Maximal limit.intminLimit()Minimal limit.name()Name of this instance.intHow many requests can be enqueued waiting for a permit after the max limit is reached.How long to wait for a permit when enqueued.timeout()Timeout that when exceeded is the same as if the task failed.toString()
- 
Constructor Details- 
AimdLimitConfigImplCreate an instance providing a builder.- Parameters:
- builder- extending builder base of this prototype
 
 
- 
- 
Method Details- 
buildDescription copied from interface:Prototype.FactoryCreate a new instance of the runtime type from this config object.- Specified by:
- buildin interface- Prototype.Factory<AimdLimit>
- Returns:
- new configured runtime instance
 
- 
get
- 
backoffRatiopublic double backoffRatio()Description copied from interface:AimdLimitConfigBackoff ratio to use for the algorithm. The value must be within [0.5, 1.0).- Specified by:
- backoffRatioin interface- AimdLimitConfig
- Returns:
- backoff ratio
 
- 
initialLimitpublic int initialLimit()Description copied from interface:AimdLimitConfigInitial limit. The value must be within [AimdLimitConfig.minLimit(),AimdLimitConfig.maxLimit()].- Specified by:
- initialLimitin interface- AimdLimitConfig
- Returns:
- initial limit
 
- 
maxLimitpublic int maxLimit()Description copied from interface:AimdLimitConfigMaximal limit. The value must be same or higher thanAimdLimitConfig.minLimit().- Specified by:
- maxLimitin interface- AimdLimitConfig
- Returns:
- maximal limit
 
- 
minLimitpublic int minLimit()Description copied from interface:AimdLimitConfigMinimal limit. The value must be same or lower thanAimdLimitConfig.maxLimit().- Specified by:
- minLimitin interface- AimdLimitConfig
- Returns:
- minimal limit
 
- 
timeoutDescription copied from interface:AimdLimitConfigTimeout that when exceeded is the same as if the task failed.- Specified by:
- timeoutin interface- AimdLimitConfig
- Returns:
- task timeout, defaults to 5 seconds
 
- 
clockDescription copied from interface:AimdLimitConfigA clock that supplies nanosecond time.- Specified by:
- clockin interface- AimdLimitConfig
- Returns:
- supplier of current nanoseconds, defaults to System.nanoTime()
 
- 
nameDescription copied from interface:AimdLimitConfigName of this instance.- Specified by:
- namein interface- AimdLimitConfig
- Returns:
- name of the instance
 
- 
queueLengthpublic int queueLength()Description copied from interface:AimdLimitConfigHow many requests can be enqueued waiting for a permit after the max limit is reached. Note that this may not be an exact behavior due to concurrent invocations. We useSemaphore.getQueueLength()in theAimdLimitimplementation. Default value is 0. If set to {code 0}, there is no queueing.- Specified by:
- queueLengthin interface- AimdLimitConfig
- Returns:
- number of requests to enqueue
 
- 
queueTimeoutDescription copied from interface:AimdLimitConfigHow long to wait for a permit when enqueued. Defaults to "PT1S"- Specified by:
- queueTimeoutin interface- AimdLimitConfig
- Returns:
- duration of the timeout
 
- 
fairpublic boolean fair()Description copied from interface:AimdLimitConfig- Specified by:
- fairin interface- AimdLimitConfig
- Returns:
- whether this should be a fair semaphore
 
- 
enableMetricspublic boolean enableMetrics()Description copied from interface:AimdLimitConfigWhether to collect metrics for the AIMD implementation.- Specified by:
- enableMetricsin interface- AimdLimitConfig
- Returns:
- metrics flag
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-