Package com.alibaba.wasp.tmpl.fserver

Source Code of com.alibaba.wasp.tmpl.fserver.FSStatusTmplImpl

// Autogenerated Jamon implementation
// /Users/jaywong/data/opensource/hadoop/wasp/github/wasp/src/main/jamon/./com/alibaba/wasp/tmpl/fserver/FSStatusTmpl.jamon

package com.alibaba.wasp.tmpl.fserver;

// 25, 1
import java.util.*;
// 26, 1
import com.alibaba.wasp.fserver.FServer;
// 27, 1
import org.apache.hadoop.hbase.util.Bytes;
// 28, 1
import com.alibaba.wasp.EntityGroupInfo;
// 29, 1
import com.alibaba.wasp.ServerName;
// 30, 1
import com.alibaba.wasp.conf.WaspConfiguration;
// 31, 1
import com.alibaba.wasp.protobuf.ProtobufUtil;
// 32, 1
import com.alibaba.wasp.protobuf.generated.FServerAdminProtos.ServerInfo;
// 33, 1
import com.alibaba.wasp.EntityGroupLoad;

public class FSStatusTmplImpl
  extends org.jamon.AbstractTemplateImpl
  implements com.alibaba.wasp.tmpl.fserver.FSStatusTmpl.Intf

{
  private final FServer fserver;
  private final String filter;
  private final String format;
  protected static com.alibaba.wasp.tmpl.fserver.FSStatusTmpl.ImplData __jamon_setOptionalArguments(com.alibaba.wasp.tmpl.fserver.FSStatusTmpl.ImplData p_implData)
  {
    if(! p_implData.getFilter__IsNotDefault())
    {
      p_implData.setFilter("general");
    }
    if(! p_implData.getFormat__IsNotDefault())
    {
      p_implData.setFormat("html");
    }
    return p_implData;
  }
  public FSStatusTmplImpl(org.jamon.TemplateManager p_templateManager, com.alibaba.wasp.tmpl.fserver.FSStatusTmpl.ImplData p_implData)
  {
    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
    fserver = p_implData.getFserver();
    filter = p_implData.getFilter();
    format = p_implData.getFormat();
  }
 
  public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 35, 1
    if (format.equals("json") )
    {
      // 35, 30
      jamonWriter.write("\n  ");
      // 36, 3
      {
        com.alibaba.wasp.tmpl.common.TaskMonitorTmpl __jamon__var_0 = new com.alibaba.wasp.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
        __jamon__var_0.setFormat("json" );
        __jamon__var_0.setFilter(filter);
        __jamon__var_0.renderNoFlush(jamonWriter);
      }
      // 36, 68
      jamonWriter.write("\n  ");
      // 37, 3
      return;
    }
    // 38, 7
    jamonWriter.write("\n");
    // 39, 1
   
  ServerInfo serverInfo = ProtobufUtil.getServerInfo(fserver);
  ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
  List<EntityGroupInfo> onlineEntityGroups = ProtobufUtil.getOnlineEntityGroups(fserver);
  int masterInfoPort = fserver.getConfiguration().getInt("wasp.master.info.port", 60080);
  String masterHost = fserver.getMaster().getHostname();

    // 46, 1
    jamonWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>Wasp FServer: ");
    // 50, 26
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
    // 50, 56
    jamonWriter.write("</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta name=\"description\" content=\"\">\n\n    <link href=\"/static/css/bootstrap.css\" rel=\"stylesheet\">\n    <link href=\"/static/css/wasp.css\" rel=\"stylesheet\">\n    <link href=\"/static/css/bootstrap-responsive.css\" rel=\"stylesheet\">\n    <!--[if lt IE 9]>\n      <script src=\"/static/js/html5shiv.js\"></script>\n    <![endif]-->\n  </head>\n\n  <body>\n\n    <div class=\"navbar navbar-fixed-top\">\n      <div class=\"navbar-inner\">\n        <div class=\"container\">\n          <a class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\".nav-collapse\">\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </a>\n          <a class=\"brand\" href=\"/fs-status\"><img src=\"/static/wasp_logo_small.jpg\" alt=\"HBase Logo\"/></a>\n          <div class=\"nav-collapse\">\n            <ul class=\"nav\">\n                <li class=\"active\"><a href=\"/\">Home</a></li>\n                <li><a href=\"/logs/\">Local logs</a></li>\n                <li><a href=\"/logLevel\">Log Level</a></li>\n                <li><a href=\"/dump\">Debug dump</a></li>\n                <li><a href=\"/jmx\">Metrics Dump</a></li>\n                ");
    // 80, 17
    if (WaspConfiguration.isShowConfInServlet())
    {
      // 80, 63
      jamonWriter.write("\n                <li><a href=\"/conf\">Wasp Configuration</a></li>\n                ");
    }
    // 82, 23
    jamonWriter.write("\n            </ul>\n          </div><!--/.nav-collapse -->\n        </div>\n      </div>\n    </div>\n\n<div class=\"container\">\n    <div class=\"row inner_header\">\n        <div class=\"page-header\">\n            <h1>fserver <small>");
    // 92, 32
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
    // 92, 62
    jamonWriter.write("</small></h1>\n        </div>\n    </div>\n    <div class=\"row\">\n\n    <section>\n    <h2>Server Metrics</h2>\n    ");
    // 99, 5
    {
      com.alibaba.wasp.tmpl.fserver.ServerMetricsTmpl __jamon__var_1 = new com.alibaba.wasp.tmpl.fserver.ServerMetricsTmpl(this.getTemplateManager());
      __jamon__var_1.renderNoFlush(jamonWriter, fserver.getMetrics().getFServerWrapper());
    }
    // 99, 79
    jamonWriter.write("\n    </section>\n\n   <!-- <section>\n    ");
    // 103, 5
    {
      com.alibaba.wasp.tmpl.common.TaskMonitorTmpl __jamon__var_2 = new com.alibaba.wasp.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
      __jamon__var_2.setFilter(filter );
      __jamon__var_2.renderNoFlush(jamonWriter);
    }
    // 103, 53
    jamonWriter.write("\n    </section> -->\n\n    <section>\n    <h2>EntityGroups</h2>\n    ");
    // 108, 5
    {
      com.alibaba.wasp.tmpl.fserver.EntityGroupListTmpl __jamon__var_3 = new com.alibaba.wasp.tmpl.fserver.EntityGroupListTmpl(this.getTemplateManager());
      __jamon__var_3.renderNoFlush(jamonWriter, fserver, onlineEntityGroups);
    }
    // 108, 91
    jamonWriter.write("\n    </section>\n\n    <section>\n    <h2>Software Attributes</h2>\n    <table id=\"attributes_table\" class=\"table table-striped\">\n        <tr>\n            <th>Attribute Name</th>\n            <th>Value</th>\n            <th>Description</th>\n        </tr>\n        <tr>\n            <td>Wasp Version</td>\n            <td>");
    // 121, 17
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(com.alibaba.wasp.util.VersionInfo.getVersion()), jamonWriter);
    // 121, 69
    jamonWriter.write(", r");
    // 121, 72
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(com.alibaba.wasp.util.VersionInfo.getRevision()), jamonWriter);
    // 121, 125
    jamonWriter.write("</td>\n            <td>Wasp version and revision</td>\n        </tr>\n        <tr>\n            <td>Wasp Compiled</td>\n            <td>");
    // 126, 17
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(com.alibaba.wasp.util.VersionInfo.getDate()), jamonWriter);
    // 126, 66
    jamonWriter.write(", ");
    // 126, 68
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(com.alibaba.wasp.util.VersionInfo.getUser()), jamonWriter);
    // 126, 117
    jamonWriter.write("</td>\n            <td>When Wasp version was compiled and by whom</td>\n        </tr>\n        <tr>\n            <td>Zookeeper Quorum</td>\n            <td>");
    // 131, 17
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(fserver.getZooKeeper().getQuorum()), jamonWriter);
    // 131, 57
    jamonWriter.write("</td>\n            <td>Addresses of all registered ZK servers</td>\n        </tr>\n        <tr>\n            <td>FS Start Time</td>\n            <td>");
    // 136, 17
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(fserver.getStartcode())), jamonWriter);
    // 136, 55
    jamonWriter.write("</td>\n            <td>Date stamp of when this fserver was started</td>\n        </tr>\n        <tr>\n            <td>Wasp Master</td>\n            <td>\n                ");
    // 142, 17
    if ((masterInfoPort < 0) )
    {
      // 142, 45
      jamonWriter.write("\n                No wasp.master.info.port found\n                ");
    }
    // 144, 17
    else
    {
      // 144, 24
      jamonWriter.write("\n                ");
      // 145, 17
     
                String host = masterHost + ":" + masterInfoPort;
                String url = "http://" + host + "/master-status";
               
      // 149, 17
      jamonWriter.write("<a href=\"");
      // 149, 26
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(url), jamonWriter);
      // 149, 35
      jamonWriter.write("\">");
      // 149, 37
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(host), jamonWriter);
      // 149, 47
      jamonWriter.write("</a>\n                ");
    }
    // 150, 23
    jamonWriter.write("\n            </td>\n            <td>Address of Wasp Master</td>\n        </tr>\n    </table>\n    </section>\n    </div>\n</div>\n<script src=\"/static/js/jquery.min.js\" type=\"text/javascript\"></script>\n<script src=\"/static/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n<script src=\"/static/js/tab.js\" type=\"text/javascript\"></script>\n</body>\n</html>\n");
  }
 
 
}
TOP

Related Classes of com.alibaba.wasp.tmpl.fserver.FSStatusTmplImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.