Class LinearDrainingAdaptiveAlgorithm

java.lang.Object
de.hybris.platform.servicelayer.web.session.persister.LinearDrainingAdaptiveAlgorithm
All Implemented Interfaces:
DrainingAdaptiveAlgorithm

public class LinearDrainingAdaptiveAlgorithm extends 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 Details

    • LinearDrainingAdaptiveAlgorithm

      public LinearDrainingAdaptiveAlgorithm()
  • Method Details

    • init

      @PostConstruct public void init()
    • getDrainSize

      public int getDrainSize(long currentSize)
      Description copied from interface: DrainingAdaptiveAlgorithm
      Calculates drain size for current queue size value.
      Specified by:
      getDrainSize in interface DrainingAdaptiveAlgorithm
    • computeDrainSizeLineary

      protected int computeDrainSizeLineary(long currentSize, long threshold)
    • shouldAdapt

      protected boolean shouldAdapt(long currentSize, long threshold)
    • setTenant

      public void setTenant(Tenant tenant)