This project has retired. For details please refer to its Attic page.
WordCount (Apache Gora 0.2 API)

org.apache.gora.examples.mapreduce
Class WordCount

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.gora.examples.mapreduce.WordCount
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class WordCount
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool

Classic word count example in Gora.


Nested Class Summary
static class WordCount.TokenizerMapper
          TokenizerMapper takes <String, WebPage> pairs as obtained from the input DataStore, and tokenizes the content via WebPage.getContent().
static class WordCount.WordCountReducer
           
 
Constructor Summary
WordCount()
           
WordCount(org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 org.apache.hadoop.mapreduce.Job createJob(DataStore<String,WebPage> inStore, Query<String,WebPage> query, DataStore<String,TokenDatum> outStore)
          Creates and returns the Job for submitting to Hadoop mapreduce.
static void main(String[] args)
           
 int run(String[] args)
           
 int wordCount(DataStore<String,WebPage> inStore, DataStore<String,TokenDatum> outStore)
           
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
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.conf.Configurable
getConf, setConf
 

Constructor Detail

WordCount

public WordCount()

WordCount

public WordCount(org.apache.hadoop.conf.Configuration conf)
Method Detail

createJob

public org.apache.hadoop.mapreduce.Job createJob(DataStore<String,WebPage> inStore,
                                                 Query<String,WebPage> query,
                                                 DataStore<String,TokenDatum> outStore)
                                          throws IOException
Creates and returns the Job for submitting to Hadoop mapreduce.

Parameters:
inStore -
query -
Returns:
Throws:
IOException

wordCount

public int wordCount(DataStore<String,WebPage> inStore,
                     DataStore<String,TokenDatum> outStore)
              throws IOException,
                     InterruptedException,
                     ClassNotFoundException
Throws:
IOException
InterruptedException
ClassNotFoundException

run

public int run(String[] args)
        throws Exception
Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.