% /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ %> <%@ page contentType="text/html; charset=UTF-8" import="javax.servlet.*" import="javax.servlet.http.*" import="java.io.*" import="java.lang.String" import="java.util.*" import="org.apache.hadoop.http.HtmlQuoting" import="org.apache.hadoop.mapred.*" import="org.apache.hadoop.mapred.JSPUtil.JobWithViewAccessCheck" import="org.apache.hadoop.util.*" import="java.text.SimpleDateFormat" import="org.apache.hadoop.security.UserGroupInformation" import="java.security.PrivilegedExceptionAction" import="org.apache.hadoop.security.AccessControlException" %> <%!static SimpleDateFormat dateFormat = new SimpleDateFormat( "d-MMM-yyyy HH:mm:ss"); %> <%! private static final long serialVersionUID = 1L; %> <%!private void printConfirm(JspWriter out, String attemptid, String action) throws IOException { String url = "taskdetails.jsp?attemptid=" + attemptid; out.print("
" + "" + "" + " |
Task Attempts | Machine | Status | Progress | Start Time | <% if (ts[0].getIsMap()) { %>Map Phase Finished | <% } else if(!isCleanupOrSetup) { %>Shuffle Finished | Sort Finished | <% } %>Finish Time | Errors | Task Logs | Counters | Actions |
" + status.getTaskID() + " | "); String taskAttemptTracker = null; String cleanupTrackerName = null; TaskTrackerStatus cleanupTracker = null; String cleanupAttemptTracker = null; boolean hasCleanupAttempt = false; if (tip != null && tip.isCleanupAttempt(status.getTaskID())) { cleanupTrackerName = tip.machineWhereCleanupRan(status.getTaskID()); cleanupTracker = tracker.getTaskTrackerStatus(cleanupTrackerName); if (cleanupTracker != null) { cleanupAttemptTracker = "http://" + cleanupTracker.getHost() + ":" + cleanupTracker.getHttpPort(); } hasCleanupAttempt = true; } out.print("");
if (hasCleanupAttempt) {
out.print("Task attempt: ");
}
if (taskTracker == null) {
out.print(taskTrackerName);
} else {
taskAttemptTracker = "http://" + taskTracker.getHost() + ":"
+ taskTracker.getHttpPort();
out.print(""
+ tracker.getNode(taskTracker.getHost()) + "");
}
if (hasCleanupAttempt) {
out.print(" Cleanup Attempt: "); if (cleanupAttemptTracker == null ) { out.print(cleanupTrackerName); } else { out.print("" + tracker.getNode(cleanupTracker.getHost()) + ""); } } out.print(" | ");
out.print("" + status.getRunState() + " | "); out.print("" + StringUtils.formatPercent(status.getProgress(), 2) + ServletUtil.percentageGraph(status.getProgress() * 100f, 80) + " | "); out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, status .getStartTime(), 0) + " | "); if (ts[i].getIsMap()) { out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, status .getMapFinishTime(), status.getStartTime()) + " | "); } else if (!isCleanupOrSetup) { out.print("" + StringUtils.getFormattedTimeWithDiff(dateFormat, status .getShuffleFinishTime(), status.getStartTime()) + " | "); out.println("" + StringUtils.getFormattedTimeWithDiff(dateFormat, status .getSortFinishTime(), status.getShuffleFinishTime()) + " | "); } out.println("" + StringUtils.getFormattedTimeWithDiff(dateFormat, status .getFinishTime(), status.getStartTime()) + " | "); out.print(""); String [] failures = tracker.getTaskDiagnostics(status.getTaskID()); if (failures == null) { out.print(" "); } else { for(int j = 0 ; j < failures.length ; j++){ out.print(HtmlQuoting.quoteHtmlChars(failures[j])); if (j < (failures.length - 1)) { out.print("\n-------\n"); } } } out.print(" | ");
out.print("");
String taskLogUrl = null;
if (taskTracker != null ) {
taskLogUrl = TaskLogServlet.getTaskLogUrl(taskTracker.getHost(),
String.valueOf(taskTracker.getHttpPort()),
status.getTaskID().toString());
}
if (hasCleanupAttempt) {
out.print("Task attempt: "); } if (taskLogUrl == null) { out.print("n/a"); } else { String tailFourKBUrl = taskLogUrl + "&start=-4097"; String tailEightKBUrl = taskLogUrl + "&start=-8193"; String entireLogUrl = taskLogUrl + "&all=true"; out.print("Last 4KB "); out.print("Last 8KB "); out.print("All "); } if (hasCleanupAttempt) { out.print("Cleanup attempt: "); taskLogUrl = null; if (cleanupTracker != null ) { taskLogUrl = TaskLogServlet.getTaskLogUrl(cleanupTracker.getHost(), String.valueOf(cleanupTracker.getHttpPort()), status.getTaskID().toString()); } if (taskLogUrl == null) { out.print("n/a"); } else { String tailFourKBUrl = taskLogUrl + "&start=-4097&cleanup=true"; String tailEightKBUrl = taskLogUrl + "&start=-8193&cleanup=true"; String entireLogUrl = taskLogUrl + "&all=true&cleanup=true"; out.print("Last 4KB "); out.print("Last 8KB "); out.print("All "); } } out.print(" | " + "" + ((status.getCounters() != null) ? status.getCounters().size() : 0) + " | "); out.print("");
if (privateActions
&& status.getRunState() == TaskStatus.State.RUNNING) {
out.print(" Kill ");
out.print(" Fail "); } else out.print(" "); out.println(" |
" + split + " |