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
ConstructorsModifierConstructorDescriptionprivate
OnHeapHnswGraphSearcher
(NeighborQueue candidates, BitSet visited) -
Method Summary
Modifier and TypeMethodDescription(package private) int
graphNextNeighbor
(HnswGraph graph) Get the next neighbor from the graph, you must callHnswGraphSearcher.graphSeek(HnswGraph, int, int)
before calling this method.(package private) void
Seek 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:HnswGraphSearcher
Seek a specific node in the given graph. The default implementation will just callHnswGraph.seek(int, int)
- Overrides:
graphSeek
in classHnswGraphSearcher
-
graphNextNeighbor
Description copied from class:HnswGraphSearcher
Get 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:
graphNextNeighbor
in classHnswGraphSearcher
- Returns:
- see
HnswGraph.nextNeighbor()
-