tlrx commented on code in PR #16086:
URL: https://github.com/apache/lucene/pull/16086#discussion_r3267850801
##########
lucene/core/src/java/org/apache/lucene/index/MergePolicy.java:
##########
@@ -570,6 +570,37 @@ public MergeException(Throwable exc) {
}
}
+ /**
+ * Interface for checking whether a merge has been aborted. Implementations
should throw {@link
+ * MergeAbortedException} if the merge should stop.
+ *
+ * @lucene.experimental
+ */
+ public static final class AbortChecker {
+
+ /** A no-op checker */
+ public static final AbortChecker NO_OP = new AbortChecker(null, 0);
+
+ private final OneMerge oneMerge;
+ private final int abortCheckIntervalBytes;
+
+ public AbortChecker(OneMerge oneMerge, int abortCheckIntervalBytes) {
+ assert oneMerge != null || abortCheckIntervalBytes == 0 :
abortCheckIntervalBytes;
+ this.oneMerge = oneMerge;
+ this.abortCheckIntervalBytes = abortCheckIntervalBytes;
+ }
+
+ /** Checks if the merge should be aborted, throwing MergeAbortedException
if so. */
+ public void checkAborted() throws MergeAbortedException {
+ oneMerge.checkAborted();
Review Comment:
Oups, I pushed a68f87ca1f7684c860357651f9717c8387907a5d
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]