Class MongoThrottlerFactory
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.mongo.MongoThrottlerFactory
-
public final class MongoThrottlerFactory extends Object
Factory to create Mongo Throttlers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThrottlerexponentialThrottler(int threshold, AtomicReference<Double> oplogWindow, long throttlingTime)Returns an instance of @Throttlerwhich throttles the system exponentially based on remaining threshold defined.static ThrottlerextFactorThrottler(AtomicReference<Integer> factor, long time)Returns an instance of @Throttlerwhich throttles the system based on throttling factor set externallystatic ThrottlernoThrottler()AThrottlerwhich doesn't do any throttling, no matter how much system is under load
-
-
-
Method Detail
-
exponentialThrottler
public static Throttler exponentialThrottler(int threshold, AtomicReference<Double> oplogWindow, long throttlingTime)
Returns an instance of @Throttlerwhich throttles the system exponentially based on remaining threshold defined.- Parameters:
threshold- threshold for throttlingoplogWindow- current oplog window for mongothrottlingTime- 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 @Throttlerwhich throttles the system based on throttling factor set externally- Parameters:
factor- current oplog window for mongotime- time duration for throttling- Returns:
- an external factor throttler to throttle the system if required
-
-