[120] | 1 | package org.apache.hadoop.mapred; |
---|
| 2 | |
---|
| 3 | import javax.servlet.*; |
---|
| 4 | import javax.servlet.http.*; |
---|
| 5 | import javax.servlet.jsp.*; |
---|
| 6 | import javax.servlet.*; |
---|
| 7 | import javax.servlet.http.*; |
---|
| 8 | import java.io.*; |
---|
| 9 | import java.util.*; |
---|
| 10 | import java.text.DecimalFormat; |
---|
| 11 | import org.apache.hadoop.mapred.*; |
---|
| 12 | import org.apache.hadoop.util.*; |
---|
| 13 | |
---|
| 14 | public final class tasktracker_jsp extends org.apache.jasper.runtime.HttpJspBase |
---|
| 15 | implements org.apache.jasper.runtime.JspSourceDependent { |
---|
| 16 | |
---|
| 17 | private static java.util.List _jspx_dependants; |
---|
| 18 | |
---|
| 19 | public Object getDependants() { |
---|
| 20 | return _jspx_dependants; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | public void _jspService(HttpServletRequest request, HttpServletResponse response) |
---|
| 24 | throws java.io.IOException, ServletException { |
---|
| 25 | |
---|
| 26 | JspFactory _jspxFactory = null; |
---|
| 27 | PageContext pageContext = null; |
---|
| 28 | HttpSession session = null; |
---|
| 29 | ServletContext application = null; |
---|
| 30 | ServletConfig config = null; |
---|
| 31 | JspWriter out = null; |
---|
| 32 | Object page = this; |
---|
| 33 | JspWriter _jspx_out = null; |
---|
| 34 | PageContext _jspx_page_context = null; |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | try { |
---|
| 38 | _jspxFactory = JspFactory.getDefaultFactory(); |
---|
| 39 | response.setContentType("text/html; charset=UTF-8"); |
---|
| 40 | pageContext = _jspxFactory.getPageContext(this, request, response, |
---|
| 41 | null, true, 8192, true); |
---|
| 42 | _jspx_page_context = pageContext; |
---|
| 43 | application = pageContext.getServletContext(); |
---|
| 44 | config = pageContext.getServletConfig(); |
---|
| 45 | session = pageContext.getSession(); |
---|
| 46 | out = pageContext.getOut(); |
---|
| 47 | _jspx_out = out; |
---|
| 48 | |
---|
| 49 | out.write('\n'); |
---|
| 50 | |
---|
| 51 | TaskTracker tracker = (TaskTracker) application.getAttribute("task.tracker"); |
---|
| 52 | String trackerName = tracker.getName(); |
---|
| 53 | |
---|
| 54 | out.write("\n\n<html>\n\n<title>"); |
---|
| 55 | out.print( trackerName ); |
---|
| 56 | out.write(" Task Tracker Status</title>\n\n<body>\n<h1>"); |
---|
| 57 | out.print( trackerName ); |
---|
| 58 | out.write(" Task Tracker Status</h1>\n<img src=\"/static/hadoop-logo.jpg\"/><br>\n<b>Version:</b> "); |
---|
| 59 | out.print( VersionInfo.getVersion()); |
---|
| 60 | out.write(",\n r"); |
---|
| 61 | out.print( VersionInfo.getRevision()); |
---|
| 62 | out.write("<br>\n<b>Compiled:</b> "); |
---|
| 63 | out.print( VersionInfo.getDate()); |
---|
| 64 | out.write(" by \n "); |
---|
| 65 | out.print( VersionInfo.getUser()); |
---|
| 66 | out.write("<br>\n\n<h2>Running tasks</h2>\n<center>\n<table border=2 cellpadding=\"5\" cellspacing=\"2\">\n<tr><td align=\"center\">Task Attempts</td><td>Status</td>\n <td>Progress</td><td>Errors</td></tr>\n\n "); |
---|
| 67 | |
---|
| 68 | Iterator itr = tracker.getRunningTaskStatuses().iterator(); |
---|
| 69 | while (itr.hasNext()) { |
---|
| 70 | TaskStatus status = (TaskStatus) itr.next(); |
---|
| 71 | out.print("<tr><td>" + status.getTaskID()); |
---|
| 72 | out.print("</td><td>" + status.getRunState()); |
---|
| 73 | out.print("</td><td>" + |
---|
| 74 | StringUtils.formatPercent(status.getProgress(), 2)); |
---|
| 75 | out.print("</td><td><pre>" + status.getDiagnosticInfo() + "</pre></td>"); |
---|
| 76 | out.print("</tr>\n"); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | out.write("\n</table>\n</center>\n\n<h2>Non-Running Tasks</h2>\n<table border=2 cellpadding=\"5\" cellspacing=\"2\">\n<tr><td align=\"center\">Task Attempts</td><td>Status</td>\n "); |
---|
| 80 | |
---|
| 81 | for(TaskStatus status: tracker.getNonRunningTasks()) { |
---|
| 82 | out.print("<tr><td>" + status.getTaskID() + "</td>"); |
---|
| 83 | out.print("<td>" + status.getRunState() + "</td></tr>\n"); |
---|
| 84 | } |
---|
| 85 | |
---|
| 86 | out.write("\n</table>\n\n\n<h2>Tasks from Running Jobs</h2>\n<center>\n<table border=2 cellpadding=\"5\" cellspacing=\"2\">\n<tr><td align=\"center\">Task Attempts</td><td>Status</td>\n <td>Progress</td><td>Errors</td></tr>\n\n "); |
---|
| 87 | |
---|
| 88 | itr = tracker.getTasksFromRunningJobs().iterator(); |
---|
| 89 | while (itr.hasNext()) { |
---|
| 90 | TaskStatus status = (TaskStatus) itr.next(); |
---|
| 91 | out.print("<tr><td>" + status.getTaskID()); |
---|
| 92 | out.print("</td><td>" + status.getRunState()); |
---|
| 93 | out.print("</td><td>" + |
---|
| 94 | StringUtils.formatPercent(status.getProgress(), 2)); |
---|
| 95 | out.print("</td><td><pre>" + status.getDiagnosticInfo() + "</pre></td>"); |
---|
| 96 | out.print("</tr>\n"); |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | out.write("\n</table>\n</center>\n\n\n<h2>Local Logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n"); |
---|
| 100 | |
---|
| 101 | out.println(ServletUtil.htmlFooter()); |
---|
| 102 | |
---|
| 103 | out.write('\n'); |
---|
| 104 | } catch (Throwable t) { |
---|
| 105 | if (!(t instanceof SkipPageException)){ |
---|
| 106 | out = _jspx_out; |
---|
| 107 | if (out != null && out.getBufferSize() != 0) |
---|
| 108 | out.clearBuffer(); |
---|
| 109 | if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); |
---|
| 110 | } |
---|
| 111 | } finally { |
---|
| 112 | if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); |
---|
| 113 | } |
---|
| 114 | } |
---|
| 115 | } |
---|