Module org.apache.lucene.core
Package org.apache.lucene.util.hnsw
Class HnswGraphSearcher.OnHeapHnswGraphSearcher
java.lang.Object
org.apache.lucene.util.hnsw.HnswGraphSearcher
org.apache.lucene.util.hnsw.HnswGraphSearcher.OnHeapHnswGraphSearcher
- Enclosing class:
HnswGraphSearcher
This class allows
OnHeapHnswGraph to be searched in a thread-safe manner by avoiding
the unsafe methods (seek and nextNeighbor, which maintain state in the graph object) and
instead maintaining the state in the searcher object.
Note the class itself is NOT thread safe, but since each search will create a new Searcher, the search methods using this class are thread safe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOnHeapHnswGraphSearcher(NeighborQueue candidates, BitSet visited) -
Method Summary
Modifier and TypeMethodDescription(package private) intgraphNextNeighbor(HnswGraph graph) Get the next neighbor from the graph, you must callHnswGraphSearcher.graphSeek(HnswGraph, int, int)before calling this method.(package private) voidSeek a specific node in the given graph.Methods inherited from class org.apache.lucene.util.hnsw.HnswGraphSearcher
search, search, searchLevel, searchLevel
-
Field Details
-
cur
-
upto
private int upto
-
-
Constructor Details
-
OnHeapHnswGraphSearcher
-
-
Method Details
-
graphSeek
Description copied from class:HnswGraphSearcherSeek a specific node in the given graph. The default implementation will just callHnswGraph.seek(int, int)- Overrides:
graphSeekin classHnswGraphSearcher
-
graphNextNeighbor
Description copied from class:HnswGraphSearcherGet the next neighbor from the graph, you must callHnswGraphSearcher.graphSeek(HnswGraph, int, int)before calling this method. The default implementation will just callHnswGraph.nextNeighbor()- Overrides:
graphNextNeighborin classHnswGraphSearcher- Returns:
- see
HnswGraph.nextNeighbor()
-