Package io.github.jbellis.jvector.disk
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.jbellis.jvector.graph.GraphIndex
GraphIndex.View<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getNodes()Get all nodes on a given level as node 0th ordinals.GraphIndex.View<float[]>getView()Return a View with which to navigate the graph.intlongintsize()Returns the number of nodes in the graph
-
Constructor Details
-
CachingGraphIndex
-
-
Method Details
-
size
public int size()Description copied from interface:GraphIndexReturns the number of nodes in the graph- Specified by:
sizein interfaceGraphIndex<float[]>
-
getNodes
Description copied from interface:GraphIndexGet all nodes on a given level as node 0th ordinals. The nodes are NOT guaranteed to be presented in any particular order.- Specified by:
getNodesin interfaceGraphIndex<float[]>- Returns:
- an iterator over nodes where
nextIntreturns a next node on the level
-
getView
Description copied from interface:GraphIndexReturn a View with which to navigate the graph. Views are not threadsafe.- Specified by:
getViewin interfaceGraphIndex<float[]>
-
maxDegree
public int maxDegree()- Specified by:
maxDegreein interfaceGraphIndex<float[]>- Returns:
- the maximum number of edges per node
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceAccountable
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceGraphIndex<float[]>- Throws:
IOException
-