Class SharedRateLimiterFactory
- java.lang.Object
-
- org.apache.accumulo.core.util.ratelimit.SharedRateLimiterFactory
-
public class SharedRateLimiterFactory extends Object
Provides the ability to retrieve aRateLimiter
keyed to a specific string, which will dynamically update its rate according to a specified callback function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SharedRateLimiterFactory.RateProvider
A callback which provides the current rate for aRateLimiter
.protected class
SharedRateLimiterFactory.SharedRateLimiter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RateLimiter
create(String name, SharedRateLimiterFactory.RateProvider rateProvider)
Lookup the RateLimiter associated with the specified name, or create a new one for that name.static SharedRateLimiterFactory
getInstance(AccumuloConfiguration conf)
Get the singleton instance of the SharedRateLimiterFactory.
-
-
-
Method Detail
-
getInstance
public static SharedRateLimiterFactory getInstance(AccumuloConfiguration conf)
Get the singleton instance of the SharedRateLimiterFactory.
-
create
public RateLimiter create(String name, SharedRateLimiterFactory.RateProvider rateProvider)
Lookup the RateLimiter associated with the specified name, or create a new one for that name.- Parameters:
name
- key for the rate limiterrateProvider
- a function which can be called to get what the current rate for the rate limiter should be.
-
-