source: proiecte/HadoopJUnit/hadoop-0.20.1/build/src/org/apache/hadoop/mapred/jobconf_005fhistory_jsp.java @ 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: 3.2 KB
Line 
1package org.apache.hadoop.mapred;
2
3import javax.servlet.*;
4import javax.servlet.http.*;
5import javax.servlet.jsp.*;
6import javax.servlet.*;
7import javax.servlet.http.*;
8import java.io.*;
9import java.net.URL;
10import org.apache.hadoop.mapred.*;
11import org.apache.hadoop.fs.*;
12import org.apache.hadoop.util.*;
13
14public 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
90out.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}
Note: See TracBrowser for help on using the repository browser.