shubhamvishu commented on code in PR #12798:
URL: https://github.com/apache/lucene/pull/12798#discussion_r1390277613
##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswConcurrentMergeBuilder.java:
##########
@@ -77,42 +75,21 @@ public OnHeapHnswGraph build(int maxOrd) throws IOException
{
HNSW_COMPONENT,
"build graph from " + maxOrd + " vectors, with " + workers.length +
" workers");
}
- List<Future<?>> futures = new ArrayList<>();
+ List<Future<Void>> futures = new ArrayList<>();
for (int i = 0; i < workers.length; i++) {
int finalI = i;
futures.add(
exec.submit(
() -> {
try {
workers[finalI].run(maxOrd);
+ return null;
} catch (IOException e) {
throw new RuntimeException(e);
}
}));
}
Review Comment:
Should we instead use the `TaskExecutor` here to run the tasks
concurrently?. But since the `TaskExecutor` cx is currently pkg-private we
would need to make it public to use here. It makes sense to me to do so since
we are making use of concurrency/executors in indexing etc also(eg: hnsw) and
not just at search time.
--
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]