<%@ page contentType="text/html; charset=UTF-8" import="javax.servlet.http.*" import="java.io.*" import="java.util.*" import="org.apache.hadoop.mapred.*" import="org.apache.hadoop.util.*" import="java.text.SimpleDateFormat" import="org.apache.hadoop.mapred.JobHistory.*" %> "/> "/> <%! private static SimpleDateFormat dateFormat = new SimpleDateFormat("d/MM HH:mm:ss") ; %> <% String jobid = request.getParameter("jobid"); String logFile = request.getParameter("logFile"); String encodedLogFileName = JobHistory.JobInfo.encodeJobHistoryFilePath(logFile); String taskid = request.getParameter("taskid"); JobHistory.JobInfo job = (JobHistory.JobInfo) request.getSession().getAttribute("job"); JobHistory.Task task = job.getAllTasks().get(taskid); String type = task.get(Keys.TASK_TYPE); %>

<%=taskid %> attempts for <%=jobid %>

<% if (Values.REDUCE.name().equals(type)) { %> <% } %> <% for (JobHistory.TaskAttempt attempt : task.getTaskAttempts().values()) { printTaskAttempt(attempt, type, out); } %>
Task IdStart TimeShuffle FinishedSort FinishedFinish TimeHostErrorTask Logs
<% if (Values.MAP.name().equals(type)) { %>

Input Split Locations

<% for (String split : StringUtils.split(task.get(Keys.SPLITS))) { out.println(""); } %>
" + split + "
<% } %> <%! private void printTaskAttempt(JobHistory.TaskAttempt taskAttempt, String type, JspWriter out) throws IOException { out.print(""); out.print("" + taskAttempt.get(Keys.TASK_ATTEMPT_ID) + ""); out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, taskAttempt.getLong(Keys.START_TIME), 0 ) + ""); if (Values.REDUCE.name().equals(type)) { JobHistory.ReduceAttempt reduceAttempt = (JobHistory.ReduceAttempt)taskAttempt; out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, reduceAttempt.getLong(Keys.SHUFFLE_FINISHED), reduceAttempt.getLong(Keys.START_TIME)) + ""); out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, reduceAttempt.getLong(Keys.SORT_FINISHED), reduceAttempt.getLong(Keys.SHUFFLE_FINISHED)) + ""); } out.print(""+ StringUtils.getFormattedTimeWithDiff(dateFormat, taskAttempt.getLong(Keys.FINISH_TIME), taskAttempt.getLong(Keys.START_TIME) ) + ""); out.print("" + taskAttempt.get(Keys.HOSTNAME) + ""); out.print("" + taskAttempt.get(Keys.ERROR) + ""); // Print task log urls out.print(""); String taskLogsUrl = JobHistory.getTaskLogsUrl(taskAttempt); if (taskLogsUrl != null) { String tailFourKBUrl = taskLogsUrl + "&start=-4097"; String tailEightKBUrl = taskLogsUrl + "&start=-8193"; String entireLogUrl = taskLogsUrl + "&all=true"; out.print("Last 4KB
"); out.print("Last 8KB
"); out.print("All
"); } else { out.print("n/a"); } out.print(""); out.print(""); } %>