Package org.apache.lucene.index
Class MergeRateLimiter
java.lang.Object
org.apache.lucene.store.RateLimiter
org.apache.lucene.index.MergeRateLimiter
This is the
RateLimiter that IndexWriter assigns to each running merge, to give
MergeSchedulers ionice like control.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.store.RateLimiter
RateLimiter.SimpleRateLimiter -
Constructor Summary
ConstructorsConstructorDescriptionMergeRateLimiter(MergePolicy.OneMergeProgress mergeProgress) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe current MB per second rate limit.longHow many bytes caller should add up itself before invokingRateLimiter.pause(long).longReturns total bytes written by this merge.longTotal NS merge was paused to rate limit IO.longTotal NS merge was stopped.longpause(long bytes) Pauses, if necessary, to keep the instantaneous IO rate at or below the target.voidsetMBPerSec(double mbPerSec) Sets an updated MB per second rate limit.
-
Constructor Details
-
MergeRateLimiter
Sole constructor.
-
-
Method Details
-
setMBPerSec
public void setMBPerSec(double mbPerSec) Description copied from class:RateLimiterSets an updated MB per second rate limit. A subclass is allowed to perform dynamic updates of the rate limit during use.- Specified by:
setMBPerSecin classRateLimiter
-
getMBPerSec
public double getMBPerSec()Description copied from class:RateLimiterThe current MB per second rate limit.- Specified by:
getMBPerSecin classRateLimiter
-
getTotalBytesWritten
public long getTotalBytesWritten()Returns total bytes written by this merge. -
pause
Description copied from class:RateLimiterPauses, if necessary, to keep the instantaneous IO rate at or below the target.Note: the implementation is thread-safe
- Specified by:
pausein classRateLimiter- Returns:
- the pause time in nano seconds
- Throws:
MergePolicy.MergeAbortedException
-
getTotalStoppedNS
public long getTotalStoppedNS()Total NS merge was stopped. -
getTotalPausedNS
public long getTotalPausedNS()Total NS merge was paused to rate limit IO. -
getMinPauseCheckBytes
public long getMinPauseCheckBytes()Description copied from class:RateLimiterHow many bytes caller should add up itself before invokingRateLimiter.pause(long). NOTE: The value returned by this method may change over time and is not guaranteed to be constant throughout the lifetime of the RateLimiter. Users are advised to refresh their local values with calls to this method to ensure consistency.- Specified by:
getMinPauseCheckBytesin classRateLimiter
-