Package io.datarouter.ratelimiter
Class NamedCacheRateLimiterFactory.NamedCacheRateLimiter
java.lang.Object
io.datarouter.ratelimiter.NamedRateLimiter
io.datarouter.ratelimiter.BaseNamedCacheRateLimiter
io.datarouter.ratelimiter.NamedCacheRateLimiterFactory.NamedCacheRateLimiter
- Enclosing class:
- NamedCacheRateLimiterFactory
public class NamedCacheRateLimiterFactory.NamedCacheRateLimiter extends BaseNamedCacheRateLimiter
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NamedCacheRateLimiter(java.lang.String name, long maxAvgRequests, long maxSpikeRequests, int numIntervals, int bucketTimeInterval, java.util.concurrent.TimeUnit unit) -
Method Summary
Modifier and Type Method Description protected java.lang.Longincrement(java.lang.String key)protected java.util.Map<java.lang.String,java.lang.Long>readCounts(java.util.List<java.lang.String> keys)Methods inherited from class io.datarouter.ratelimiter.BaseNamedCacheRateLimiter
getMaxAvgRequests, getMaxSpikeRequests, getNumIntervals, getTimeStr, internalAllowMethods inherited from class io.datarouter.ratelimiter.NamedRateLimiter
allowed, allowed, allowedForIp, allowedForIp, peek
-
Constructor Details
-
NamedCacheRateLimiter
public NamedCacheRateLimiter(java.lang.String name, long maxAvgRequests, long maxSpikeRequests, int numIntervals, int bucketTimeInterval, java.util.concurrent.TimeUnit unit)
-
-
Method Details
-
increment
protected java.lang.Long increment(java.lang.String key)- Specified by:
incrementin classBaseNamedCacheRateLimiter
-
readCounts
protected java.util.Map<java.lang.String,java.lang.Long> readCounts(java.util.List<java.lang.String> keys)- Specified by:
readCountsin classBaseNamedCacheRateLimiter
-