Interface HnswGraphMerger

  • All Known Implementing Classes:
    ConcurrentHnswMerger, IncrementalHnswGraphMerger

    public interface HnswGraphMerger
    Abstraction of merging multiple graphs into one on-heap graph
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Method Detail

      • addReader

        HnswGraphMerger addReader​(KnnVectorsReader reader,
                                  MergeState.DocMap docMap,
                                  Bits liveDocs)
                           throws IOException
        Adds a reader to the graph merger to record the state
        Parameters:
        reader - KnnVectorsReader to add to the merger
        docMap - MergeState.DocMap for the reader
        liveDocs - Bits representing live docs, can be null
        Returns:
        this
        Throws:
        IOException - If an error occurs while reading from the merge state
      • merge

        OnHeapHnswGraph merge​(DocIdSetIterator mergedVectorIterator,
                              InfoStream infoStream,
                              int maxOrd)
                       throws IOException
        Merge and produce the on heap graph
        Parameters:
        mergedVectorIterator - iterator over the vectors in the merged segment
        infoStream - optional info stream to set to builder
        maxOrd - max number of vectors that will be added to the graph
        Returns:
        merged graph
        Throws:
        IOException - during merge