public class RateLimiter extends Object
pause(long)
whenever they
want to read bytes or write bytes.Constructor and Description |
---|
RateLimiter(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.
|
void |
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(double mbPerSec)
public void setMbPerSec(double mbPerSec)
public double getMbPerSec()
public void pause(long bytes)
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.