Class Lucene90HnswVectorsReader.OffHeapHnswGraph
- java.lang.Object
-
- org.apache.lucene.util.hnsw.HnswGraph
-
- org.apache.lucene.backward_codecs.lucene90.Lucene90HnswVectorsReader.OffHeapHnswGraph
-
- Enclosing class:
- Lucene90HnswVectorsReader
private static final class Lucene90HnswVectorsReader.OffHeapHnswGraph extends HnswGraph
Read the nearest-neighbors graph from the index input
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.util.hnsw.HnswGraph
HnswGraph.NodesIterator
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intarc(package private) intarcCount(package private) intarcUpTo(package private) IndexInputdataIn(package private) Lucene90HnswVectorsReader.FieldEntryentry
-
Constructor Summary
Constructors Constructor Description OffHeapHnswGraph(Lucene90HnswVectorsReader.FieldEntry entry, IndexInput dataIn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intentryNode()Returns graph's entry point on the top level *HnswGraph.NodesIteratorgetNodesOnLevel(int level)Get all nodes on a given level as node 0th ordinalsintnextNeighbor()Iterates over the neighbor list.intnumLevels()Returns the number of levels of the graphvoidseek(int level, int targetOrd)Move the pointer to exactly the givenlevel'starget.intsize()Returns the number of nodes in the graph
-
-
-
Field Detail
-
entry
final Lucene90HnswVectorsReader.FieldEntry entry
-
dataIn
final IndexInput dataIn
-
arcCount
int arcCount
-
arcUpTo
int arcUpTo
-
arc
int arc
-
-
Constructor Detail
-
OffHeapHnswGraph
OffHeapHnswGraph(Lucene90HnswVectorsReader.FieldEntry entry, IndexInput dataIn)
-
-
Method Detail
-
seek
public void seek(int level, int targetOrd) throws java.io.IOExceptionDescription copied from class:HnswGraphMove the pointer to exactly the givenlevel'starget. After this method returns, callHnswGraph.nextNeighbor()to return successive (ordered) connected node ordinals.- Specified by:
seekin classHnswGraph- Parameters:
level- level of the graphtargetOrd- ordinal of a node in the graph, must be ≥ 0 and <VectorValues.size().- Throws:
java.io.IOException
-
size
public int size()
Description copied from class:HnswGraphReturns the number of nodes in the graph
-
nextNeighbor
public int nextNeighbor() throws java.io.IOExceptionDescription copied from class:HnswGraphIterates over the neighbor list. It is illegal to call this method after it returns NO_MORE_DOCS without callingHnswGraph.seek(int, int), which resets the iterator.- Specified by:
nextNeighborin classHnswGraph- Returns:
- a node ordinal in the graph, or NO_MORE_DOCS if the iteration is complete.
- Throws:
java.io.IOException
-
numLevels
public int numLevels()
Description copied from class:HnswGraphReturns the number of levels of the graph
-
entryNode
public int entryNode()
Description copied from class:HnswGraphReturns graph's entry point on the top level *
-
getNodesOnLevel
public HnswGraph.NodesIterator getNodesOnLevel(int level)
Description copied from class:HnswGraphGet all nodes on a given level as node 0th ordinals- Specified by:
getNodesOnLevelin classHnswGraph- Parameters:
level- level for which to get all nodes- Returns:
- an iterator over nodes where
nextIntreturns a next node on the level
-
-