|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.store.RateLimiter
public abstract class RateLimiter
Abstract base class to rate limit IO. Typically implementations are
shared across multiple IndexInputs or IndexOutputs (for example
those involved all merging). Those IndexInputs and
IndexOutputs would call pause(long)
whenever they
want to read bytes or write bytes.
Nested Class Summary | |
---|---|
static class |
RateLimiter.SimpleRateLimiter
Simple class to rate limit IO. |
Constructor Summary | |
---|---|
RateLimiter()
|
Method Summary | |
---|---|
abstract double |
getMbPerSec()
The current mb per second rate limit. |
abstract long |
pause(long bytes)
Pauses, if necessary, to keep the instantaneous IO rate at or below the target. |
abstract void |
setMbPerSec(double mbPerSec)
Sets an updated mb per second rate limit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RateLimiter()
Method Detail |
---|
public abstract void setMbPerSec(double mbPerSec)
public abstract double getMbPerSec()
public abstract long pause(long bytes)
Note: the implementation is thread-safe
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |