user727272
user727272

Reputation: 475

Get Details of completed and retired jobs in hadoop

I need to get the following Details from completed and retired jobs in hadoop job tracker.

job id

user

Name (of job)

status

finish Time.

Basically most of these above are displayed by the jobtracker.jsp URL.

And i need to capture them for auditing purposes.

Please let me know how to access the above fields.

Code examples would be very helpful

Upvotes: 0

Views: 828

Answers (1)

Chris White
Chris White

Reputation: 30089

Look into using the JobClient API, specifically the getAllJobs() call and methods of the JobStatus object array that is returned.

Some non-tested code:

JobClient client = new JobClient(getConf());
for (JobStatus job : client.getAllJobs()) {
    if (job.isJobComplete()) {
        Stirng jobName = job.getJobName();
        int jobStatus = job.getJobStatus();
        // .. you get the idea
    }
}

Upvotes: 1

Related Questions