source: proiecte/HadoopJUnit/hadoop-0.20.1/src/webapps/job/jobblacklistedtrackers.jsp @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1<%@ page
2  contentType="text/html; charset=UTF-8"
3  import="javax.servlet.*"
4  import="javax.servlet.http.*"
5  import="java.io.*"
6  import="java.util.*"
7  import="org.apache.hadoop.mapred.*"
8  import="org.apache.hadoop.util.*"
9%>
10
11<%
12  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
13  String trackerName = 
14           StringUtils.simpleHostname(tracker.getJobTrackerMachine());
15%>
16<%!       
17  private void printBlackListedTrackers(JspWriter out, 
18                             JobInProgress job) throws IOException {
19    Map<String, Integer> trackerErrors = job.getTaskTrackerErrors();
20    out.print("<table border=2 cellpadding=\"5\" cellspacing=\"2\">");
21    out.print("<tr><th>TaskTracker</th><th>No. of Failures</th></tr>\n");
22    int maxErrorsPerTracker = job.getJobConf().getMaxTaskFailuresPerTracker();
23    for (Map.Entry<String,Integer> e : trackerErrors.entrySet()) {
24      if (e.getValue().intValue() >= maxErrorsPerTracker) {
25        out.print("<tr><td>" + e.getKey() + "</td><td>" + e.getValue() + 
26            "</td></tr>\n");
27      }
28    }
29    out.print("</table>\n");
30  }
31%>
32
33<%
34    String jobId = request.getParameter("jobid");
35    if (jobId == null) {
36          out.println("<h2>Missing 'jobid' for fetching black-listed tasktrackers!</h2>");
37          return;
38    }
39   
40    JobInProgress job = (JobInProgress) tracker.getJob(JobID.forName(jobId));
41    if (job == null) {
42      out.print("<b>Job " + jobId + " not found.</b><br>\n");
43      return;
44    }
45%>
46
47<html>
48<title>Hadoop <%=jobId%>'s black-listed tasktrackers</title>
49<body>
50<h1>Hadoop <a href="jobdetails.jsp?jobid=<%=jobId%>"><%=jobId%></a> -
51Black-listed task-trackers</h1>
52
53<% 
54    printBlackListedTrackers(out, job); 
55%>
56
57<hr>
58<a href="jobdetails.jsp?jobid=<%=jobId%>">Go back to <%=jobId%></a><br>
59<%
60out.println(ServletUtil.htmlFooter());
61%>
Note: See TracBrowser for help on using the repository browser.