edu.umd.cloud9.example.simple
Class DemoWordCountTuple1

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by edu.umd.cloud9.example.simple.DemoWordCountTuple1
All Implemented Interfaces:
Configurable, Tool

public class DemoWordCountTuple1
extends Configured
implements Tool

Demo that illustrates use of Tuple objects as intermediate keys in a MapReduce job. This Hadoop Tool takes the following command-line arguments:

Input comes from a flat text collection packed into a SequenceFile with DemoPackTuples1. Output shows the count of words on even- and odd-length lines.

Format of the output SequenceFile: The key is a Tuple. The first field of the tuple contains a word and the second field indicates whether the word was found on a even-length or odd-length line. The value is the count of the word on either even- or odd-length lines.

Author:
Jimmy Lin
See Also:
DemoWordCountTuple2, DemoWordCountJSON

Constructor Summary
DemoWordCountTuple1()
          Creates an instance of this tool.
 
Method Summary
static void main(String[] args)
          Dispatches command-line arguments to the tool via the ToolRunner.
 int run(String[] args)
          Runs this tool.
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

DemoWordCountTuple1

public DemoWordCountTuple1()
Creates an instance of this tool.

Method Detail

run

public int run(String[] args)
        throws Exception
Runs this tool.

Specified by:
run in interface Tool
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Dispatches command-line arguments to the tool via the ToolRunner.

Throws:
Exception