com.netflix.nfgraph.compressed
Class NFCompressedGraph
java.lang.Object
com.netflix.nfgraph.NFGraph
com.netflix.nfgraph.compressed.NFCompressedGraph
public class NFCompressedGraph
- extends NFGraph
A read-only, memory-efficient implementation of an NFGraph. The connections for all nodes in the graph
are encoded into a single byte array. The encoding for each set will be specified as either a CompactOrdinalSet or
HashSetOrdinalSet. If it is more efficient, the actual encoding will be a BitSetOrdinalSet.
The offsets into the byte array where connections for each node are encoded are held in the NFCompressedGraphPointers.
|
Constructor Summary |
NFCompressedGraph(NFGraphSpec spec,
com.netflix.nfgraph.NFGraphModelHolder modelHolder,
byte[] data,
com.netflix.nfgraph.compressed.NFCompressedGraphPointers pointers)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NFCompressedGraph
public NFCompressedGraph(NFGraphSpec spec,
com.netflix.nfgraph.NFGraphModelHolder modelHolder,
byte[] data,
com.netflix.nfgraph.compressed.NFCompressedGraphPointers pointers)
getConnection
protected int getConnection(int connectionModelIndex,
java.lang.String nodeType,
int ordinal,
java.lang.String propertyName)
- Specified by:
getConnection in class NFGraph
getConnectionSet
protected OrdinalSet getConnectionSet(int connectionModelIndex,
java.lang.String nodeType,
int ordinal,
java.lang.String propertyName)
- Specified by:
getConnectionSet in class NFGraph
getConnectionIterator
protected OrdinalIterator getConnectionIterator(int connectionModelIndex,
java.lang.String nodeType,
int ordinal,
java.lang.String propertyName)
- Specified by:
getConnectionIterator in class NFGraph
writeTo
public void writeTo(java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
readFrom
public static NFCompressedGraph readFrom(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException