@InterfaceAudience.Private @InterfaceStability.Evolving public class AverageIntervalRateLimiter extends RateLimiter
QUOTA_RATE_LIMITER_CONF_KEY| Constructor and Description |
|---|
AverageIntervalRateLimiter() |
| Modifier and Type | Method and Description |
|---|---|
long |
getNextRefillTime() |
long |
getWaitInterval(long limit,
long available,
long amount)
Time in milliseconds to wait for before requesting to consume 'amount' resource.
|
long |
refill(long limit)
Refill the available units w.r.t the elapsed time.
|
void |
setNextRefillTime(long nextRefillTime) |
canExecute, canExecute, consume, consume, getAvailable, getLimit, getTimeUnitInMillis, isBypass, set, toString, update, waitInterval, waitIntervalpublic long refill(long limit)
RateLimiterlimit - Maximum available resource units that can be refilled to.public long getWaitInterval(long limit,
long available,
long amount)
RateLimiterlimit - Maximum available resource units that can be refilled to.available - Currently available resource unitsamount - Resources for which time interval to calculate forpublic void setNextRefillTime(long nextRefillTime)
setNextRefillTime in class RateLimiterpublic long getNextRefillTime()
getNextRefillTime in class RateLimiterCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.