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.util.Vector; |
---|
9 | import java.util.Collection; |
---|
10 | import org.apache.hadoop.mapred.*; |
---|
11 | import org.apache.hadoop.util.StringUtils; |
---|
12 | import org.apache.hadoop.util.ServletUtil; |
---|
13 | |
---|
14 | public final class jobqueue_005fdetails_jsp extends org.apache.jasper.runtime.HttpJspBase |
---|
15 | implements org.apache.jasper.runtime.JspSourceDependent { |
---|
16 | |
---|
17 | |
---|
18 | private static final long serialVersionUID = 526456771152222127L; |
---|
19 | |
---|
20 | private static java.util.List _jspx_dependants; |
---|
21 | |
---|
22 | public Object getDependants() { |
---|
23 | return _jspx_dependants; |
---|
24 | } |
---|
25 | |
---|
26 | public void _jspService(HttpServletRequest request, HttpServletResponse response) |
---|
27 | throws java.io.IOException, ServletException { |
---|
28 | |
---|
29 | JspFactory _jspxFactory = null; |
---|
30 | PageContext pageContext = null; |
---|
31 | HttpSession session = null; |
---|
32 | ServletContext application = null; |
---|
33 | ServletConfig config = null; |
---|
34 | JspWriter out = null; |
---|
35 | Object page = this; |
---|
36 | JspWriter _jspx_out = null; |
---|
37 | PageContext _jspx_page_context = null; |
---|
38 | |
---|
39 | |
---|
40 | try { |
---|
41 | _jspxFactory = JspFactory.getDefaultFactory(); |
---|
42 | response.setContentType("text/html; charset=UTF-8"); |
---|
43 | pageContext = _jspxFactory.getPageContext(this, request, response, |
---|
44 | null, true, 8192, true); |
---|
45 | _jspx_page_context = pageContext; |
---|
46 | application = pageContext.getServletContext(); |
---|
47 | config = pageContext.getServletConfig(); |
---|
48 | session = pageContext.getSession(); |
---|
49 | out = pageContext.getOut(); |
---|
50 | _jspx_out = out; |
---|
51 | |
---|
52 | out.write('\n'); |
---|
53 | out.write('\n'); |
---|
54 | |
---|
55 | JobTracker tracker = |
---|
56 | (JobTracker) application.getAttribute("job.tracker"); |
---|
57 | String trackerName = |
---|
58 | StringUtils.simpleHostname(tracker.getJobTrackerMachine()); |
---|
59 | String queueName = |
---|
60 | StringUtils.escapeHTML(request.getParameter("queueName")); |
---|
61 | TaskScheduler scheduler = tracker.getTaskScheduler(); |
---|
62 | Collection<JobInProgress> jobs = scheduler.getJobs(queueName); |
---|
63 | JobQueueInfo schedInfo = tracker.getQueueInfo(queueName); |
---|
64 | |
---|
65 | out.write("\n<html>\n<head>\n<title>Queue details for "); |
---|
66 | out.print(queueName!=null?queueName:""); |
---|
67 | out.write(" </title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hadoop.css\">\n<script type=\"text/javascript\" src=\"/static/jobtracker.js\"></script>\n</head>\n<body>\n"); |
---|
68 | JSPUtil.processButtons(request, response, tracker); |
---|
69 | out.write('\n'); |
---|
70 | |
---|
71 | String schedulingInfoString = schedInfo.getSchedulingInfo(); |
---|
72 | |
---|
73 | out.write("\n<h1>Hadoop Job Queue Scheduling Information on \n <a href=\"jobtracker.jsp\">"); |
---|
74 | out.print(trackerName); |
---|
75 | out.write("</a>\n</h1>\n<div>\nScheduling Information : "); |
---|
76 | out.print( schedulingInfoString.replaceAll("\n","<br/>") ); |
---|
77 | out.write("\n</div>\n<hr/>\n"); |
---|
78 | |
---|
79 | if(jobs == null || jobs.isEmpty()) { |
---|
80 | |
---|
81 | out.write("\n<center>\n<h2> No Jobs found for the Queue :: "); |
---|
82 | out.print(queueName!=null?queueName:""); |
---|
83 | out.write(" </h2>\n<hr/>\n</center>\n"); |
---|
84 | |
---|
85 | }else { |
---|
86 | |
---|
87 | out.write("\n<center>\n<h2> Job Summary for the Queue :: "); |
---|
88 | out.print(queueName!=null?queueName:"" ); |
---|
89 | out.write(" </h2>\n</center>\n<div style=\"text-align: center;text-indent: center;font-style: italic;\">\n(In the order maintained by the scheduler)\n</div>\n<br/>\n<hr/>\n"); |
---|
90 | out.print( |
---|
91 | JSPUtil.generateJobTable("Job List", jobs, 30, 0) |
---|
92 | ); |
---|
93 | out.write("\n<hr>\n"); |
---|
94 | } |
---|
95 | out.write('\n'); |
---|
96 | out.write('\n'); |
---|
97 | |
---|
98 | out.println(ServletUtil.htmlFooter()); |
---|
99 | |
---|
100 | out.write('\n'); |
---|
101 | out.write('\n'); |
---|
102 | } catch (Throwable t) { |
---|
103 | if (!(t instanceof SkipPageException)){ |
---|
104 | out = _jspx_out; |
---|
105 | if (out != null && out.getBufferSize() != 0) |
---|
106 | out.clearBuffer(); |
---|
107 | if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); |
---|
108 | } |
---|
109 | } finally { |
---|
110 | if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); |
---|
111 | } |
---|
112 | } |
---|
113 | } |
---|