Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> how to specify class name to run in mapreduce job


Copy link to this message
-
Re: how to specify class name to run in mapreduce job
Hi Vinod
         You can use the format as
hadoop jar <jarName> <className>

Like ->  hadoop jar /home/user/sample.jar com.sample.apps.MainClass ......

Don't specify the main class while packing your jar. This would help you
incorporate multiple entry points in same jar for different functionality.

Hope it helps!..

regards
Bejoy.KS
On Wed, Jan 11, 2012 at 4:56 AM, T Vinod Gupta <[EMAIL PROTECTED]>wrote:

> hi,
> how can i specify which class' main method to run as a job when i do
> mapreduce? lets say my jar has 4 classes and each one of them has a main
> method. i want to pass the class name in the 'hadoop jar <jar file>
> <classname>' command. this will be similar to running stock tools inside
> hbase or other hadoop jars that out of the box.
> currently, i solve this problem by setting the main in the project and
> building the jar and running it. but i want to be able to flip that at run
> time instead of compile time.
>
> thanks
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB