org.apache.hadoop.examples
Class WordStandardDeviation.WordStandardDeviationMapper
java.lang.Object
org.apache.hadoop.mapreduce.Mapper<Object,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>
org.apache.hadoop.examples.WordStandardDeviation.WordStandardDeviationMapper
- Enclosing class:
- WordStandardDeviation
public static class WordStandardDeviation.WordStandardDeviationMapper
- 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 3 key-value pairs; one key-value pair for
counting the word, one for counting its length, and one for counting the
square of its length.
| Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
org.apache.hadoop.mapreduce.Mapper.Context |
|
Method Summary |
void |
map(Object key,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
Emits 3 key-value pairs for counting the word, its length, and the
squares of 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 |
WordStandardDeviation.WordStandardDeviationMapper
public WordStandardDeviation.WordStandardDeviationMapper()
map
public void map(Object key,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException,
InterruptedException
- Emits 3 key-value pairs for counting the word, its length, and the
squares of 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.