|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intel.hadoop.graphbuilder.graph.glgraph.GLGraph<VidType,VertexData,EdgeData>
VidType
- VertexData
- EdgeData
- public class GLGraph<VidType,VertexData,EdgeData>
This is equivalent to GraphLab2 distributed graph ://code.google.com
/p/graphlabapi/source/browse/src/graphlab/graph/distributed_graph.hpp
. Most
of the implementation is identical to the C++ version in GraphLab2. Besides
the "set" methods defined in the Graph
interface, this class also
provides "get" methods iterate over the incoming/outgoing edge list of a
given vertex.
Constructor Summary | |
---|---|
GLGraph()
|
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. |
java.util.List<java.lang.Integer> |
c2rMap()
|
void |
clear()
Reset the graph to its initial empty state. |
SparseGraphStruct |
csc()
|
SparseGraphStruct |
csr()
|
java.util.List<EdgeData> |
edatalist()
|
EdgeData |
edgeData(EdgeType e)
|
void |
finalize()
This method shall be called to ensure that the graph is in its finalized state and is ready for output. |
EdgeList |
inEdges(int vid)
|
int |
lvid(VidType gvid)
|
int |
numEdges()
|
int |
numInEdges(int vid)
|
int |
numOutEdges(int vid)
|
int |
numVertices()
|
EdgeList |
outEdges(int vid)
|
int |
pid()
|
void |
reserveEdgeSpace(int numEdges)
|
void |
reserveVertexSpace(int numVertices)
|
EdgeData |
setEdgeData(EdgeType e,
EdgeData value)
|
void |
setPid(int pid)
|
java.lang.String |
toString()
|
java.util.Map<VidType,java.lang.Integer> |
vid2lvid()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GLGraph()
Method Detail |
---|
public int numEdges()
numEdges
in interface Graph<VidType,VertexData,EdgeData>
public EdgeData edgeData(EdgeType e)
e
- A lazy edge object.
public EdgeData setEdgeData(EdgeType e, EdgeData value)
e
- The lazy edge object.value
- the new edge data.
public int lvid(VidType gvid)
gvid
- the global id of the vertex
public int numInEdges(int vid)
vid
- the local vertex id.
public int numOutEdges(int vid)
vid
- the local vertex id.
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 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 EdgeList inEdges(int vid)
public EdgeList outEdges(int vid)
public void finalize() throws java.lang.Exception
Graph
finalize
in interface Graph<VidType,VertexData,EdgeData>
finalize
in class java.lang.Object
java.lang.Exception
public java.util.Map<VidType,java.lang.Integer> vid2lvid()
public java.util.List<EdgeData> edatalist()
public void clear()
Graph
clear
in interface Graph<VidType,VertexData,EdgeData>
public java.lang.String toString()
toString
in class java.lang.Object
public SparseGraphStruct csr()
public SparseGraphStruct csc()
public java.util.List<java.lang.Integer> c2rMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |