voldemort.utils
Class EventThrottler
java.lang.Object
voldemort.utils.EventThrottler
public class EventThrottler
- extends java.lang.Object
A class to throttle Events to a certain rate
This class takes a maximum rate in events/sec and a minimum interval in ms at
which to check the rate. The rate is checked every time the interval
ellapses, and if the events rate exceeds the maximum, the call will block
long enough to equalize it.
This is generalized IoThrottler as it existed before, you can use it to
throttle on Bytes read/write,number of entries scanned etc.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventThrottler
public EventThrottler(long ratesPerSecond)
EventThrottler
public EventThrottler(Time time,
long ratePerSecond,
long intervalMs)
maybeThrottle
public void maybeThrottle(int eventsSeen)
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao