[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.net.URL; |
---|
| 10 | import org.apache.hadoop.mapred.*; |
---|
| 11 | import org.apache.hadoop.fs.*; |
---|
| 12 | import org.apache.hadoop.util.*; |
---|
| 13 | |
---|
| 14 | public final class jobconf_005fhistory_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 | out.write('\n'); |
---|
| 51 | out.write('\n'); |
---|
| 52 | |
---|
| 53 | JobTracker tracker = (JobTracker) application.getAttribute("job.tracker"); |
---|
| 54 | String jobId = request.getParameter("jobid"); |
---|
| 55 | if (jobId == null) { |
---|
| 56 | out.println("<h2>Missing 'jobid' for fetching job configuration!</h2>"); |
---|
| 57 | return; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | out.write("\n \n<html>\n\n<title>Job Configuration: JobId - "); |
---|
| 61 | out.print( jobId ); |
---|
| 62 | out.write("</title>\n\n<body>\n<h2>Job Configuration: JobId - "); |
---|
| 63 | out.print( jobId ); |
---|
| 64 | out.write("</h2><br>\n\n"); |
---|
| 65 | |
---|
| 66 | Path logDir = new Path(request.getParameter("jobLogDir")); |
---|
| 67 | Path jobFilePath = new Path(logDir, |
---|
| 68 | request.getParameter("jobUniqueString") + "_conf.xml"); |
---|
| 69 | FileSystem fs = (FileSystem)request.getSession().getAttribute("fs"); |
---|
| 70 | FSDataInputStream jobFile = null; |
---|
| 71 | try { |
---|
| 72 | jobFile = fs.open(jobFilePath); |
---|
| 73 | JobConf jobConf = new JobConf(jobFilePath); |
---|
| 74 | XMLUtils.transform( |
---|
| 75 | jobConf.getConfResourceAsInputStream("webapps/static/jobconf.xsl"), |
---|
| 76 | jobFile, out); |
---|
| 77 | } catch (Exception e) { |
---|
| 78 | out.println("Failed to retreive job configuration for job '" + jobId + "!"); |
---|
| 79 | out.println(e); |
---|
| 80 | } finally { |
---|
| 81 | if (jobFile != null) { |
---|
| 82 | try { |
---|
| 83 | jobFile.close(); |
---|
| 84 | } catch (IOException e) {} |
---|
| 85 | } |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | out.write("\n\n<br>\n"); |
---|
| 89 | |
---|
| 90 | out.println(ServletUtil.htmlFooter()); |
---|
| 91 | |
---|
| 92 | out.write('\n'); |
---|
| 93 | } catch (Throwable t) { |
---|
| 94 | if (!(t instanceof SkipPageException)){ |
---|
| 95 | out = _jspx_out; |
---|
| 96 | if (out != null && out.getBufferSize() != 0) |
---|
| 97 | out.clearBuffer(); |
---|
| 98 | if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); |
---|
| 99 | } |
---|
| 100 | } finally { |
---|
| 101 | if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); |
---|
| 102 | } |
---|
| 103 | } |
---|
| 104 | } |
---|