gov.llnl.ontology.mapreduce.stats
Class WordSumReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
      extended by gov.llnl.ontology.mapreduce.stats.WordSumReducer

public class WordSumReducer
extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>

This Reducer counts the number of times that they key occures with each of it's values. It emits each a tuple of the form: (key,other_item), co-occurrence_count Where the first item is emited as a single Text object and the count is a IntWritable object.

Author:
Keith Stevens

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
WordSumReducer()
           
 
Method Summary
 void reduce(org.apache.hadoop.io.Text key, Iterable<org.apache.hadoop.io.Text> values, org.apache.hadoop.mapreduce.Reducer.Context context)
          
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordSumReducer

public WordSumReducer()
Method Detail

reduce

public void reduce(org.apache.hadoop.io.Text key,
                   Iterable<org.apache.hadoop.io.Text> values,
                   org.apache.hadoop.mapreduce.Reducer.Context context)
            throws IOException,
                   InterruptedException

Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException


Copyright © 2010-2011. All Rights Reserved.