View Javadoc

1   // Autogenerated Jamon implementation
2   // /Users/stack/checkouts/hbase.git.commit/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 27, 1
7   import java.util.*;
8   // 28, 1
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 29, 1
11  import org.apache.hadoop.hbase.HRegionInfo;
12  // 30, 1
13  import org.apache.hadoop.hbase.ServerName;
14  // 31, 1
15  import org.apache.hadoop.hbase.HBaseConfiguration;
16  // 32, 1
17  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
18  // 33, 1
19  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
20  // 34, 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 bcv;
30    private final String filter;
31    private final String format;
32    private final String bcn;
33    protected static org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
34    {
35      if(! p_implData.getBcv__IsNotDefault())
36      {
37        p_implData.setBcv("");
38      }
39      if(! p_implData.getFilter__IsNotDefault())
40      {
41        p_implData.setFilter("general");
42      }
43      if(! p_implData.getFormat__IsNotDefault())
44      {
45        p_implData.setFormat("html");
46      }
47      if(! p_implData.getBcn__IsNotDefault())
48      {
49        p_implData.setBcn("");
50      }
51      return p_implData;
52    }
53    public RSStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
54    {
55      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
56      regionServer = p_implData.getRegionServer();
57      bcv = p_implData.getBcv();
58      filter = p_implData.getFilter();
59      format = p_implData.getFormat();
60      bcn = p_implData.getBcn();
61    }
62    
63    public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
64      throws java.io.IOException
65    {
66      // 37, 1
67      if (format.equals("json") && bcn != null && bcn.length() > 0  )
68      {
69        // 37, 66
70        jamonWriter.write("\n  ");
71        // 38, 3
72        {
73          org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl __jamon__var_6 = new org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl(this.getTemplateManager());
74          __jamon__var_6.renderNoFlush(jamonWriter, regionServer.getCacheConfig(), regionServer.getConfiguration(), bcn, bcv);
75        }
76        // 38, 136
77        jamonWriter.write("\n  ");
78        // 39, 3
79        return; 
80      }
81      // 40, 1
82      else if (format.equals("json") )
83      {
84        // 40, 34
85        jamonWriter.write("\n  ");
86        // 41, 3
87        {
88          org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_7 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
89          __jamon__var_7.setFilter(filter);
90          __jamon__var_7.setFormat("json" );
91          __jamon__var_7.renderNoFlush(jamonWriter);
92        }
93        // 41, 68
94        jamonWriter.write("\n  ");
95        // 42, 3
96        return; 
97      }
98      // 43, 7
99      jamonWriter.write("\n");
100     // 44, 1
101     
102   ServerInfo serverInfo = ProtobufUtil.getServerInfo(regionServer.getRSRpcServices());
103   ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
104   List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(regionServer.getRSRpcServices());
105   int infoPort = regionServer.getConfiguration().getInt("hbase.master.info.port", 16010);
106   MasterAddressTracker masterAddressTracker = regionServer.getMasterAddressTracker();
107   ServerName masterServerName = masterAddressTracker == null ? null
108     : masterAddressTracker.getMasterAddress();
109 
110     // 53, 1
111     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: ");
112     // 60, 33
113     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
114     // 60, 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\">\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                ");
116     // 88, 17
117     if (HBaseConfiguration.isShowConfInServlet())
118     {
119       // 88, 64
120       jamonWriter.write("\n                <li><a href=\"/conf\">HBase Configuration</a></li>\n                ");
121     }
122     // 90, 23
123     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>");
124     // 100, 37
125     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName), jamonWriter);
126     // 100, 53
127     jamonWriter.write("</small></h1>\n        </div>\n    </div>\n    <div class=\"row\">\n\n    <section>\n    <h2>Server Metrics</h2>\n    ");
128     // 107, 5
129     {
130       org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl __jamon__var_8 = new org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl(this.getTemplateManager());
131       __jamon__var_8.renderNoFlush(jamonWriter, regionServer.getRegionServerMetrics().getRegionServerWrapper());
132     }
133     // 107, 101
134     jamonWriter.write("\n    </section>\n\n    <section>\n    ");
135     // 111, 5
136     {
137       org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_9 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
138       __jamon__var_9.setFilter(filter );
139       __jamon__var_9.renderNoFlush(jamonWriter);
140     }
141     // 111, 53
142     jamonWriter.write("\n    </section>\n\n    <section>\n    <h2>Block Cache</h2>\n    ");
143     // 116, 5
144     {
145       org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl __jamon__var_10 = new org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheTmpl(this.getTemplateManager());
146       __jamon__var_10.renderNoFlush(jamonWriter, regionServer.getCacheConfig(), regionServer.getConfiguration() );
147     }
148     // 116, 112
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_11 = new org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl(this.getTemplateManager());
153       __jamon__var_11.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(", r");
161     // 135, 79
162     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getRevision()), jamonWriter);
163     // 135, 139
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>Zookeeper Quorum</td>\n            <td>");
173     // 145, 17
174     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(regionServer.getZooKeeper().getQuorum()), jamonWriter);
175     // 145, 62
176     jamonWriter.write("</td>\n            <td>Addresses of all registered ZK servers</td>\n        </tr>\n        <tr>\n            <td>Coprocessors</td>\n            <td>");
177     // 150, 17
178     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(java.util.Arrays.toString(regionServer.getRegionServerCoprocessors())), jamonWriter);
179     // 150, 92
180     jamonWriter.write("</td>\n            <td>Coprocessors currently loaded by this regionserver</td>\n        </tr>\n        <tr>\n            <td>RS Start Time</td>\n            <td>");
181     // 155, 17
182     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(regionServer.getStartcode())), jamonWriter);
183     // 155, 60
184     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                ");
185     // 161, 17
186     if (masterServerName == null )
187     {
188       // 161, 49
189       jamonWriter.write("\n                No master found\n                ");
190     }
191     // 163, 17
192     else
193     {
194       // 163, 24
195       jamonWriter.write("\n                ");
196       // 164, 17
197       
198                 String host = masterServerName.getHostname() + ":" + infoPort;
199                 String url = "//" + host + "/master-status";
200                 
201       // 168, 17
202       jamonWriter.write("<a href=\"");
203       // 168, 26
204       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(url), jamonWriter);
205       // 168, 35
206       jamonWriter.write("\">");
207       // 168, 37
208       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(host), jamonWriter);
209       // 168, 47
210       jamonWriter.write("</a>\n                ");
211     }
212     // 169, 23
213     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");
214   }
215   
216   
217 }