Hadoop find hostname of task attempt

喜你入骨 提交于 2019-12-24 11:55:20

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/14712038/hadoop-find-hostname-of-task-attempt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!