The job submission code can be written this way.

        // Create a new Job
        Job job = new Job(new Configuration());
        job.setJarByClass(MyJob.class);

        // Specify various job-specific parameters
        job.setJobName("myjob");

        job.setInputPath(new Path("in"));
        job.setOutputPath(new Path("out"));

        job.setMapperClass(MyJob.MyMapper.class);
        job.setReducerClass(MyJob.MyReducer.class);

        // Submit the job
        job.submit();

For submitting this, need to add the hadoop jar files and configuration
files in the class path of the application from where you want to
submit the job.

You can refer this docs for more info on Job API's.


http://hadoop.apache.org/mapreduce/docs/current/api/org/apache/hadoop/mapred
uce/Job.html


Devaraj K 

-----Original Message-----
From: Oleg Ruchovets [mailto:[email protected]] 
Sent: Tuesday, October 18, 2011 5:01 PM
To: [email protected]
Subject: Re: execute hadoop job from remote web application

Excellent. Can you give a small example of code.


On Tue, Oct 18, 2011 at 1:13 PM, Uma Maheswara Rao G 72686 <
[email protected]> wrote:

>
> ----- Original Message -----
> From: Oleg Ruchovets <[email protected]>
> Date: Tuesday, October 18, 2011 4:11 pm
> Subject: execute hadoop job from remote web application
> To: [email protected]
>
> > Hi , what is the way to execute hadoop job on remote cluster. I
> > want to
> > execute my hadoop job from remote web  application , but I didn't
> > find any
> > hadoop client (remote API) to do it.
> >
> > Please advice.
> > Oleg
> >
> You can put the Hadoop jars in your web applications classpath and find
the
> Class JobClient and submit the jobs using it.
>
> Regards,
> Uma
>
>

Reply via email to