You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by ma qiang <ma...@gmail.com> on 2008/01/24 03:31:16 UTC

other methods can run examples in hadoop ?

Hi all:
     As we know, we can run a the example in hadoop such as WorldCount
using a command like this:  bin/hadoop jar hadoop-*-examples.jar
wordcount [-m <#maps>] [-r <#reducers>] <in-dir> <out-dir>.
     I am trying to invoke it using program, Can you tell me how to
run the examples using other methods?

Best Wishes!

Re: other methods can run examples in hadoop ?

Posted by ma qiang <ma...@gmail.com>.
I call org.apache.hadoop.examples.WordCount.main(new
String[]{"in-dir","out-dir"}) in my program, but I see the error as
below:
       Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
	at org.apache.hadoop.mapred.JobClient.<clinit>(JobClient.java:147)

I have developed a SWT project to manager all the examples in hadoop
instead of the command line .  If I choose a example such as Wordcount
,it will run.




On Jan 24, 2008 11:12 AM, Owen O'Malley <oo...@yahoo-inc.com> wrote:
>
> On Jan 23, 2008, at 6:31 PM, ma qiang wrote:
>
> >      I am trying to invoke it using program, Can you tell me how to
> > run the examples using other methods?
>
> What are you trying to accomplish? Of course you could call:
>
>   org.apache.hadoop.examples.WordCount.main(new String[]{"in-
> dir","out-dir"});
>
> is that what you are asking about?
>
> -- Owen
>

Re: other methods can run examples in hadoop ?

Posted by Owen O'Malley <oo...@yahoo-inc.com>.
On Jan 23, 2008, at 6:31 PM, ma qiang wrote:

>      I am trying to invoke it using program, Can you tell me how to
> run the examples using other methods?

What are you trying to accomplish? Of course you could call:

  org.apache.hadoop.examples.WordCount.main(new String[]{"in- 
dir","out-dir"});

is that what you are asking about?

-- Owen