jpountz commented on a change in pull request #1294: LUCENE-9074: Slice
Allocation Control Plane For Concurrent Searches
URL: https://github.com/apache/lucene-solr/pull/1294#discussion_r400480289
##########
File path: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
##########
@@ -208,9 +210,22 @@ public IndexSearcher(IndexReader r, Executor executor) {
* @lucene.experimental
*/
public IndexSearcher(IndexReaderContext context, Executor executor) {
+ this(context, executor, getSliceExecutionControlPlane(executor));
+ }
+
+ // Package private for testing
+ IndexSearcher(IndexReaderContext context, Executor executor, SliceExecutor
sliceExecutor) {
assert context.isTopLevel: "IndexSearcher's ReaderContext must be topLevel
for reader" + context.reader();
+ if (executor == null) {
+ assert sliceExecutor == null;
+ }
+ if (sliceExecutor == null) {
+ assert executor == null;
+ }
Review comment:
maybe do `assert (sliceExecutor == null) == (executor==null);` which is
shorter and not harder to read?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]