Reputation: 6465
I have a Hadoop program which has a loop. In each iteration of the loop a job is created. How can I find the job id in the code?
Upvotes: 1
Views: 3290
Reputation: 41428
When you submit your Job
instance, you can get information about the job id using the getJobID
method:
Configuration config = new Configuration();
Job job = new Job(config);
// configure your job
job.submit();
// at that point your job is submitted but not finished and should have your job id
String jobid = job.getJobID().toString();
Note that there was a bug described in MAPREDUCE-118 which impacted Hadoop versions before 0.20.204 where getJobID
would only return null
.
Upvotes: 2