Package io.github.jbellis.jvector.disk
Class OnDiskGraphIndex<T>
java.lang.Object
io.github.jbellis.jvector.disk.OnDiskGraphIndex<T>
- All Implemented Interfaces:
GraphIndex<T>,Accountable,AutoCloseable
public class OnDiskGraphIndex<T>
extends Object
implements GraphIndex<T>, AutoCloseable, Accountable
-
Nested Class Summary
Nested ClassesNested 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.getView()return a Graph that can be safely queried concurrentlyintlongintsize()Returns the number of nodes in the graphstatic <T> voidwrite(GraphIndex<T> graph, RandomAccessVectorValues<T> vectors, DataOutput out)
-
Constructor Details
-
OnDiskGraphIndex
-
-
Method Details
-
size
public int size()Description copied from interface:GraphIndexReturns the number of nodes in the graph- Specified by:
sizein interfaceGraphIndex<T>
-
maxDegree
public int maxDegree()- Specified by:
maxDegreein interfaceGraphIndex<T>- Returns:
- the maximum number of edges per node
-
getView
return a Graph that can be safely queried concurrently- Specified by:
getViewin interfaceGraphIndex<T>
-
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<T>- Returns:
- an iterator over nodes where
nextIntreturns a next node on the level
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceAccountable
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceGraphIndex<T>- Throws:
IOException
-
write
public static <T> void write(GraphIndex<T> graph, RandomAccessVectorValues<T> vectors, DataOutput out) throws IOException - Throws:
IOException
-