This commit is contained in:
Andrea Cavalli 2021-11-08 23:46:40 +01:00
parent a48bea6c63
commit 7c0a4b2af9

View File

@ -4,6 +4,7 @@ import it.cavallium.dbengine.database.LLUtils;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
import java.util.concurrent.locks.LockSupport; import java.util.concurrent.locks.LockSupport;
import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.CollectionTerminatedException;
import org.apache.lucene.search.LeafCollector; import org.apache.lucene.search.LeafCollector;
import org.apache.lucene.search.Scorable; import org.apache.lucene.search.Scorable;
import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.ScoreDoc;
@ -38,7 +39,7 @@ public class ReactiveLeafCollector implements LeafCollector {
} }
scoreDocsSink.next(scoreDoc); scoreDocsSink.next(scoreDoc);
if (scoreDocsSink.isCancelled()) { if (scoreDocsSink.isCancelled()) {
throw new CancellationException("Cancelled"); throw new CollectionTerminatedException();
} }
} }
} }