com.intel.hadoop.graphbuilder.graph
Class VertexRecord<VidType,VertexData>

java.lang.Object
  extended by com.intel.hadoop.graphbuilder.graph.VertexRecord<VidType,VertexData>
Type Parameters:
VidType - the type of vertex id.
VertexData - the type of vertex data.

public class VertexRecord<VidType,VertexData>
extends java.lang.Object

Represents a distributed vertex. A vertex in a distributed graph partitioned by vertex separators may belong to multiple partitions. The vertex separators are set of vertices whose removal leads to disjoint partitions of the original graph. Therefore, a vertex record maintains the global information about a vertex in the distributed setting. Among the partitions which contains a certain vertex, one of the partition will be the owner of that vertex, and the vertex copy on other partitions are called mirrors.


Constructor Summary
VertexRecord()
          Default constructor of an empty vertex record.
VertexRecord(VidType gvid)
          Creates a vertex record of a given vertex id.
 
Method Summary
 void addMirror(short i)
           
 int inEdges()
           
 java.util.List<java.lang.Short> mirrorList()
           
 int numMirrors()
           
 int outEdges()
           
 short owner()
           
 void removeMirror(short i)
           
 void setInEdges(int inEdges)
           
 void setMirrors(java.util.BitSet mirrors)
           
 void setMirrorsFromList(java.util.List<java.lang.Integer> mirrors, int numProcs)
           
 void setOutEdges(int outEdges)
          the number of edges whose source vertex equals to this vertex in the entire graph.
 void setOwner(short owner)
           
 void setVdata(VertexData vdata)
           
 void setVid(VidType id)
           
 java.lang.String toString()
           
 VertexData vdata()
           
 VidType vid()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VertexRecord

public VertexRecord()
Default constructor of an empty vertex record.


VertexRecord

public VertexRecord(VidType gvid)
Creates a vertex record of a given vertex id.

Parameters:
gvid - the global id of the vertex.
Method Detail

numMirrors

public int numMirrors()
Returns:
the number of mirror vertices.

vid

public VidType vid()
Returns:
the vertex id.

setVid

public void setVid(VidType id)
Parameters:
id - the new vertex id.

inEdges

public int inEdges()
Returns:
the number of edges whose target vertex equals to this vertex in the entire graph.

setInEdges

public void setInEdges(int inEdges)
Parameters:
inEdges - the number of edges whose target vertex equals to this vertex in the entire graph.

outEdges

public int outEdges()
Returns:
the number of edges whose source vertex equals to this vertex in the entire graph.

setOutEdges

public void setOutEdges(int outEdges)
the number of edges whose source vertex equals to this vertex in the entire graph.

Parameters:
outEdges -

vdata

public VertexData vdata()
Returns:
the vertex data.

setVdata

public void setVdata(VertexData vdata)
Parameters:
vdata - the new vertex data.

owner

public short owner()
Returns:
the owner partition id of the vertex.

setOwner

public void setOwner(short owner)
Parameters:
owner - the owner partition id of the vertex.

mirrorList

public java.util.List<java.lang.Short> mirrorList()
Returns:
a list of representation of the mirrors of this vertex.

setMirrorsFromList

public void setMirrorsFromList(java.util.List<java.lang.Integer> mirrors,
                               int numProcs)
Parameters:
mirrors - a list representation of the mirrors of this vertex.
numProcs - total number of partitions.

setMirrors

public void setMirrors(java.util.BitSet mirrors)
Parameters:
mirrors - a bitset representation of the mirrors.

addMirror

public void addMirror(short i)
Parameters:
i - a new partition id to be added to the mirror list.

removeMirror

public void removeMirror(short i)
Parameters:
i - the partition id to be removed from the mirror list.

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object