Class Lucene92HnswVectorsReader.OffHeapHnswGraph

java.lang.Object
org.apache.lucene.util.hnsw.HnswGraph
org.apache.lucene.backward_codecs.lucene92.Lucene92HnswVectorsReader.OffHeapHnswGraph
Enclosing class:
Lucene92HnswVectorsReader

private static final class Lucene92HnswVectorsReader.OffHeapHnswGraph extends HnswGraph
Read the nearest-neighbors graph from the index input
  • Field Details

    • dataIn

      final IndexInput dataIn
    • nodesByLevel

      final int[][] nodesByLevel
    • graphOffsetsByLevel

      final long[] graphOffsetsByLevel
    • numLevels

      final int numLevels
    • entryNode

      final int entryNode
    • size

      final int size
    • bytesForConns

      final long bytesForConns
    • bytesForConns0

      final long bytesForConns0
    • arcCount

      int arcCount
    • arcUpTo

      int arcUpTo
    • arc

      int arc
  • Constructor Details

  • Method Details

    • seek

      public void seek(int level, int targetOrd) throws IOException
      Description copied from class: HnswGraph
      Move the pointer to exactly the given level's target. After this method returns, call HnswGraph.nextNeighbor() to return successive (ordered) connected node ordinals.
      Specified by:
      seek in class HnswGraph
      Parameters:
      level - level of the graph
      targetOrd - ordinal of a node in the graph, must be ≥ 0 and < FloatVectorValues.size().
      Throws:
      IOException
    • size

      public int size()
      Description copied from class: HnswGraph
      Returns the number of nodes in the graph
      Specified by:
      size in class HnswGraph
    • nextNeighbor

      public int nextNeighbor() throws IOException
      Description copied from class: HnswGraph
      Iterates over the neighbor list. It is illegal to call this method after it returns NO_MORE_DOCS without calling HnswGraph.seek(int, int), which resets the iterator.
      Specified by:
      nextNeighbor in class HnswGraph
      Returns:
      a node ordinal in the graph, or NO_MORE_DOCS if the iteration is complete.
      Throws:
      IOException
    • numLevels

      public int numLevels()
      Description copied from class: HnswGraph
      Returns the number of levels of the graph
      Specified by:
      numLevels in class HnswGraph
    • entryNode

      public int entryNode()
      Description copied from class: HnswGraph
      Returns graph's entry point on the top level *
      Specified by:
      entryNode in class HnswGraph
    • getNodesOnLevel

      public HnswGraph.NodesIterator getNodesOnLevel(int level)
      Description copied from class: HnswGraph
      Get all nodes on a given level as node 0th ordinals
      Specified by:
      getNodesOnLevel in class HnswGraph
      Parameters:
      level - level for which to get all nodes
      Returns:
      an iterator over nodes where nextInt returns a next node on the level