Class CachingGraphIndex

java.lang.Object
io.github.jbellis.jvector.disk.CachingGraphIndex
All Implemented Interfaces:
GraphIndex<float[]>, Accountable, AutoCloseable

public class CachingGraphIndex extends Object implements GraphIndex<float[]>, AutoCloseable, Accountable
  • Constructor Details

    • CachingGraphIndex

      public CachingGraphIndex(OnDiskGraphIndex<float[]> graph)
    • CachingGraphIndex

      public CachingGraphIndex(OnDiskGraphIndex<float[]> graph, int cacheDistance)
  • Method Details

    • size

      public int size()
      Description copied from interface: GraphIndex
      Returns the number of nodes in the graph
      Specified by:
      size in interface GraphIndex<float[]>
    • getNodes

      public NodesIterator getNodes()
      Description copied from interface: GraphIndex
      Get all node ordinals included in the graph. The nodes are NOT guaranteed to be presented in any particular order.
      Specified by:
      getNodes in interface GraphIndex<float[]>
      Returns:
      an iterator over nodes where nextInt returns the next node.
    • getView

      public GraphIndex.View<float[]> getView()
      Description copied from interface: GraphIndex
      Return a View with which to navigate the graph. Views are not threadsafe.
      Specified by:
      getView in interface GraphIndex<float[]>
    • maxDegree

      public int maxDegree()
      Specified by:
      maxDegree in interface GraphIndex<float[]>
      Returns:
      the maximum number of edges per node
    • ramBytesUsed

      public long ramBytesUsed()
      Specified by:
      ramBytesUsed in interface Accountable
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface GraphIndex<float[]>
      Throws:
      IOException