edu.purdue.cs.eblanton
Class WordMap

java.lang.Object
  extended by org.apache.hadoop.mapred.MapReduceBase
      extended by edu.purdue.cs.eblanton.WordMap
All Implemented Interfaces:
java.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable>

public class WordMap
extends org.apache.hadoop.mapred.MapReduceBase
implements org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable>

WordMap implements a map operation which takes a WritableComparable and a Text object representing a line of text, and outputs a <Text, IntWritable> tuple for each word in that line of text with the IntWritable having a value of 1.

See Also:
MapReduceBase, Mapper

Constructor Summary
WordMap()
           
 
Method Summary
 void map(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Text value, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable> output, org.apache.hadoop.mapred.Reporter reporter)
          Implements the WordMap map operation.
 
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase
close, configure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

WordMap

public WordMap()
Method Detail

map

public void map(org.apache.hadoop.io.WritableComparable key,
                org.apache.hadoop.io.Text value,
                org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable> output,
                org.apache.hadoop.mapred.Reporter reporter)
         throws java.io.IOException
Implements the WordMap map operation.

Specified by:
map in interface org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable>
Parameters:
key - the input key (ignored)
value - the line of text to be tokenized and output
output - the output collector for the resulting <word, 1> pairs
reporter - ignored
Throws:
java.io.IOException