<%@ 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 jobTrackerId = request.getParameter("jobTrackerId"); String taskStatus = request.getParameter("status"); String taskType = request.getParameter("taskType"); JobHistory.JobInfo job = (JobHistory.JobInfo)request.getSession().getAttribute("job"); Map tasks = job.getAllTasks(); %>

<%=taskStatus%> <%=taskType %> task list for <%=jobid %>

<% for( JobHistory.Task task : tasks.values() ) { if( taskType.equals(task.get(Keys.TASK_TYPE) ) ){ if( taskStatus.equals(task.get(Keys.TASK_STATUS)) || taskStatus.equals("all")){ printTask(jobid, jobTrackerId, task, out); } } } %>
Task IdStart TimeFinish Time
Error
<%! private void printTask(String jobid, String trackerId, JobHistory.Task task, JspWriter out) throws IOException{ out.print(""); out.print("" + "" + task.get(Keys.TASKID) + ""); out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, task.getLong(Keys.START_TIME), 0 ) + ""); out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, task.getLong(Keys.FINISH_TIME), task.getLong(Keys.START_TIME) ) + ""); out.print("" + task.get(Keys.ERROR) + ""); out.print(""); } %>