Class Lucene92HnswVectorsReader.OffHeapHnswGraph

  • Enclosing class:
    Lucene92HnswVectorsReader

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

      • 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
    • Method Detail

      • seek

        public void seek​(int level,
                         int targetOrd)
                  throws java.io.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:
        java.io.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 java.io.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:
        java.io.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