Class FastRateLimiter
java.lang.Object
org.apache.catalina.util.RateLimiterBase
org.apache.catalina.util.FastRateLimiter
- All Implemented Interfaces:
- RateLimiter
A RateLimiter that compromises accuracy for speed in order to provide maximum throughput.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the internal instance ofTimeBucketCounterBase.protected StringIf policy name has not been specified, the first call ofRateLimiterBase.getPolicyName()returns an auto-generated policy name using the default policy name as prefix and followed by auto-increase index.protected TimeBucketCounterBasenewCounterInstance(int duration, ScheduledExecutorService executorService) Instantiate an instance ofTimeBucketCounterBasefor specific time bucket size.Methods inherited from class org.apache.catalina.util.RateLimiterBasedestroy, getDuration, getPolicyName, getRequests, increment, setDuration, setFilterConfig, setPolicyName, setRequestsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.catalina.util.RateLimitergetPolicy, getQuota
- 
Constructor Details- 
FastRateLimiterpublic FastRateLimiter()
 
- 
- 
Method Details- 
getDefaultPolicyNameDescription copied from class:RateLimiterBaseIf policy name has not been specified, the first call ofRateLimiterBase.getPolicyName()returns an auto-generated policy name using the default policy name as prefix and followed by auto-increase index.- Specified by:
- getDefaultPolicyNamein class- RateLimiterBase
- Returns:
- default policy name, as a prefix of auto-generated policy name.
 
- 
newCounterInstanceprotected TimeBucketCounterBase newCounterInstance(int duration, ScheduledExecutorService executorService) Description copied from class:RateLimiterBaseInstantiate an instance ofTimeBucketCounterBasefor specific time bucket size. Concrete classes determine its counter policy by returning different implementation instances.- Specified by:
- newCounterInstancein class- RateLimiterBase
- Parameters:
- duration- size of each time bucket in seconds
- executorService- the executor
- Returns:
- counter instance of TimeBucketCounterBase
 
- 
getBucketCounterDescription copied from class:RateLimiterBaseReturns the internal instance ofTimeBucketCounterBase.- Overrides:
- getBucketCounterin class- RateLimiterBase
- Returns:
- instance of TimeBucketCounterBase
 
 
-