Class ThrottlePolicy


  • public class ThrottlePolicy
    extends Object
    Class that has a method for finding next maxInFlight.
    Author:
    dybis
    • Field Detail

      • SMALL_DIFFERENCE_IN_SUCCESSES_RATIO

        public static final double SMALL_DIFFERENCE_IN_SUCCESSES_RATIO
        See Also:
        Constant Field Values
    • Constructor Detail

      • ThrottlePolicy

        public ThrottlePolicy()
    • Method Detail

      • calcNewMaxInFlight

        public int calcNewMaxInFlight​(double maxPerformanceChange,
                                      int numOk,
                                      int previousNumOk,
                                      int previousMaxInFlight,
                                      int maxInFlightNow,
                                      boolean messagesQueued)
        Generate nex in-flight value for throttling.
        Parameters:
        maxPerformanceChange - This value limit the dynamics of the algorithm.
        numOk - number of success in last phase
        previousNumOk - number of success in previous (before last) phase.
        previousMaxInFlight - number of max-in-flight in previous (before last) phase.
        maxInFlightNow - number of max-in-flight in last phase.
        messagesQueued - if any messages where queued.
        Returns:
        The new value to be used for max-in-flight (should be cropped externally to fit max/min values).