@InterfaceAudience.Private @InterfaceStability.Evolving public class AverageIntervalRateLimiter extends RateLimiter
| Modifier and Type | Field and Description |
|---|---|
private long |
nextRefillTime |
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, waitIntervalprivate long nextRefillTime
public AverageIntervalRateLimiter()
public long refill(long limit)
RateLimiterrefill in class RateLimiterlimit - Maximum available resource units that can be refilled to.public long getWaitInterval(long limit, long available, long amount)
RateLimitergetWaitInterval in class 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–2020 The Apache Software Foundation. All rights reserved.