Package org.apache.lucene.util.hnsw
Interface HnswGraphMerger
-
- All Known Implementing Classes:
ConcurrentHnswMerger,IncrementalHnswGraphMerger
public interface HnswGraphMergerAbstraction 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HnswGraphMergeraddReader(KnnVectorsReader reader, MergeState.DocMap docMap, Bits liveDocs)Adds a reader to the graph merger to record the stateOnHeapHnswGraphmerge(DocIdSetIterator mergedVectorIterator, InfoStream infoStream, int maxOrd)Merge and produce the on heap graph
-
-
-
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 mergerdocMap- MergeState.DocMap for the readerliveDocs- 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 segmentinfoStream- optional info stream to set to buildermaxOrd- max number of vectors that will be added to the graph- Returns:
- merged graph
- Throws:
IOException- during merge
-
-