de.hpi.fgis.voidgen.hadoop.tasks.distinctclustering
Class TypeSelectionReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,StringIntPair,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
de.hpi.fgis.voidgen.hadoop.tasks.distinctclustering.TypeSelectionReducer
public class TypeSelectionReducer
- extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,StringIntPair,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
For each subject selects the type which number
of appearances is closest to the desired cluster
size.
Input
- Key: subject
- Value: pair of
a type and
the number of appearances of this type
Output
- Key: most fitting type (cluster id) of the subject
- Value: subject
- Author:
- Martin Linkhorst, Hasso Plattner Institute at University of Potsdam, Germany, Johannes Gosda, Hasso Plattner Institute at University of Potsdam, Germany
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer |
org.apache.hadoop.mapreduce.Reducer.Context |
Method Summary |
void |
reduce(org.apache.hadoop.io.Text key,
java.lang.Iterable<StringIntPair> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
|
void |
setup(org.apache.hadoop.mapreduce.Reducer.Context context)
|
Methods inherited from class org.apache.hadoop.mapreduce.Reducer |
cleanup, run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeSelectionReducer
public TypeSelectionReducer()
setup
public void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
- Overrides:
setup
in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,StringIntPair,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
reduce
public void reduce(org.apache.hadoop.io.Text key,
java.lang.Iterable<StringIntPair> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
throws java.io.IOException,
java.lang.InterruptedException
- Overrides:
reduce
in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,StringIntPair,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
- Throws:
java.io.IOException
java.lang.InterruptedException