public class MergeRateLimiter extends RateLimiter
RateLimiter that IndexWriter assigns to each running merge, to
give MergeSchedulers ionice like control.RateLimiter.SimpleRateLimiter| Constructor and Description |
|---|
MergeRateLimiter(MergePolicy.OneMergeProgress mergeProgress)
Sole constructor.
|
| 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 |
getTotalBytesWritten()
Returns total bytes written by this merge.
|
long |
getTotalPausedNS()
Total NS merge was paused to rate limit IO.
|
long |
getTotalStoppedNS()
Total NS merge was stopped.
|
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 MergeRateLimiter(MergePolicy.OneMergeProgress mergeProgress)
public void setMBPerSec(double mbPerSec)
RateLimitersetMBPerSec in class RateLimiterpublic double getMBPerSec()
RateLimitergetMBPerSec in class RateLimiterpublic long getTotalBytesWritten()
public long pause(long bytes)
throws MergePolicy.MergeAbortedException
RateLimiterNote: the implementation is thread-safe
pause in class RateLimiterMergePolicy.MergeAbortedExceptionpublic long getTotalStoppedNS()
public long getTotalPausedNS()
public long getMinPauseCheckBytes()
RateLimiterRateLimiter.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.getMinPauseCheckBytes in class RateLimiterCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.