public static class RateLimiter.SimpleRateLimiter extends RateLimiter
RateLimiter.SimpleRateLimiter| Constructor and Description |
|---|
RateLimiter.SimpleRateLimiter(double mbPerSec)
mbPerSec is the MB/sec max IO rate
|
| Modifier and Type | Method and Description |
|---|---|
double |
getMbPerSec()
The current mb per second rate limit.
|
long |
getMinPauseCheckBytes()
How many bytes caller should add up itself before invoking
RateLimiter.pause(long). |
long |
pause(long bytes)
Pauses, if necessary, to keep the instantaneous IO
rate at or below the target.
|
void |
setMbPerSec(double mbPerSec)
Sets an updated mb per second rate limit.
|
public RateLimiter.SimpleRateLimiter(double mbPerSec)
public void setMbPerSec(double mbPerSec)
setMbPerSec in class RateLimiterpublic long getMinPauseCheckBytes()
RateLimiterRateLimiter.pause(long).getMinPauseCheckBytes in class RateLimiterpublic double getMbPerSec()
getMbPerSec in class RateLimiterpublic long pause(long bytes)
getMinPauseCheckBytes(),
otherwise it will pause way too long!pause in class RateLimiterCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.