Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> how to query JobTracker


Copy link to this message
-
Re: how to query JobTracker
Use JobClient.submitJob(JobConf job) , this method will return
RunningJob. Then you can call RunningJob.isComplete() to query whether
the previous job has been done.

On Thu, Jun 17, 2010 at 5:53 AM, Some Body <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> What are the steps to query the cluster for running jobs with a particular JobName?
> My driver class always submits my job with a preset name.
>    Job job = new Job(config, "My Job Name");
>    ......
>    return job.waitForCompletion(true) ? 0 : 1;
>
> I want to setup a cron to trigger the job submission and I want to ensure only 1 instance of my job is running.
> Surely I could do this via a shell wrapper, but I'd rather implement it in my driver class.
> i.e. getAllJobs from the JobTracker, check for "My Job Name", and kill the old job before submitting a new job.
>
> I'm using (cloudera's) hadoop 0.20.2+228
>
> Thanks,
> Alan
>

--
Best Regards

Jeff Zhang