View Javadoc

1   // Autogenerated Jamon implementation
2   // /home/stack/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 25, 1
7   import java.util.*;
8   // 26, 1
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 27, 1
11  import org.apache.hadoop.hbase.HRegionInfo;
12  // 28, 1
13  import org.apache.hadoop.hbase.ServerName;
14  // 29, 1
15  import org.apache.hadoop.hbase.HBaseConfiguration;
16  // 30, 1
17  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
18  // 31, 1
19  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
20  // 32, 1
21  import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
22  
23  public class RSStatusTmplImpl
24    extends org.jamon.AbstractTemplateImpl
25    implements org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.Intf
26  
27  {
28    private final HRegionServer regionServer;
29    private final String filter;
30    private final String format;
31    protected static org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
32    {
33      if(! p_implData.getFilter__IsNotDefault())
34      {
35        p_implData.setFilter("general");
36      }
37      if(! p_implData.getFormat__IsNotDefault())
38      {
39        p_implData.setFormat("html");
40      }
41      return p_implData;
42    }
43    public RSStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
44    {
45      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
46      regionServer = p_implData.getRegionServer();
47      filter = p_implData.getFilter();
48      format = p_implData.getFormat();
49    }
50    
51    public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
52      throws java.io.IOException
53    {
54      // 34, 1
55      if (format.equals("json") )
56      {
57        // 34, 30
58        jamonWriter.write("\n  ");
59        // 35, 3
60        {
61          org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_6 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
62          __jamon__var_6.setFormat("json" );
63          __jamon__var_6.setFilter(filter);
64          __jamon__var_6.renderNoFlush(jamonWriter);
65        }
66        // 35, 68
67        jamonWriter.write("\n  ");
68        // 36, 3
69        return; 
70      }
71      // 37, 7
72      jamonWriter.write("\n");
73      // 38, 1
74      
75    ServerInfo serverInfo = ProtobufUtil.getServerInfo(regionServer);
76    ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
77    List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(regionServer);
78    int masterInfoPort = regionServer.getConfiguration().getInt("hbase.master.info.port", 16010);
79    MasterAddressTracker masterAddressTracker = regionServer.getMasterAddressTracker();
80    ServerName masterServerName = masterAddressTracker == null ? null
81      : masterAddressTracker.getMasterAddress();
82  
83      // 47, 1
84      jamonWriter.write("<!--[if IE]>\n<!DOCTYPE html>\n<![endif]-->\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>HBase Region Server: ");
85      // 54, 33
86      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
87      // 54, 63
88      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.min.css\" rel=\"stylesheet\">\n    <link href=\"/static/css/bootstrap-theme.min.css\" rel=\"stylesheet\">\n    <link href=\"/static/css/hbase.css\" rel=\"stylesheet\">\n  </head>\n\n  <body>\n\n    <div class=\"navbar  navbar-fixed-top navbar-default\">\n        <div class=\"container\">\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"/rs-status\"><img src=\"/static/hbase_logo_small.png\" alt=\"HBase Logo\"/></a>\n            </div>\n            <div class=\"collapse navbar-collapse\">\n                <ul class=\"nav navbar-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                ");
89      // 82, 17
90      if (HBaseConfiguration.isShowConfInServlet())
91      {
92        // 82, 64
93        jamonWriter.write("\n                <li><a href=\"/conf\">HBase Configuration</a></li>\n                ");
94      }
95      // 84, 23
96      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>RegionServer <small>");
97      // 94, 37
98      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName), jamonWriter);
99      // 94, 53
100     jamonWriter.write("</small></h1>\n        </div>\n    </div>\n    <div class=\"row\">\n\n    <section>\n    <h2>Server Metrics</h2>\n    ");
101     // 101, 5
102     {
103       org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl __jamon__var_7 = new org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl(this.getTemplateManager());
104       __jamon__var_7.renderNoFlush(jamonWriter, regionServer.getMetrics().getRegionServerWrapper());
105     }
106     // 101, 89
107     jamonWriter.write("\n    </section>\n\n    <section>\n    ");
108     // 105, 5
109     {
110       org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_8 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
111       __jamon__var_8.setFilter(filter );
112       __jamon__var_8.renderNoFlush(jamonWriter);
113     }
114     // 105, 53
115     jamonWriter.write("\n    </section>\n\n    <section>\n    <h2>Regions</h2>\n    ");
116     // 110, 5
117     {
118       org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl __jamon__var_9 = new org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl(this.getTemplateManager());
119       __jamon__var_9.renderNoFlush(jamonWriter, regionServer, onlineRegions);
120     }
121     // 110, 86
122     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>HBase Version</td>\n            <td>");
123     // 123, 17
124     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getVersion()), jamonWriter);
125     // 123, 76
126     jamonWriter.write(", r");
127     // 123, 79
128     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getRevision()), jamonWriter);
129     // 123, 139
130     jamonWriter.write("</td>\n            <td>HBase version and revision</td>\n        </tr>\n        <tr>\n            <td>HBase Compiled</td>\n            <td>");
131     // 128, 17
132     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getDate()), jamonWriter);
133     // 128, 73
134     jamonWriter.write(", ");
135     // 128, 75
136     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getUser()), jamonWriter);
137     // 128, 131
138     jamonWriter.write("</td>\n            <td>When HBase version was compiled and by whom</td>\n        </tr>\n        <tr>\n            <td>Zookeeper Quorum</td>\n            <td>");
139     // 133, 17
140     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(regionServer.getZooKeeper().getQuorum()), jamonWriter);
141     // 133, 62
142     jamonWriter.write("</td>\n            <td>Addresses of all registered ZK servers</td>\n        </tr>\n        <tr>\n            <td>Coprocessors</td>\n            <td>");
143     // 138, 17
144     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(java.util.Arrays.toString(regionServer.getCoprocessors())), jamonWriter);
145     // 138, 80
146     jamonWriter.write("</td>\n            <td>Coprocessors currently loaded by this regionserver</td>\n        </tr>\n        <tr>\n            <td>RS Start Time</td>\n            <td>");
147     // 143, 17
148     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(regionServer.getStartcode())), jamonWriter);
149     // 143, 60
150     jamonWriter.write("</td>\n            <td>Date stamp of when this region server was started</td>\n        </tr>\n        <tr>\n            <td>HBase Master</td>\n            <td>\n                ");
151     // 149, 17
152     if ((masterInfoPort < 0) )
153     {
154       // 149, 45
155       jamonWriter.write("\n                No hbase.master.info.port found\n                ");
156     }
157     // 151, 17
158     else if (masterServerName == null )
159     {
160       // 151, 53
161       jamonWriter.write("\n                No master found\n                ");
162     }
163     // 153, 17
164     else
165     {
166       // 153, 24
167       jamonWriter.write("\n                ");
168       // 154, 17
169       
170                 String host = masterServerName.getHostname() + ":" + masterInfoPort;
171                 String url = "//" + host + "/";
172                 
173       // 158, 17
174       jamonWriter.write("<a href=\"");
175       // 158, 26
176       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(url), jamonWriter);
177       // 158, 35
178       jamonWriter.write("\">");
179       // 158, 37
180       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(host), jamonWriter);
181       // 158, 47
182       jamonWriter.write("</a>\n                ");
183     }
184     // 159, 23
185     jamonWriter.write("\n            </td>\n            <td>Address of HBase 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");
186   }
187   
188   
189 }