com.intel.hadoop.graphbuilder.preprocess.mapreduce
Class CreateGraphReducer
java.lang.Object
org.apache.hadoop.mapred.MapReduceBase
com.intel.hadoop.graphbuilder.preprocess.mapreduce.CreateGraphReducer
- All Implemented Interfaces:
- java.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.IntWritable,VertexEdgeUnionType,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
public class CreateGraphReducer
- extends org.apache.hadoop.mapred.MapReduceBase
- implements org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.IntWritable,VertexEdgeUnionType,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
The Reducer class applies user defined Functional
s to reduce
duplicate edges and vertices. If no such Functional
is provide, it
outputs the first instance and discards the rest with the same identifier. It
also discards self edges: v - > v. An option for discard bidirectional edge
is provided by cleanBidirectionalEdge(boolean)
.
Output directory structure:
- $outputdir/edata contains edge data output
- $outputdir/vdata contains vertex data output
Method Summary |
void |
configure(org.apache.hadoop.mapred.JobConf job)
|
void |
reduce(org.apache.hadoop.io.IntWritable key,
java.util.Iterator<VertexEdgeUnionType> iter,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> out,
org.apache.hadoop.mapred.Reporter reporter)
|
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase |
close |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.Closeable |
close |
CreateGraphReducer
public CreateGraphReducer()
configure
public void configure(org.apache.hadoop.mapred.JobConf job)
- Specified by:
configure
in interface org.apache.hadoop.mapred.JobConfigurable
- Overrides:
configure
in class org.apache.hadoop.mapred.MapReduceBase
reduce
public void reduce(org.apache.hadoop.io.IntWritable key,
java.util.Iterator<VertexEdgeUnionType> iter,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> out,
org.apache.hadoop.mapred.Reporter reporter)
throws java.io.IOException
- Specified by:
reduce
in interface org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.IntWritable,VertexEdgeUnionType,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
- Throws:
java.io.IOException