org.apache.hadoop.examples
Class WordCount

java.lang.Object
  extended by org.apache.hadoop.examples.WordCount

public class WordCount
extends Object

This is an example Hadoop Map/Reduce application. It reads the text input files, breaks each line into words and counts them. The output is a locally sorted list of words and the count of how often they occurred. To run: bin/hadoop jar build/hadoop-examples.jar wordcount [-m maps] [-r reduces] in-dir out-dir

Author:
Owen O'Malley

Nested Class Summary
static class WordCount.MapClass
          Counts the words in each line.
static class WordCount.Reduce
          A reducer class that just emits the sum of the input values.
 
Constructor Summary
WordCount()
           
 
Method Summary
static void main(String[] args)
          The main driver for word count map/reduce program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordCount

public WordCount()
Method Detail

main

public static void main(String[] args)
                 throws IOException
The main driver for word count map/reduce program. Invoke this method to submit the map/reduce job.

Throws:
IOException - When there is communication problems with the job tracker.


Copyright © 2006 The Apache Software Foundation