shubhamvishu opened a new pull request, #12798: URL: https://github.com/apache/lucene/pull/12798
### Description This PR addresses [this comment](https://github.com/apache/lucene/blob/4e2ce76b3e131ba92b7327a52460e6c4d92c5e33/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswConcurrentMergeBuilder.java#L113) in `HnswConcurrentMergeBuilder` to reuse the TaskExecutor and not duplicate the code. It moves the logic of retrieving the results from futures in `TaskExecutor.TaskGroup#invokeAll` function to the newly added static function `getFutureResults` in `TaskExecutor`. The function takes a collection of `Future` and returns the list of retrieved results if required i.e. when the passed boolean `collect` is true else it just wait for the futures to complete and return null. I reused the added function in couple of places other than `HnswConcurrentMergeBuilder` in the codebase which seemed suitable. <!-- If this is your first contribution to Lucene, please make sure you have reviewed the contribution guide. https://github.com/apache/lucene/blob/main/CONTRIBUTING.md --> -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org