|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intel.hadoop.graphbuilder.graph.simplegraph.SimpleGraph<VidType,VertexData,EdgeData>
VidType
- VertexData
- EdgeData
- public class SimpleGraph<VidType,VertexData,EdgeData>
This is a pre-finalized but post-partitioned adjacency format for GraphLab2.
The local edges are stored in an adjacency list. The advantage of this
representation lies in its simplicity, therefore easier to parallelize than
GLGraph
. Also, it leaves the heavy duty of GLGraph.finalize()
to much more efficient C++ code on the GraphLab2 side.
Constructor Summary | |
---|---|
SimpleGraph()
Creates an empty graph. |
Method Summary | |
---|---|
void |
addEdge(VidType source,
VidType target,
EdgeData edata)
Add a single edge to the graph. |
void |
addEdges(java.util.List<VidType> sources,
java.util.List<VidType> targets,
java.util.List<EdgeData> edata)
Batch add a collection of edges to the graph. |
void |
addVertexRecord(VertexRecord<VidType,VertexData> vrecord)
Add a vertex record to the graph. |
void |
clear()
Reset the graph to its initial empty state. |
void |
clearAdjList()
Clear the adjacency list. |
void |
clearEdataList()
Clear the edge data list. |
void |
finalize()
This method shall be called to ensure that the graph is in its finalized state and is ready for output. |
int |
numEdges()
|
int |
numVertices()
|
java.util.List<EdgeData> |
outEdgeData(VidType v)
|
java.util.List<VidType> |
outEdgeTargetIds(VidType v)
|
int |
pid()
|
void |
reserveEdgeSpace(int numEdges)
|
void |
reserveVertexSpace(int numVertices)
|
void |
setPid(int pid)
|
java.lang.String |
toString()
|
java.util.List<VidType> |
vertices()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleGraph()
Method Detail |
---|
public java.util.List<VidType> vertices()
public java.util.List<VidType> outEdgeTargetIds(VidType v)
v
- the source vertex of the edge list.
public java.util.List<EdgeData> outEdgeData(VidType v)
v
- the source vertex of the edge list.
public void clearEdataList()
public void clearAdjList()
public void reserveEdgeSpace(int numEdges)
reserveEdgeSpace
in interface Graph<VidType,VertexData,EdgeData>
numEdges
- expected number of edges in the graph.public void reserveVertexSpace(int numVertices)
reserveVertexSpace
in interface Graph<VidType,VertexData,EdgeData>
numVertices
- expected number of vertices in the graph.public int pid()
pid
in interface Graph<VidType,VertexData,EdgeData>
public void setPid(int pid)
setPid
in interface Graph<VidType,VertexData,EdgeData>
pid
- partition id of this graph.public int numVertices()
numVertices
in interface Graph<VidType,VertexData,EdgeData>
public int numEdges()
numEdges
in interface Graph<VidType,VertexData,EdgeData>
public void addEdges(java.util.List<VidType> sources, java.util.List<VidType> targets, java.util.List<EdgeData> edata)
Graph
addEdges
in interface Graph<VidType,VertexData,EdgeData>
sources
- List of source vertex ids.targets
- List of target vertex ids.edata
- List of edge data.public void addEdge(VidType source, VidType target, EdgeData edata)
Graph
addEdge
in interface Graph<VidType,VertexData,EdgeData>
source
- the source vertex id of the edge to be added.target
- the target vertex id of the edge to be added.edata
- the edge data of the edge to be added.public void addVertexRecord(VertexRecord<VidType,VertexData> vrecord)
Graph
addVertexRecord
in interface Graph<VidType,VertexData,EdgeData>
vrecord
- the VertexRecord
object to be added.VertexRecord
public void finalize()
Graph
finalize
in interface Graph<VidType,VertexData,EdgeData>
finalize
in class java.lang.Object
public void clear()
Graph
clear
in interface Graph<VidType,VertexData,EdgeData>
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |