Class LinearDrainingAdaptiveAlgorithm
- java.lang.Object
-
- de.hybris.platform.servicelayer.web.session.persister.LinearDrainingAdaptiveAlgorithm
-
- All Implemented Interfaces:
DrainingAdaptiveAlgorithm
public class LinearDrainingAdaptiveAlgorithm extends java.lang.Object implements 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 Constructor Description LinearDrainingAdaptiveAlgorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcomputeDrainSizeLineary(long currentSize, long threshold)intgetDrainSize(long currentSize)Calculates drain size for current queue size value.voidinit()voidsetTenant(Tenant tenant)protected booleanshouldAdapt(long currentSize, long threshold)
-
-
-
Method Detail
-
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
public void setTenant(Tenant tenant)
-
-