ConcurrentHnswMerger (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.util.hnsw, class: ConcurrentHnswMerger

Package org.apache.lucene.util.hnsw

# Class ConcurrentHnswMerger

java.lang.Object
org.apache.lucene.util.hnsw.IncrementalHnswGraphMerger
org.apache.lucene.util.hnsw.ConcurrentHnswMerger

All Implemented Interfaces:
  `HnswGraphMerger`

public class ConcurrentHnswMerger extends IncrementalHnswGraphMerger
This merger merges graph in a concurrent manner, by using `HnswConcurrentMergeBuilder`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.util.hnsw.IncrementalHnswGraphMerger

  `IncrementalHnswGraphMerger.GraphReader`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.util.hnsw.IncrementalHnswGraphMerger

  `abortCheck, beamWidth, fieldInfo, graphReaders, largestGraphReader, M, scorerSupplier`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConcurrentHnswMerger(FieldInfo fieldInfo, RandomVectorScorerSupplier scorerSupplier, int M, int beamWidth, TaskExecutor taskExecutor, int numWorker)`
  `ConcurrentHnswMerger(FieldInfo fieldInfo, RandomVectorScorerSupplier scorerSupplier, int M, int beamWidth, TaskExecutor taskExecutor, int numWorker, IORunnable abortCheck)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected HnswBuilder`
  `createBuilder(KnnVectorValues mergedVectorValues, int maxOrd)`
  Builds a new HnswGraphBuilder

  ### Methods inherited from class org.apache.lucene.util.hnsw.IncrementalHnswGraphMerger

  `addReader, getNewOrdMapping, merge`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ConcurrentHnswMerger

    public ConcurrentHnswMerger(FieldInfo fieldInfo, RandomVectorScorerSupplier scorerSupplier, int M, int beamWidth, TaskExecutor taskExecutor, int numWorker)
    Parameters:
      `fieldInfo` - FieldInfo for the field being merged

  - ### ConcurrentHnswMerger

    public ConcurrentHnswMerger(FieldInfo fieldInfo, RandomVectorScorerSupplier scorerSupplier, int M, int beamWidth, TaskExecutor taskExecutor, int numWorker, IORunnable abortCheck)
    Parameters:
      `fieldInfo` - FieldInfo for the field being merged
      `abortCheck` - optional check invoked before every node insertion during graph construction; may throw `MergePolicy.MergeAbortedException` to abort the build when the surrounding merge has been aborted, or null

- ## Method Details

  - ### createBuilder

    protected HnswBuilder createBuilder(KnnVectorValues mergedVectorValues, int maxOrd) throws IOException
    Description copied from class: `IncrementalHnswGraphMerger`
    Builds a new HnswGraphBuilder
    Overrides:
      `createBuilder` in class `IncrementalHnswGraphMerger`
    Parameters:
      `mergedVectorValues` - vector values in the merged segment
      `maxOrd` - max num of vectors that will be merged into the graph
    Returns:
      HnswGraphBuilder
    Throws:
      `IOException` - If an error occurs while reading from the merge state