Created 06-12-2019 11:25 PM
what is the Java API to get current Hadoop Job Id ?
Created 06-12-2019 11:38 PM
Can you please check if you are looking out for this kind of APIs "JobStatus[] getAllJobStatuses()"
.
Similar discussion you can find here, please check if that helps: https://stackoverflow.com/questions/29644998/how-to-programmatically-get-all-running-jobs-in-a-hadoo...
Created 06-19-2019 05:34 PM
We are using Oozie scheduler to run our hadoop jobs. We can get job id in ambari when we run job through oozie.
When we are running hadoop jobs manually in putty , we are not able to see job id on the screen.
We are using the below java code to display job id on the screen.
Job job = Job.getInstance(dtsfBatchCleanupUtil.getHadoopConfig());
System.out.println("************ Job :: "+job.toString());
System.out.println("************ Job ID :: "+job.getJobID());
But we are getting IllegaleStateException : Job is in DEFINED State.
Please help on this...
Created 06-20-2019 09:27 AM
We are using Oozie scheduler to run our hadoop jobs. We can get job id if the job runs through oozie. But we are not able see job id if we run the job manually through putty.
We are using the below code to diplay the job id when we run the job manually.
Job job = Job.getInstance(dtsfBatchCleanupUtil.getHadoopConfig());
System.out.println("************ Job :: "+job.toString());
System.out.println("************ Job ID :: "+job.getJobID());
But we are getting IllegalStateException : Job is in DEFINED state.
Please help on this.
Created 06-20-2019 01:17 PM
I recommend Rest API than Java API, because Java API version problems can make you crazy.
https://hadoop.apache.org/docs/r2.4.1/hadoop-yarn/hadoop-yarn-site/HistoryServerRest.html