Package io.datarouter.ratelimiter
Class BaseCacheRateLimiter
java.lang.Object
io.datarouter.ratelimiter.BaseRateLimiter
io.datarouter.ratelimiter.BaseCacheRateLimiter
- Direct Known Subclasses:
BaseTallyCacheRateLimiter
public abstract class BaseCacheRateLimiter extends BaseRateLimiter
-
Constructor Summary
Constructors Constructor Description BaseCacheRateLimiter(CacheRateLimiterConfig config) -
Method Summary
Modifier and Type Method Description DurationgetBucketTimeInterval()CacheRateLimiterConfiggetConfig()protected StringgetTimeStr(Calendar cal)protected abstract Longincrement(String key)protected io.datarouter.util.tuple.Pair<Boolean,Calendar>internalAllow(String key, boolean increment)protected abstract Map<String,Long>readCounts(List<String> keys)Methods inherited from class io.datarouter.ratelimiter.BaseRateLimiter
allowed, allowed, allowedForIp, allowedForIp, getName, peek
-
Constructor Details
-
Method Details
-
increment
-
readCounts
-
internalAllow
protected io.datarouter.util.tuple.Pair<Boolean,Calendar> internalAllow(String key, boolean increment)- Specified by:
internalAllowin classBaseRateLimiter
-
getTimeStr
-
getBucketTimeInterval
-
getConfig
-