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 dfsnodelist_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.NodeListJsp nodelistjsp = new NamenodeJspHelper.NodeListJsp();
068    NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
069    String namenodeRole = nn.getRole().toString();
070    FSNamesystem fsn = nn.getNamesystem();
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("&nbsp;");
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><br>\n<b><a href=/dfshealth.jsp> Go back to DFS home</a></b>\n<hr>\n");
087     nodelistjsp.generateNodesList(application, out, request); 
088    
089    out.println(ServletUtil.htmlFooter());
090    
091        } catch (Throwable t) {
092          if (!(t instanceof SkipPageException)){
093            out = _jspx_out;
094            if (out != null && out.getBufferSize() != 0)
095              out.clearBuffer();
096            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
097          }
098        } finally {
099          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
100        }
101      }
102    }