public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write('\n'); out.write('\n'); out.write("\n<!DOCTYPE html>\n<html>\n<head>\n"); JspHelper.createTitle(out, request, request.getParameter("filename")); out.write("\n</head>\n<body onload=\"document.goto.dir.focus()\">\n"); Configuration conf = (Configuration) getServletContext().getAttribute(JspHelper.CURRENT_CONF); generateFileChunks(out, request, conf); out.write("\n<hr>\n"); generateFileDetails(out, request, conf); out.write("\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n"); out.println(ServletUtil.htmlFooter()); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write('\n'); out.write('\n'); out.write("\n\n\n\n<html>\n<head>\n"); JspHelper.createTitle(out, request, request.getParameter("filename")); out.write("\n</head>\n<body>\n<form action=\"/tail.jsp\" method=\"GET\">\n"); generateFileChunks(out, request); out.write("\n</form>\n<hr>\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n"); out.println(ServletUtil.htmlFooter()); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); } }
/** Create a redirection URL */ private URL createRedirectURL( String path, String encodedPath, HdfsFileStatus status, UserGroupInformation ugi, ClientProtocol nnproxy, HttpServletRequest request, String dt) throws IOException { String scheme = request.getScheme(); final LocatedBlocks blks = nnproxy.getBlockLocations(status.getFullPath(new Path(path)).toUri().getPath(), 0, 1); final Configuration conf = NameNodeHttpServer.getConfFromContext(getServletContext()); final DatanodeID host = pickSrcDatanode(blks, status, conf); final String hostname; if (host instanceof DatanodeInfo) { hostname = host.getHostName(); } else { hostname = host.getIpAddr(); } int port = "https".equals(scheme) ? host.getInfoSecurePort() : host.getInfoPort(); String dtParam = ""; if (dt != null) { dtParam = JspHelper.getDelegationTokenUrlParam(dt); } // Add namenode address to the url params NameNode nn = NameNodeHttpServer.getNameNodeFromContext(getServletContext()); String addr = nn.getNameNodeAddressHostPortString(); String addrParam = JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr); return new URL( scheme, hostname, port, "/streamFile" + encodedPath + '?' + "ugi=" + ServletUtil.encodeQueryValue(ugi.getShortUserName()) + dtParam + addrParam); }
/** Build a map from the query string, setting values and defaults. */ protected Map<String, String> buildRoot(HttpServletRequest request, XMLOutputter doc) { final String path = ServletUtil.getDecodedPath(request, "/listPaths"); final String exclude = request.getParameter("exclude") != null ? request.getParameter("exclude") : "\\..*\\.crc"; final String filter = request.getParameter("filter") != null ? request.getParameter("filter") : ".*"; final boolean recur = request.getParameter("recursive") != null && "yes".equals(request.getParameter("recursive")); Map<String, String> root = new HashMap<String, String>(); root.put("path", path); root.put("recursive", recur ? "yes" : "no"); root.put("filter", filter); root.put("exclude", exclude); root.put("time", df.get().format(new Date())); root.put("version", VersionInfo.getVersion()); return root; }
private void testDataNodeRedirect(Path path) throws IOException { // Create the file if (hdfs.exists(path)) { hdfs.delete(path, true); } FSDataOutputStream out = hdfs.create(path, (short) 1); out.writeBytes("0123456789"); out.close(); // Get the path's block location so we can determine // if we were redirected to the right DN. FileStatus status = hdfs.getFileStatus(path); BlockLocation[] locations = hdfs.getFileBlockLocations(status, 0, 10); String locationName = locations[0].getNames()[0]; // Connect to the NN to get redirected URL u = hftpFs.getNamenodeURL( "/data" + ServletUtil.encodePath(path.toUri().getPath()), "ugi=userx,groupy"); HttpURLConnection conn = (HttpURLConnection) u.openConnection(); HttpURLConnection.setFollowRedirects(true); conn.connect(); conn.getInputStream(); boolean checked = false; // Find the datanode that has the block according to locations // and check that the URL was redirected to this DN's info port for (DataNode node : cluster.getDataNodes()) { DatanodeRegistration dnR = node.dnRegistration; if (dnR.getName().equals(locationName)) { checked = true; assertEquals(dnR.getInfoPort(), conn.getURL().getPort()); } } assertTrue( "The test never checked that location of " + "the block and hftp desitnation are the same", checked); }
@SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/streamFile"); final String filename = JspHelper.validatePath(path); final String rawFilename = JspHelper.validatePath(rawPath); if (filename == null) { response.setContentType("text/plain"); PrintWriter out = response.getWriter(); out.print("Invalid input"); return; } Enumeration<String> reqRanges = request.getHeaders("Range"); if (reqRanges != null && !reqRanges.hasMoreElements()) { reqRanges = null; } DFSClient dfs; try { dfs = getDFSClient(request); } catch (InterruptedException e) { response.sendError(400, e.getMessage()); return; } DFSInputStream in = null; OutputStream out = null; try { in = dfs.open(filename); out = response.getOutputStream(); final long fileLen = in.getFileLength(); if (reqRanges != null) { List<InclusiveByteRange> ranges = InclusiveByteRange.satisfiableRanges(reqRanges, fileLen); StreamFile.sendPartialData(in, out, response, fileLen, ranges); } else { // No ranges, so send entire file response.setHeader("Content-Disposition", "attachment; filename=\"" + rawFilename + "\""); response.setContentType("application/octet-stream"); response.setHeader(CONTENT_LENGTH, "" + fileLen); StreamFile.copyFromOffset(in, out, 0L, fileLen); } in.close(); in = null; out.close(); out = null; dfs.close(); dfs = null; } catch (IOException ioe) { if (LOG.isDebugEnabled()) { LOG.debug("response.isCommitted()=" + response.isCommitted(), ioe); } throw ioe; } finally { IOUtils.cleanup(LOG, in); IOUtils.cleanup(LOG, out); IOUtils.cleanup(LOG, dfs); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write('\n'); JobTracker tracker = (JobTracker) application.getAttribute("job.tracker"); ClusterStatus status = tracker.getClusterStatus(); String trackerName = StringUtils.simpleHostname(tracker.getJobTrackerMachine()); out.write("\n<html>\n<head>\n<title>"); out.print(trackerName); out.write( " Hadoop Locality Statistics</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hadoop.css\">\n</head>\n<body>\n<h1>"); out.print(trackerName); out.write(" Hadoop Locality Statistics</h1>\n\n<b>State:</b> "); out.print(status.getJobTrackerState()); out.write("<br>\n<b>Started:</b> "); out.print(new Date(tracker.getStartTime())); out.write("<br>\n<b>Version:</b> "); out.print(VersionInfo.getVersion()); out.write(",\n r"); out.print(VersionInfo.getRevision()); out.write("<br>\n<b>Compiled:</b> "); out.print(VersionInfo.getDate()); out.write(" by\n "); out.print(VersionInfo.getUser()); out.write("<br>\n<b>Identifier:</b> "); out.print(tracker.getTrackerIdentifier()); out.write("<br>\n\n<hr>\n\n"); Collection<JobInProgress> jobs = new ArrayList<JobInProgress>(); jobs.addAll(tracker.completedJobs()); jobs.addAll(tracker.runningJobs()); jobs.addAll(tracker.failedJobs()); int dataLocalMaps = 0; int rackLocalMaps = 0; int totalMaps = 0; int totalReduces = 0; for (JobInProgress job : jobs) { Counters counters = job.getCounters(); dataLocalMaps += counters.getCounter(JobInProgress.Counter.DATA_LOCAL_MAPS); rackLocalMaps += counters.getCounter(JobInProgress.Counter.RACK_LOCAL_MAPS); totalMaps += counters.getCounter(JobInProgress.Counter.TOTAL_LAUNCHED_MAPS); totalReduces += counters.getCounter(JobInProgress.Counter.TOTAL_LAUNCHED_REDUCES); } int dataLocalMapPct = totalMaps == 0 ? 0 : (100 * dataLocalMaps) / totalMaps; int rackLocalMapPct = totalMaps == 0 ? 0 : (100 * rackLocalMaps) / totalMaps; int dataRackLocalMapPct = totalMaps == 0 ? 0 : (100 * (dataLocalMaps + rackLocalMaps)) / totalMaps; out.write("\n<p>\n<b>Data Local Maps:</b> "); out.print(dataLocalMaps); out.write(' '); out.write('('); out.print(dataLocalMapPct); out.write("%) <br>\n<b>Rack Local Maps:</b> "); out.print(rackLocalMaps); out.write(' '); out.write('('); out.print(rackLocalMapPct); out.write("%) <br>\n<b>Data or Rack Local:</b> "); out.print(dataLocalMaps + rackLocalMaps); out.write(' '); out.write('('); out.print(dataRackLocalMapPct); out.write("%) <br>\n<b>Total Maps:</b> "); out.print(totalMaps); out.write(" <br>\n<b>Total Reduces:</b> "); out.print(totalReduces); out.write(" <br>\n</p>\n\n"); out.println(ServletUtil.htmlFooter()); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }
static void generateFileDetails(JspWriter out, HttpServletRequest req, Configuration conf) throws IOException, InterruptedException { long startOffset = 0; int datanodePort; final Long blockId = JspHelper.validateLong(req.getParameter("blockId")); if (blockId == null) { out.print("Invalid input (blockId absent)"); return; } String tokenString = req.getParameter(JspHelper.DELEGATION_PARAMETER_NAME); UserGroupInformation ugi = JspHelper.getUGI(req, conf); String datanodePortStr = req.getParameter("datanodePort"); if (datanodePortStr == null) { out.print("Invalid input (datanodePort absent)"); return; } datanodePort = Integer.parseInt(datanodePortStr); final Long genStamp = JspHelper.validateLong(req.getParameter("genstamp")); if (genStamp == null) { out.print("Invalid input (genstamp absent)"); return; } String namenodeInfoPortStr = req.getParameter("namenodeInfoPort"); int namenodeInfoPort = -1; if (namenodeInfoPortStr != null) namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr); final String nnAddr = req.getParameter(JspHelper.NAMENODE_ADDRESS); if (nnAddr == null) { out.print(JspHelper.NAMENODE_ADDRESS + " url param is null"); return; } final int chunkSizeToView = JspHelper.string2ChunkSizeToView( req.getParameter("chunkSizeToView"), getDefaultChunkSize(conf)); String startOffsetStr = req.getParameter("startOffset"); if (startOffsetStr == null || Long.parseLong(startOffsetStr) < 0) startOffset = 0; else startOffset = Long.parseLong(startOffsetStr); String path = StringEscapeUtils.unescapeHtml(req.getParameter("filename")); if (path == null) { path = req.getPathInfo() == null ? "/" : req.getPathInfo(); } final String filename = JspHelper.validatePath(path); if (filename == null) { out.print("Invalid input"); return; } final String blockSizeStr = req.getParameter("blockSize"); if (blockSizeStr == null || blockSizeStr.length() == 0) { out.print("Invalid input"); return; } long blockSize = Long.parseLong(blockSizeStr); final DFSClient dfs = getDFSClient(ugi, nnAddr, conf); List<LocatedBlock> blocks = dfs.getNamenode().getBlockLocations(filename, 0, Long.MAX_VALUE).getLocatedBlocks(); // Add the various links for looking at the file contents // URL for downloading the full file String downloadUrl = "http://" + req.getServerName() + ":" + req.getServerPort() + "/streamFile" + ServletUtil.encodePath(filename) + JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, nnAddr, true) + JspHelper.getDelegationTokenUrlParam(tokenString); out.print("<a name=\"viewOptions\"></a>"); out.print("<a href=\"" + downloadUrl + "\">Download this file</a><br>"); DatanodeInfo chosenNode; // URL for TAIL LocatedBlock lastBlk = blocks.get(blocks.size() - 1); try { chosenNode = JspHelper.bestNode(lastBlk, conf); } catch (IOException e) { out.print(e.toString()); dfs.close(); return; } String fqdn = canonicalize(chosenNode.getIpAddr()); String tailUrl = "http://" + fqdn + ":" + chosenNode.getInfoPort() + "/tail.jsp?filename=" + URLEncoder.encode(filename, "UTF-8") + "&namenodeInfoPort=" + namenodeInfoPort + "&chunkSizeToView=" + chunkSizeToView + JspHelper.getDelegationTokenUrlParam(tokenString) + JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, nnAddr) + "&referrer=" + URLEncoder.encode(req.getRequestURL() + "?" + req.getQueryString(), "UTF-8"); out.print("<a href=\"" + tailUrl + "\">Tail this file</a><br>"); out.print("<form action=\"/browseBlock.jsp\" method=GET>"); out.print("<b>Chunk size to view (in bytes, up to file's DFS block size): </b>"); out.print("<input type=\"hidden\" name=\"blockId\" value=\"" + blockId + "\">"); out.print("<input type=\"hidden\" name=\"blockSize\" value=\"" + blockSize + "\">"); out.print("<input type=\"hidden\" name=\"startOffset\" value=\"" + startOffset + "\">"); out.print("<input type=\"hidden\" name=\"filename\" value=\"" + filename + "\">"); out.print("<input type=\"hidden\" name=\"genstamp\" value=\"" + genStamp + "\">"); out.print("<input type=\"hidden\" name=\"datanodePort\" value=\"" + datanodePort + "\">"); out.print( "<input type=\"hidden\" name=\"namenodeInfoPort\" value=\"" + namenodeInfoPort + "\">"); out.print( "<input type=\"hidden\" name=\"" + JspHelper.NAMENODE_ADDRESS + "\" value=\"" + nnAddr + "\">"); out.print( "<input type=\"text\" name=\"chunkSizeToView\" value=" + chunkSizeToView + " size=10 maxlength=10>"); out.print(" <input type=\"submit\" name=\"submit\" value=\"Refresh\">"); out.print("</form>"); out.print("<hr>"); out.print("<a name=\"blockDetails\"></a>"); out.print("<B>Total number of blocks: " + blocks.size() + "</B><br>"); // generate a table and dump the info out.println("\n<table>"); String nnCanonicalName = canonicalize(nnAddr); for (LocatedBlock cur : blocks) { out.print("<tr>"); final String blockidstring = Long.toString(cur.getBlock().getBlockId()); blockSize = cur.getBlock().getNumBytes(); out.print("<td>" + blockidstring + ":</td>"); DatanodeInfo[] locs = cur.getLocations(); for (int j = 0; j < locs.length; j++) { String datanodeAddr = locs[j].getXferAddr(); datanodePort = locs[j].getXferPort(); fqdn = canonicalize(locs[j].getIpAddr()); String blockUrl = "http://" + fqdn + ":" + locs[j].getInfoPort() + "/browseBlock.jsp?blockId=" + blockidstring + "&blockSize=" + blockSize + "&filename=" + URLEncoder.encode(filename, "UTF-8") + "&datanodePort=" + datanodePort + "&genstamp=" + cur.getBlock().getGenerationStamp() + "&namenodeInfoPort=" + namenodeInfoPort + "&chunkSizeToView=" + chunkSizeToView + JspHelper.getDelegationTokenUrlParam(tokenString) + JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, nnAddr); String blockInfoUrl = "http://" + nnCanonicalName + ":" + namenodeInfoPort + "/block_info_xml.jsp?blockId=" + blockidstring; out.print( "<td> </td><td><a href=\"" + blockUrl + "\">" + datanodeAddr + "</a></td><td>" + "<a href=\"" + blockInfoUrl + "\">View Block Info</a></td>"); } out.println("</tr>"); } out.println("</table>"); out.print("<hr>"); out.print( "<br><a href=\"http://" + nnCanonicalName + ":" + namenodeInfoPort + "/dfshealth.jsp\">Go back to DFS home</a>"); dfs.close(); }
/** * Service a GET request as described below. Request: {@code GET * http://<nn>:<port>/listPaths[/<path>][<?option>[&option]*] HTTP/1.1 } * * <p>Where <i>option</i> (default) in: recursive ("no") filter (".*") exclude * ("\..*\.crc") * * <p>Response: A flat list of files/directories in the following format: {@code <listing * path="..." recursive="(yes|no)" filter="..." time="yyyy-MM-dd hh:mm:ss UTC" version="..."> * <directory path="..." modified="yyyy-MM-dd hh:mm:ss"/> <file path="..." * modified="yyyy-MM-dd'T'hh:mm:ssZ" accesstime="yyyy-MM-dd'T'hh:mm:ssZ" blocksize="..." * replication="..." size="..."/> </listing> } */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final PrintWriter out = response.getWriter(); final XMLOutputter doc = new XMLOutputter(out, "UTF-8"); final Map<String, String> root = buildRoot(request, doc); final String path = root.get("path"); final String filePath = ServletUtil.getDecodedPath(request, "/listPaths"); try { final boolean recur = "yes".equals(root.get("recursive")); final Pattern filter = Pattern.compile(root.get("filter")); final Pattern exclude = Pattern.compile(root.get("exclude")); final Configuration conf = (Configuration) getServletContext().getAttribute(JspHelper.CURRENT_CONF); getUGI(request, conf) .doAs( new PrivilegedExceptionAction<Void>() { @Override public Void run() throws IOException { ClientProtocol nn = createNameNodeProxy(); doc.declaration(); doc.startTag("listing"); for (Map.Entry<String, String> m : root.entrySet()) { doc.attribute(m.getKey(), m.getValue()); } HdfsFileStatus base = nn.getFileInfo(filePath); if ((base != null) && base.isDir()) { writeInfo(path, base, doc); } Stack<String> pathstack = new Stack<String>(); pathstack.push(path); while (!pathstack.empty()) { String p = pathstack.pop(); try { byte[] lastReturnedName = HdfsFileStatus.EMPTY_NAME; DirectoryListing thisListing; do { assert lastReturnedName != null; thisListing = nn.getListing(p, lastReturnedName); if (thisListing == null) { if (lastReturnedName.length == 0) { LOG.warn("ListPathsServlet - Path " + p + " does not exist"); } break; } HdfsFileStatus[] listing = thisListing.getPartialListing(); for (HdfsFileStatus i : listing) { String localName = i.getLocalName(); if (exclude.matcher(localName).matches() || !filter.matcher(localName).matches()) { continue; } if (recur && i.isDir()) { pathstack.push(new Path(p, localName).toUri().getPath()); } writeInfo(p, i, doc); } lastReturnedName = thisListing.getLastName(); } while (thisListing.hasMore()); } catch (IOException re) { writeXml(re, p, doc); } } return null; } }); } catch (IOException ioe) { writeXml(ioe, path, doc); } catch (InterruptedException e) { LOG.warn("ListPathServlet encountered InterruptedException", e); response.sendError(400, e.getMessage()); } finally { if (doc != null) { doc.endDocument(); } if (out != null) { out.close(); } } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ out.write('\n'); out.write('\n'); out.write('\n'); final NamenodeJspHelper.NodeListJsp nodelistjsp = new NamenodeJspHelper.NodeListJsp(); NameNode nn = (NameNode) application.getAttribute("name.node"); String namenodeRole = nn.getRole().toString(); FSNamesystem fsn = nn.getNamesystem(); String namenodeLabel = nn.getNameNodeAddress().getHostName() + ":" + nn.getNameNodeAddress().getPort(); out.write( "\n\n<html>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hadoop.css\">\n<title>Hadoop "); out.print(namenodeRole); out.write(' '); out.print(namenodeLabel); out.write("</title>\n \n<body>\n<h1>"); out.print(namenodeRole); out.write(' '); out.write('\''); out.print(namenodeLabel); out.write("'</h1>\n"); out.print(NamenodeJspHelper.getVersionTable(fsn)); out.write( "\n<br />\n<b><a href=\"/nn_browsedfscontent.jsp\">Browse the filesystem</a></b><br>\n<b><a href=\"/logs/\">"); out.print(namenodeRole); out.write( " Logs</a></b><br>\n<b><a href=/dfshealth.jsp> Go back to DFS home</a></b>\n<hr>\n"); nodelistjsp.generateNodesList(out, nn, request); out.write('\n'); out.write('\n'); out.println(ServletUtil.htmlFooter()); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write('\n'); out.write('\n'); JobTracker tracker = (JobTracker) application.getAttribute("job.tracker"); String trackerName = StringUtils.simpleHostname(tracker.getJobTrackerMachine()); out.write('\n'); out.write('\n'); out.write('\n'); String jobId = request.getParameter("jobid"); if (jobId == null) { out.println("<h2>Missing 'jobid'!</h2>"); return; } JobID jobIdObj = JobID.forName(jobId); String kind = request.getParameter("kind"); String cause = request.getParameter("cause"); out.write("\n\n<html>\n<title>Hadoop "); out.print(jobId); out.write(" failures on "); out.print(trackerName); out.write("</title>\n<body>\n<h1>Hadoop <a href=\"jobdetails.jsp?jobid="); out.print(jobId); out.write('"'); out.write('>'); out.print(jobId); out.write("</a>\nfailures on <a href=\"jobtracker.jsp\">"); out.print(trackerName); out.write("</a></h1>\n\n"); printFailures(out, tracker, jobIdObj, kind, cause); out.write("\n\n<hr>\n<a href=\"jobtracker.jsp\">Go back to JobTracker</a><br>\n"); out.println(ServletUtil.htmlFooter()); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }