Hadoop找到任务尝试的主机名 [英] Hadoop find hostname of task attempt
问题描述
我试图以编程方式确定在将映射减少作业提交到hadoop时,哪些任务尝试在我的集群中的哪个任务跟踪器上运行。我发现我可以从JobClient获得大部分任务数据,如下所示:
jobClient.getMapTaskReports(jobID)
但不是任务尝试成功的机器的主机名。是否有人知道如何从任务尝试ID中获取主机名?
JobClient 给你一个所谓的 NetworkedJob 时提交。它有一个名为 getTaskCompletionEvents
的方法。返回一个 TaskCompletionEvent
发生了那些包含执行任务的tasktracker的HTTP地址。
从这一点开始,您可以解析主机网址。
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?
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.
这篇关于Hadoop找到任务尝试的主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!