org.apache.hadoop.examples
Class WordMean.WordMeanMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<Object,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>
      extended by org.apache.hadoop.examples.WordMean.WordMeanMapper
Enclosing class:
WordMean

public static class WordMean.WordMeanMapper
extends org.apache.hadoop.mapreduce.Mapper<Object,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>

Maps words from line of text into 2 key-value pairs; one key-value pair for counting the word, another for counting its length.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
WordMean.WordMeanMapper()
           
 
Method Summary
 void map(Object key, org.apache.hadoop.io.Text value, org.apache.hadoop.mapreduce.Mapper.Context context)
          Emits 2 key-value pairs for counting the word and its length.
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup, run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordMean.WordMeanMapper

public WordMean.WordMeanMapper()
Method Detail

map

public void map(Object key,
                org.apache.hadoop.io.Text value,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException,
                InterruptedException
Emits 2 key-value pairs for counting the word and its length. Outputs are (Text, LongWritable).

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<Object,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>
Parameters:
value - This will be a line of text coming in from our input file.
Throws:
IOException
InterruptedException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.