com.intel.hadoop.graphbuilder.partition.mapreduce.keyvalue
Class IngressValueType<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.IngressValueType<VidType,VertexData,EdgeData>
Type Parameters:
VidType -
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public abstract class IngressValueType<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

An abstract class for map value templated with VidType, VertexData, and EdgeData. MapValue is a "union" type EdgeRecordType, and VertexRecordType. Both sub types are combinable with the same subtype.


Field Summary
static short EDGEVALUE
          Enums of the map key types.
static short VRECORDVALUE
           
 
Constructor Summary
IngressValueType()
           
 
Method Summary
 void clear()
          Clear the edgevalue and vrecordvalue.
 CombinedEdgeValueType edgeValue()
           
 short flag()
           
abstract  GraphTypeFactory getGraphTypeFactory()
           
 void initEdgeValue(short pid, VidType source, VidType target, EdgeData edata)
          Initialize the EdgeRecord value.
 void initVrecValue(VidType vid, short pid, int inEdges, int outEdges)
          Initialize as a VertexRecord value without vertex data.
 void initVrecValue(VidType vid, VertexData vdata)
          Initialize as a VertexRecord value with vdata.
 void readFields(java.io.DataInput in)
           
 void reduce(short flag, java.util.Iterator<IngressValueType<VidType,VertexData,EdgeData>> iter)
          Reduce a list of values.
 CombinedVrecordValueType vrecordValue()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDGEVALUE

public static final short EDGEVALUE
Enums of the map key types. EDGEKEY represents an intermediate edge record: (pid, (source, target, data)). VERTEXKEY is for a vertex record (meta information) without vdata: (vid, mirrors, vdata=empty). VERTEXVALKEY is for a vertex data: (vid, vdata). The reducer calls different reduce methods based on the key type.

See Also:
Constant Field Values

VRECORDVALUE

public static final short VRECORDVALUE
See Also:
Constant Field Values
Constructor Detail

IngressValueType

public IngressValueType()
Method Detail

getGraphTypeFactory

public abstract GraphTypeFactory getGraphTypeFactory()

flag

public short flag()

reduce

public void reduce(short flag,
                   java.util.Iterator<IngressValueType<VidType,VertexData,EdgeData>> iter)
Reduce a list of values. Value

Parameters:
flag -
iter -

initEdgeValue

public void initEdgeValue(short pid,
                          VidType source,
                          VidType target,
                          EdgeData edata)
Initialize the EdgeRecord value.

Parameters:
pid -
source -
target -
edata -

initVrecValue

public void initVrecValue(VidType vid,
                          short pid,
                          int inEdges,
                          int outEdges)
Initialize as a VertexRecord value without vertex data.

Parameters:
vid -
pid -
inEdges -
outEdges -

initVrecValue

public void initVrecValue(VidType vid,
                          VertexData vdata)
Initialize as a VertexRecord value with vdata.

Parameters:
vid -
vdata -

clear

public void clear()
Clear the edgevalue and vrecordvalue.


edgeValue

public CombinedEdgeValueType edgeValue()
Returns:
the edgevalue, use only when flag == EDGEVALUE.

vrecordValue

public CombinedVrecordValueType vrecordValue()
Returns:
the edgevalue, use only when flag == VRECORDVALUE.

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