Package org.apache.lucene.store
Class RateLimiter
java.lang.Object
org.apache.lucene.store.RateLimiter
- Direct Known Subclasses:
- RateLimiter.SimpleRateLimiter
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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classSimple class to rate limit IO.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract doubleThe current mb per second rate limit.abstract longpause(long bytes) Pauses, if necessary, to keep the instantaneous IO rate at or below the target.abstract voidsetMbPerSec(double mbPerSec) Sets an updated mb per second rate limit.
- 
Constructor Details- 
RateLimiterpublic RateLimiter()
 
- 
- 
Method Details- 
setMbPerSecpublic abstract void setMbPerSec(double mbPerSec) Sets an updated mb per second rate limit.
- 
getMbPerSecpublic abstract double getMbPerSec()The current mb per second rate limit.
- 
pausepublic abstract long pause(long bytes) Pauses, if necessary, to keep the instantaneous IO rate at or below the target.Note: the implementation is thread-safe - Returns:
- the pause time in nano seconds
 
 
-