com.intel.hadoop.graphbuilder.partition.mapreduce.keyvalue
Class CombinedVrecordValueType<VidType extends org.apache.hadoop.io.WritableComparable<VidType>,VertexData extends org.apache.hadoop.io.Writable,EdgeData extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by com.intel.hadoop.graphbuilder.partition.mapreduce.keyvalue.CombinedVrecordValueType<VidType,VertexData,EdgeData>
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class CombinedVrecordValueType<VidType extends org.apache.hadoop.io.WritableComparable<VidType>,VertexData extends org.apache.hadoop.io.Writable,EdgeData extends org.apache.hadoop.io.Writable>
extends java.lang.Object
implements org.apache.hadoop.io.Writable

Intermediate value type of vertex records and supports commutative and associative add operation through additvity of inEdges, outEdges and union of the mirror set.


Constructor Summary
CombinedVrecordValueType(GraphTypeFactory factory)
          Create an empty vertex record.
CombinedVrecordValueType(VidType vid, short pid, int inEdges, int outEdges, GraphTypeFactory factory)
          Creates a vertex record with vid, pid, inEdges and ouEdges.
CombinedVrecordValueType(VidType vid, VertexData vdata)
          Creates a vertex record with vid and vdata.
 
Method Summary
 void add(CombinedVrecordValueType<VidType,VertexData,EdgeData> other)
          Combine with other VertexRecord value.
 void clear()
          Clear this value.
 boolean hasVdata()
           
 int inEdges()
           
 int outEdges()
           
 java.util.HashSet<java.lang.Short> pids()
           
 void readFields(java.io.DataInput in)
           
 VertexData vdata()
           
 VidType vid()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinedVrecordValueType

public CombinedVrecordValueType(GraphTypeFactory factory)
Create an empty vertex record.


CombinedVrecordValueType

public CombinedVrecordValueType(VidType vid,
                                short pid,
                                int inEdges,
                                int outEdges,
                                GraphTypeFactory factory)
Creates a vertex record with vid, pid, inEdges and ouEdges. Vertex data is empty.

Parameters:
vid -
pid -
inEdges -
outEdges -

CombinedVrecordValueType

public CombinedVrecordValueType(VidType vid,
                                VertexData vdata)
Creates a vertex record with vid and vdata. Other fields are left empty.

Parameters:
vid -
vdata -
Method Detail

add

public void add(CombinedVrecordValueType<VidType,VertexData,EdgeData> other)
Combine with other VertexRecord value. They must have the same vid.

Parameters:
other -

vid

public VidType vid()
Returns:
vertex id.

inEdges

public int inEdges()
Returns:
number of incoming edges.

outEdges

public int outEdges()
Returns:
number of outgoing edges.

hasVdata

public boolean hasVdata()
Returns:
true if this value has vertex data.

pids

public java.util.HashSet<java.lang.Short> pids()
Returns:
partition ids that contains the mirror of this vertex.

vdata

public VertexData vdata()
Returns:
vertex data.

clear

public void clear()
Clear this value.


readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException