zhaih commented on code in PR #12660: URL: https://github.com/apache/lucene/pull/12660#discussion_r1367984246
########## lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsWriter.java: ########## @@ -50,13 +72,24 @@ public final class Lucene95HnswVectorsWriter extends KnnVectorsWriter { private final IndexOutput meta, vectorData, vectorIndex; private final int M; private final int beamWidth; + private final int numMergeWorkers; + private final ExecutorService exec; private final List<FieldWriter<?>> fields = new ArrayList<>(); private boolean finished; - Lucene95HnswVectorsWriter(SegmentWriteState state, int M, int beamWidth) throws IOException { + Lucene95HnswVectorsWriter(SegmentWriteState state, int M, int beamWidth, int numMergeWorkers) + throws IOException { this.M = M; this.beamWidth = beamWidth; + this.numMergeWorkers = numMergeWorkers; + if (numMergeWorkers <= 1) { + exec = null; + } else { + exec = + Executors.newFixedThreadPool( + Runtime.getRuntime().availableProcessors(), new NamedThreadFactory("hnsw-merge")); Review Comment: But this setting should only affect HNSW merge but not necessary all other (potential future) KNN merge? So if we put it to IWC then whether that's a bit too general, so maybe put it into format is ok? -- 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