001// Autogenerated Jamon implementation
002// /Users/peter.somogyi/Cloudera/repos/hbase-upstream/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
003
004package org.apache.hadoop.hbase.tmpl.regionserver;
005
006// 27, 1
007import java.util.*;
008// 28, 1
009import org.apache.hadoop.hbase.regionserver.HRegionServer;
010// 29, 1
011import org.apache.hadoop.hbase.client.RegionInfo;
012// 30, 1
013import org.apache.hadoop.hbase.ServerName;
014// 31, 1
015import org.apache.hadoop.hbase.HBaseConfiguration;
016// 32, 1
017import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
018// 33, 1
019import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo;
020// 34, 1
021import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
022
023public class RSStatusTmplImpl
024  extends org.jamon.AbstractTemplateImpl
025  implements org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.Intf
026
027{
028  private final HRegionServer regionServer;
029  private final String bcn;
030  private final String bcv;
031  private final String filter;
032  private final String format;
033  protected static org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
034  {
035    if(! p_implData.getBcn__IsNotDefault())
036    {
037      p_implData.setBcn("");
038    }
039    if(! p_implData.getBcv__IsNotDefault())
040    {
041      p_implData.setBcv("");
042    }
043    if(! p_implData.getFilter__IsNotDefault())
044    {
045      p_implData.setFilter("general");
046    }
047    if(! p_implData.getFormat__IsNotDefault())
048    {
049      p_implData.setFormat("html");
050    }
051    return p_implData;
052  }
053  public RSStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
054  {
055    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
056    regionServer = p_implData.getRegionServer();
057    bcn = p_implData.getBcn();
058    bcv = p_implData.getBcv();
059    filter = p_implData.getFilter();
060    format = p_implData.getFormat();
061  }
062  
063  @Override public void renderNoFlush(final java.io.Writer jamonWriter)
064    throws java.io.IOException
065  {
066    // 37, 1
067    if (format.equals("json") && bcn != null && bcn.length() > 0  )
068    {
069      // 37, 66
070      jamonWriter.write("\n  ");
071      // 38, 3
072      {
073        org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl __jamon__var_7 = new org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl(this.getTemplateManager());
074        __jamon__var_7.renderNoFlush(jamonWriter, regionServer.getCacheConfig(), regionServer.getConfiguration(), bcn, bcv);
075      }
076      // 38, 136
077      jamonWriter.write("\n  ");
078      // 39, 3
079      return; 
080    }
081    // 40, 1
082    else if (format.equals("json") )
083    {
084      // 40, 34
085      jamonWriter.write("\n  ");
086      // 41, 3
087      {
088        org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_8 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
089        __jamon__var_8.setFilter(filter);
090        __jamon__var_8.setFormat("json" );
091        __jamon__var_8.renderNoFlush(jamonWriter);
092      }
093      // 41, 68
094      jamonWriter.write("\n  ");
095      // 42, 3
096      return; 
097    }
098    // 43, 7
099    jamonWriter.write("\n");
100    // 44, 1
101    
102  ServerInfo serverInfo = ProtobufUtil.getServerInfo(null, regionServer.getRSRpcServices());
103  ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
104  List<RegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(regionServer.getRSRpcServices());
105  MasterAddressTracker masterAddressTracker = regionServer.getMasterAddressTracker();
106  ServerName masterServerName = masterAddressTracker == null ? null
107    : masterAddressTracker.getMasterAddress();
108  int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort();
109
110    // 53, 1
111    jamonWriter.write("<!DOCTYPE html>\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>HBase Region Server: ");
112    // 58, 33
113    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
114    // 58, 63
115    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-fluid\">\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=\"/processRS.jsp\">Process Metrics</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                ");
116    // 87, 17
117    if (HBaseConfiguration.isShowConfInServlet())
118    {
119      // 87, 64
120      jamonWriter.write("\n                <li><a href=\"/conf\">HBase Configuration</a></li>\n                ");
121    }
122    // 89, 23
123    jamonWriter.write("\n            </ul>\n          </div><!--/.nav-collapse -->\n        </div>\n      </div>\n    </div>\n\n  <div class=\"container-fluid content\">\n    <div class=\"row inner_header\">\n        <div class=\"page-header\">\n            <h1>RegionServer <small>");
124    // 99, 37
125    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName), jamonWriter);
126    // 99, 53
127    jamonWriter.write("</small></h1>\n        </div>\n    </div>\n    <div class=\"row\">\n\n    <section>\n    <h2>Server Metrics</h2>\n    ");
128    // 106, 5
129    {
130      org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl __jamon__var_9 = new org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl(this.getTemplateManager());
131      __jamon__var_9.renderNoFlush(jamonWriter, regionServer.getRegionServerMetrics().getRegionServerWrapper(), regionServer.getRpcServer().getMetrics().getHBaseServerWrapper());
132    }
133    // 107, 89
134    jamonWriter.write("\n    </section>\n\n    <section>\n    <h2>Block Cache</h2>\n    ");
135    // 112, 5
136    {
137      org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl __jamon__var_10 = new org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl(this.getTemplateManager());
138      __jamon__var_10.renderNoFlush(jamonWriter, regionServer.getCacheConfig(), regionServer.getConfiguration() );
139    }
140    // 112, 112
141    jamonWriter.write("\n    </section>\n\n    <section>\n    ");
142    // 116, 5
143    {
144      org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_11 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
145      __jamon__var_11.setFilter(filter );
146      __jamon__var_11.renderNoFlush(jamonWriter);
147    }
148    // 116, 53
149    jamonWriter.write("\n    </section>\n\n    <section>\n    <h2>Regions</h2>\n    ");
150    // 121, 5
151    {
152      org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl __jamon__var_12 = new org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl(this.getTemplateManager());
153      __jamon__var_12.renderNoFlush(jamonWriter, regionServer, onlineRegions);
154    }
155    // 121, 86
156    jamonWriter.write("\n    </section>\n\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>");
157    // 135, 17
158    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getVersion()), jamonWriter);
159    // 135, 76
160    jamonWriter.write(", revision=");
161    // 135, 87
162    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getRevision()), jamonWriter);
163    // 135, 147
164    jamonWriter.write("</td>\n            <td>HBase version and revision</td>\n        </tr>\n        <tr>\n            <td>HBase Compiled</td>\n            <td>");
165    // 140, 17
166    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getDate()), jamonWriter);
167    // 140, 73
168    jamonWriter.write(", ");
169    // 140, 75
170    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getUser()), jamonWriter);
171    // 140, 131
172    jamonWriter.write("</td>\n            <td>When HBase version was compiled and by whom</td>\n        </tr>\n        <tr>\n            <td>HBase Source Checksum</td>\n            <td>");
173    // 145, 17
174    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getSrcChecksum()), jamonWriter);
175    // 145, 80
176    jamonWriter.write("</td>\n            <td>HBase source MD5 checksum</td>\n        </tr>\n        <tr>\n            <td>Hadoop Version</td>\n            <td>");
177    // 150, 17
178    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getVersion()), jamonWriter);
179    // 150, 70
180    jamonWriter.write(", revision=");
181    // 150, 81
182    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getRevision()), jamonWriter);
183    // 150, 135
184    jamonWriter.write("</td>\n            <td>Hadoop version and revision</td>\n        </tr>\n        <tr>\n            <td>Hadoop Compiled</td>\n            <td>");
185    // 155, 17
186    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getDate()), jamonWriter);
187    // 155, 67
188    jamonWriter.write(", ");
189    // 155, 69
190    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getUser()), jamonWriter);
191    // 155, 119
192    jamonWriter.write("</td>\n            <td>When Hadoop version was compiled and by whom</td>\n        </tr>\n        <tr>\n            <td>Hadoop Source Checksum</td>\n            <td>");
193    // 160, 17
194    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getSrcChecksum()), jamonWriter);
195    // 160, 74
196    jamonWriter.write("</td>\n            <td>Hadoop source MD5 checksum</td>\n        </tr>\n        <tr>\n            <td>ZooKeeper Client Version</td>\n            <td>");
197    // 165, 17
198    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.zookeeper.Version.getVersion()), jamonWriter);
199    // 165, 64
200    jamonWriter.write(", revision=");
201    // 165, 75
202    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.zookeeper.Version.getRevision()), jamonWriter);
203    // 165, 123
204    jamonWriter.write("</td>\n            <td>ZooKeeper client version and revision</td>\n        </tr>\n        <tr>\n            <td>ZooKeeper Client Compiled</td>\n            <td>");
205    // 170, 17
206    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.zookeeper.Version.getBuildDate()), jamonWriter);
207    // 170, 66
208    jamonWriter.write("</td>\n            <td>When ZooKeeper client version was compiled</td>\n        </tr>\n        <tr>\n            <td>ZooKeeper Quorum</td>\n            <td>");
209    // 175, 17
210    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(regionServer.getZooKeeper().getQuorum()), jamonWriter);
211    // 175, 62
212    jamonWriter.write("</td>\n            <td>Addresses of all registered ZK servers</td>\n        </tr>\n        <tr>\n            <td>Coprocessors</td>\n            <td>");
213    // 180, 17
214    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(java.util.Arrays.toString(regionServer.getRegionServerCoprocessors())), jamonWriter);
215    // 180, 92
216    jamonWriter.write("</td>\n            <td>Coprocessors currently loaded by this regionserver</td>\n        </tr>\n        <tr>\n            <td>RS Start Time</td>\n            <td>");
217    // 185, 17
218    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(regionServer.getStartcode())), jamonWriter);
219    // 185, 60
220    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                ");
221    // 191, 17
222    if (masterServerName == null )
223    {
224      // 191, 49
225      jamonWriter.write("\n                No master found\n                ");
226    }
227    // 193, 17
228    else
229    {
230      // 193, 24
231      jamonWriter.write("\n                ");
232      // 194, 17
233      
234                String host = masterServerName.getHostname() + ":" + infoPort;
235                String url = "//" + host + "/master-status";
236                
237      // 198, 17
238      jamonWriter.write("<a href=\"");
239      // 198, 26
240      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(url), jamonWriter);
241      // 198, 35
242      jamonWriter.write("\">");
243      // 198, 37
244      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(host), jamonWriter);
245      // 198, 47
246      jamonWriter.write("</a>\n                ");
247    }
248    // 199, 23
249    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");
250  }
251  
252  
253}