rgimmy
rgimmy

Reputation: 293

Hadoop find hostname of task attempt

I am trying to programatically determine which task attempts run on which tasktracker in my cluster when submitting map reduce jobs to hadoop. I have found that I can get most of the task data from the JobClient like so:

jobClient.getMapTaskReports(jobID)

but not the hostname of the machine that a task attempt succeeded on. Does anybody know how to get the hostname from the task attempt id?

Upvotes: 1

Views: 525

Answers (1)

Thomas Jungblut
Thomas Jungblut

Reputation: 20969

The JobClient gives you a so called NetworkedJob when submitting. It has a method called getTaskCompletionEvents.

That returns you an array of TaskCompletionEvent that happened, those contain the HTTP address of the tasktracker that ran a task.

From that point you can parse the host from the URL.

Upvotes: 5

Related Questions