001 package org.apache.hadoop.hdfs.server.namenode;
002
003 import javax.servlet.*;
004 import javax.servlet.http.*;
005 import javax.servlet.jsp.*;
006 import org.apache.hadoop.util.ServletUtil;
007
008 public final class dfshealth_jsp extends org.apache.jasper.runtime.HttpJspBase
009 implements org.apache.jasper.runtime.JspSourceDependent {
010
011
012 //for java.io.Serializable
013 private static final long serialVersionUID = 1L;
014
015 private static java.util.List _jspx_dependants;
016
017 public Object getDependants() {
018 return _jspx_dependants;
019 }
020
021 public void _jspService(HttpServletRequest request, HttpServletResponse response)
022 throws java.io.IOException, ServletException {
023
024 JspFactory _jspxFactory = null;
025 PageContext pageContext = null;
026 HttpSession session = null;
027 ServletContext application = null;
028 ServletConfig config = null;
029 JspWriter out = null;
030 Object page = this;
031 JspWriter _jspx_out = null;
032 PageContext _jspx_page_context = null;
033
034
035 try {
036 _jspxFactory = JspFactory.getDefaultFactory();
037 response.setContentType("text/html; charset=UTF-8");
038 pageContext = _jspxFactory.getPageContext(this, request, response,
039 null, true, 8192, true);
040 _jspx_page_context = pageContext;
041 application = pageContext.getServletContext();
042 config = pageContext.getServletConfig();
043 session = pageContext.getSession();
044 out = pageContext.getOut();
045 _jspx_out = out;
046
047
048 /*
049 * Licensed to the Apache Software Foundation (ASF) under one
050 * or more contributor license agreements. See the NOTICE file
051 * distributed with this work for additional information
052 * regarding copyright ownership. The ASF licenses this file
053 * to you under the Apache License, Version 2.0 (the
054 * "License"); you may not use this file except in compliance
055 * with the License. You may obtain a copy of the License at
056 *
057 * http://www.apache.org/licenses/LICENSE-2.0
058 *
059 * Unless required by applicable law or agreed to in writing, software
060 * distributed under the License is distributed on an "AS IS" BASIS,
061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
062 * See the License for the specific language governing permissions and
063 * limitations under the License.
064 */
065
066
067 final NamenodeJspHelper.HealthJsp healthjsp = new NamenodeJspHelper.HealthJsp();
068 NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
069 FSNamesystem fsn = nn.getNamesystem();
070 String namenodeRole = nn.getRole().toString();
071 String namenodeLabel = nn.getNameNodeAddress().getHostName() + ":" + nn.getNameNodeAddress().getPort();
072
073 out.write("<!DOCTYPE html>\n<html>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hadoop.css\">\n<title>Hadoop ");
074 out.print(namenodeRole);
075 out.write(" ");
076 out.print(namenodeLabel);
077 out.write("</title>\n \n<body>\n<h1>");
078 out.print(namenodeRole);
079 out.write(' ');
080 out.write('\'');
081 out.print(namenodeLabel);
082 out.write("'</h1>\n");
083 out.print( NamenodeJspHelper.getVersionTable(fsn) );
084 out.write("<br />\n<b><a href=\"/nn_browsedfscontent.jsp\">Browse the filesystem</a></b><br>\n<b><a href=\"/logs/\">");
085 out.print(namenodeRole);
086 out.write(" Logs</a></b>\n\n<hr>\n<h3>Cluster Summary</h3>\n<b> ");
087 out.print( NamenodeJspHelper.getSecurityModeText());
088 out.write("</b>\n<b> ");
089 out.print( NamenodeJspHelper.getSafeModeText(fsn));
090 out.write("</b>\n<b> ");
091 out.print( NamenodeJspHelper.getInodeLimitText(fsn));
092 out.write("</b>\n");
093 out.print( NamenodeJspHelper.getCorruptFilesWarning(fsn));
094 healthjsp.generateHealthReport(out, nn, request);
095 out.write("<hr>\n");
096 healthjsp.generateConfReport(out, nn, request);
097
098 out.println(ServletUtil.htmlFooter());
099
100 } catch (Throwable t) {
101 if (!(t instanceof SkipPageException)){
102 out = _jspx_out;
103 if (out != null && out.getBufferSize() != 0)
104 out.clearBuffer();
105 if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
106 }
107 } finally {
108 if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
109 }
110 }
111 }