Class LinearDrainingAdaptiveAlgorithm
java.lang.Object
de.hybris.platform.servicelayer.web.session.persister.LinearDrainingAdaptiveAlgorithm
- All Implemented Interfaces:
DrainingAdaptiveAlgorithm
Linear implementation of the DrainingAdaptiveAlgorithm. Uses two percentage values for calculate the linear equation
spring.session.save.async.maxratio.adaptive.algorithm - tells what should be the value when queue size is 100%
spring.session.save.async.threshold.adaptive.algorithm - defines the threshold when algorithm should be applied, the
value for the threshold is equal to spring.session.save.async.max.items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcomputeDrainSizeLineary(long currentSize, long threshold) intgetDrainSize(long currentSize) Calculates drain size for current queue size value.voidinit()voidprotected booleanshouldAdapt(long currentSize, long threshold)
-
Constructor Details
-
LinearDrainingAdaptiveAlgorithm
public LinearDrainingAdaptiveAlgorithm()
-
-
Method Details
-
init
@PostConstruct public void init() -
getDrainSize
public int getDrainSize(long currentSize) Description copied from interface:DrainingAdaptiveAlgorithmCalculates drain size for current queue size value.- Specified by:
getDrainSizein interfaceDrainingAdaptiveAlgorithm
-
computeDrainSizeLineary
protected int computeDrainSizeLineary(long currentSize, long threshold) -
shouldAdapt
protected boolean shouldAdapt(long currentSize, long threshold) -
setTenant
-