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
ConstructorsConstructorDescriptionCachingGraphIndex(OnDiskGraphIndex<float[]> graph) CachingGraphIndex(OnDiskGraphIndex<float[]> graph, int cacheDistance) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getNodes()Get all node ordinals included in the graph.GraphIndex.View<float[]> getView()Return a View with which to navigate the graph.intlongintsize()Returns the number of nodes in the graphMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.jbellis.jvector.graph.GraphIndex
containsNode, getIdUpperBound
-
Constructor Details
-
CachingGraphIndex
-
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 node ordinals included in the graph. The nodes are NOT guaranteed to be presented in any particular order.- Specified by:
getNodesin interfaceGraphIndex<float[]>- Returns:
- an iterator over nodes where
nextIntreturns the next node.
-
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
-