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.net.URL; |
---|
10 | import org.apache.hadoop.mapred.*; |
---|
11 | import org.apache.hadoop.util.*; |
---|
12 | |
---|
13 | public final class jobconf_jsp extends org.apache.jasper.runtime.HttpJspBase |
---|
14 | implements org.apache.jasper.runtime.JspSourceDependent { |
---|
15 | |
---|
16 | private static java.util.List _jspx_dependants; |
---|
17 | |
---|
18 | public Object getDependants() { |
---|
19 | return _jspx_dependants; |
---|
20 | } |
---|
21 | |
---|
22 | public void _jspService(HttpServletRequest request, HttpServletResponse response) |
---|
23 | throws java.io.IOException, ServletException { |
---|
24 | |
---|
25 | JspFactory _jspxFactory = null; |
---|
26 | PageContext pageContext = null; |
---|
27 | HttpSession session = null; |
---|
28 | ServletContext application = null; |
---|
29 | ServletConfig config = null; |
---|
30 | JspWriter out = null; |
---|
31 | Object page = this; |
---|
32 | JspWriter _jspx_out = null; |
---|
33 | PageContext _jspx_page_context = null; |
---|
34 | |
---|
35 | |
---|
36 | try { |
---|
37 | _jspxFactory = JspFactory.getDefaultFactory(); |
---|
38 | response.setContentType("text/html; charset=UTF-8"); |
---|
39 | pageContext = _jspxFactory.getPageContext(this, request, response, |
---|
40 | null, true, 8192, true); |
---|
41 | _jspx_page_context = pageContext; |
---|
42 | application = pageContext.getServletContext(); |
---|
43 | config = pageContext.getServletConfig(); |
---|
44 | session = pageContext.getSession(); |
---|
45 | out = pageContext.getOut(); |
---|
46 | _jspx_out = out; |
---|
47 | |
---|
48 | out.write('\n'); |
---|
49 | out.write('\n'); |
---|
50 | out.write('\n'); |
---|
51 | |
---|
52 | JobTracker tracker = (JobTracker) application.getAttribute("job.tracker"); |
---|
53 | String jobId = request.getParameter("jobid"); |
---|
54 | if (jobId == null) { |
---|
55 | out.println("<h2>Missing 'jobid' for fetching job configuration!</h2>"); |
---|
56 | return; |
---|
57 | } |
---|
58 | |
---|
59 | out.write("\n \n<html>\n\n<title>Job Configuration: JobId - "); |
---|
60 | out.print( jobId ); |
---|
61 | out.write("</title>\n\n<body>\n<h2>Job Configuration: JobId - "); |
---|
62 | out.print( jobId ); |
---|
63 | out.write("</h2><br>\n\n"); |
---|
64 | |
---|
65 | String jobFilePath = JobTracker.getLocalJobFilePath(JobID.forName(jobId)); |
---|
66 | FileInputStream jobFile = null; |
---|
67 | try { |
---|
68 | jobFile = new FileInputStream(jobFilePath); |
---|
69 | JobConf jobConf = new JobConf(jobFilePath); |
---|
70 | XMLUtils.transform( |
---|
71 | jobConf.getConfResourceAsInputStream("webapps/static/jobconf.xsl"), |
---|
72 | jobFile, out); |
---|
73 | } catch (Exception e) { |
---|
74 | out.println("Failed to retreive job configuration for job '" + jobId + "!"); |
---|
75 | out.println(e); |
---|
76 | } finally { |
---|
77 | if (jobFile != null) { |
---|
78 | try { |
---|
79 | jobFile.close(); |
---|
80 | } catch (IOException e) {} |
---|
81 | } |
---|
82 | } |
---|
83 | |
---|
84 | out.write("\n\n<br>\n"); |
---|
85 | |
---|
86 | out.println(ServletUtil.htmlFooter()); |
---|
87 | |
---|
88 | out.write('\n'); |
---|
89 | } catch (Throwable t) { |
---|
90 | if (!(t instanceof SkipPageException)){ |
---|
91 | out = _jspx_out; |
---|
92 | if (out != null && out.getBufferSize() != 0) |
---|
93 | out.clearBuffer(); |
---|
94 | if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); |
---|
95 | } |
---|
96 | } finally { |
---|
97 | if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); |
---|
98 | } |
---|
99 | } |
---|
100 | } |
---|