Class MongoThrottlerFactory


  • public final class MongoThrottlerFactory
    extends Object
    Factory to create Mongo Throttlers
    • Method Detail

      • exponentialThrottler

        public static Throttler exponentialThrottler​(int threshold,
                                                     AtomicReference<Double> oplogWindow,
                                                     long throttlingTime)
        Returns an instance of @Throttler which throttles the system exponentially based on remaining threshold defined.
        Parameters:
        threshold - threshold for throttling
        oplogWindow - current oplog window for mongo
        throttlingTime - time duration for throttling
        Returns:
        an exponential throttler to throttle system if required
      • extFactorThrottler

        public static Throttler extFactorThrottler​(AtomicReference<Integer> factor,
                                                   long time)
        Returns an instance of @Throttler which throttles the system based on throttling factor set externally
        Parameters:
        factor - current oplog window for mongo
        time - time duration for throttling
        Returns:
        an external factor throttler to throttle the system if required
      • noThrottler

        public static Throttler noThrottler()
        A Throttler which doesn't do any throttling, no matter how much system is under load
        Returns:
        No throttler