gov.llnl.ontology.mapreduce.stats
Class WordCountSumReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<StringPair,org.apache.hadoop.io.IntWritable,StringPair,org.apache.hadoop.io.IntWritable>
      extended by gov.llnl.ontology.mapreduce.stats.WordCountSumReducer

public class WordCountSumReducer
extends org.apache.hadoop.mapreduce.Reducer<StringPair,org.apache.hadoop.io.IntWritable,StringPair,org.apache.hadoop.io.IntWritable>

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
WordCountSumReducer()
           
 
Method Summary
static void emitCounts(Map<String,StringCounter> wocCounts, org.apache.hadoop.mapreduce.Mapper.Context context)
          Writes the co-occurrence counts as stored in a map of Counters to context.
 void reduce(StringPair key, Iterable<org.apache.hadoop.io.IntWritable> 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

WordCountSumReducer

public WordCountSumReducer()
Method Detail

emitCounts

public static void emitCounts(Map<String,StringCounter> wocCounts,
                              org.apache.hadoop.mapreduce.Mapper.Context context)
                       throws IOException,
                              InterruptedException
Writes the co-occurrence counts as stored in a map of Counters to context. This is simply a helper function that formats each written co-occurrence in the format used by this Reducer.

Throws:
IOException
InterruptedException

reduce

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

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


Copyright © 2010-2011. All Rights Reserved.