Package org.apache.hadoop.util
Class RateLimitingFactory
java.lang.Object
org.apache.hadoop.util.RateLimitingFactory
Factory for Rate Limiting.
This should be only place in the code where the guava RateLimiter is imported.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RateLimitingcreate(int capacity) Create an instance.static RateLimitingGet the unlimited rate.
-
Method Details
-
unlimitedRate
Get the unlimited rate.- Returns:
- a rate limiter which always has capacity.
-
create
Create an instance. If the rate is 0; return the unlimited rate.- Parameters:
capacity- capacity in permits/second.- Returns:
- limiter restricted to the given capacity.
-