mikemccand commented on a change in pull request #725: LUCENE-8865: Use 
incoming thread for execution if IndexSearcher has an executor
URL: https://github.com/apache/lucene-solr/pull/725#discussion_r294538579
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
 ##########
 @@ -639,13 +639,15 @@ public TopFieldDocs reduce(Collection<TopFieldCollector> 
collectors) throws IOEx
       for (int i = 0; i < leafSlices.length; ++i) {
         final LeafReaderContext[] leaves = leafSlices[i].leaves;
         final C collector = collectors.get(i);
-        topDocsFutures.add(executor.submit(new Callable<C>() {
-          @Override
-          public C call() throws Exception {
+        if (i == leafSlices.length - 1) { // execute the last on the caller 
thread
 
 Review comment:
   Can we change `for` loop to only iterate up to `leafSlices.length - 1` and 
then do this afterwards?

----------------------------------------------------------------
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]

Reply via email to