public static class MergePolicy.OneMergeProgress extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MergePolicy.OneMergeProgress.PauseReason
Reason for pausing the merge thread.
|
Constructor and Description |
---|
OneMergeProgress()
Creates a new merge progress info.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort the merge this progress tracks at the next
possible moment.
|
Map<MergePolicy.OneMergeProgress.PauseReason,Long> |
getPauseTimes()
Returns pause reasons and associated times in nanoseconds.
|
boolean |
isAborted()
Return the aborted state of this merge.
|
void |
pauseNanos(long pauseNanos,
MergePolicy.OneMergeProgress.PauseReason reason,
BooleanSupplier condition)
Pauses the calling thread for at least
pauseNanos nanoseconds
unless the merge is aborted or the external condition returns false ,
in which case control returns immediately. |
void |
wakeup()
Request a wakeup for any threads stalled in
pauseNanos(long, org.apache.lucene.index.MergePolicy.OneMergeProgress.PauseReason, java.util.function.BooleanSupplier) . |
public void abort()
public boolean isAborted()
public void pauseNanos(long pauseNanos, MergePolicy.OneMergeProgress.PauseReason reason, BooleanSupplier condition) throws InterruptedException
pauseNanos
nanoseconds
unless the merge is aborted or the external condition returns false
,
in which case control returns immediately.
The external condition is required so that other threads can terminate the pausing immediately,
before pauseNanos
expires. We can't rely on just Condition.awaitNanos(long)
alone
because it can return due to spurious wakeups too.condition
- The pause condition that should return false if immediate return from this
method is needed. Other threads can wake up any sleeping thread by calling
wakeup()
, but it'd fall to sleep for the remainder of the requested time if this
conditionInterruptedException
public void wakeup()
pauseNanos(long, org.apache.lucene.index.MergePolicy.OneMergeProgress.PauseReason, java.util.function.BooleanSupplier)
.public Map<MergePolicy.OneMergeProgress.PauseReason,Long> getPauseTimes()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.