0
votes

Background: I am new Hadoop and learning stuffs by going through Youtube videos. I am using Cloudera QuickStart VM for practical purposes. While running WordCount example provided by Cloudera "hadoop-mapreduce-examples-2.0.0-cdh4.4.0.jar", I am unable to find the entry point of the program.

Here is the source code link, http://grepcode.com/file/repository.cloudera.com/content/repositories/releases/org.apache.hadoop/hadoop-mapreduce-examples/2.0.0-cdh4.0.0/org/apache/hadoop/examples/WordCount.java?av=f

Questions, 1) What is the entry point of WordCount Program or What is the Flow?

I am sure its not main method of WordCount.java as i get below mentioned error when i use WordCount as program name.
[cloudera@localhost hadoop-mapreduce]$ hadoop jar hadoop-mapreduce-examples-2.0.0-cdh4.4.0.jar WordCount /user/cloudera/harsha/input /user/cloudera/harsha/output Unknown program 'WordCount' chosen.
{MORE PROGRAMS HERE}
teravalidate: Checking results of terasort
wordcount: A map/reduce program that counts the words in the input files.

2) How CLASSPATH is being set?

With the following statement, program runs fine. How are we referring the required libraries?
[cloudera@localhost hadoop-mapreduce]$ hadoop jar hadoop-mapreduce-examples-2.0.0-cdh4.4.0.jar wordCount /user/cloudera/harsha/input /user/cloudera/harsha/output

Thanks, Harsha

1

1 Answers

0
votes

You can set CLASSPATH with this command:

javac -classpath /usr/lib/hadoop/hadoop-common-2.0.0-cdh4.4.0.jar:/usr/lib/hadoop/client/hadoop-mapreduce-client-core-2.0.0-cdh4.4.0.jar -d wordcount_classes WordCount.java