View Javadoc

1   // Autogenerated Jamon implementation
2   // /Users/misty/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.master;
5   
6   // 32, 1
7   import java.util.*;
8   // 33, 1
9   import org.apache.hadoop.util.StringUtils;
10  // 34, 1
11  import org.apache.hadoop.hbase.util.Bytes;
12  // 35, 1
13  import org.apache.hadoop.hbase.util.JvmVersion;
14  // 36, 1
15  import org.apache.hadoop.hbase.util.FSUtils;
16  // 37, 1
17  import org.apache.hadoop.hbase.master.HMaster;
18  // 38, 1
19  import org.apache.hadoop.hbase.master.AssignmentManager;
20  // 39, 1
21  import org.apache.hadoop.hbase.master.ServerManager;
22  // 40, 1
23  import org.apache.hadoop.hbase.HConstants;
24  // 41, 1
25  import org.apache.hadoop.hbase.NamespaceDescriptor;
26  // 42, 1
27  import org.apache.hadoop.hbase.ServerLoad;
28  // 43, 1
29  import org.apache.hadoop.hbase.ServerName;
30  // 44, 1
31  import org.apache.hadoop.hbase.client.Admin;
32  // 45, 1
33  import org.apache.hadoop.hbase.HRegionInfo;
34  // 46, 1
35  import org.apache.hadoop.hbase.master.RegionState;
36  // 47, 1
37  import org.apache.hadoop.hbase.HTableDescriptor;
38  // 48, 1
39  import org.apache.hadoop.hbase.HBaseConfiguration;
40  // 49, 1
41  import org.apache.hadoop.hbase.TableName;
42  // 50, 1
43  import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
44  // 51, 1
45  import org.apache.hadoop.hbase.master.DeadServer;
46  // 52, 1
47  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
48  // 53, 1
49  import org.apache.hadoop.hbase.security.visibility.VisibilityConstants;
50  // 54, 1
51  import org.apache.hadoop.hbase.security.access.AccessControlLists;
52  
53  public class MasterStatusTmplImpl
54    extends org.jamon.AbstractTemplateImpl
55    implements org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.Intf
56  
57  {
58    private final HMaster master;
59    private final ServerManager serverManager;
60    private final String format;
61    private final boolean catalogJanitorEnabled;
62    private final Set<ServerName> deadServers;
63    private final String filter;
64    private final ServerName metaLocation;
65    private final AssignmentManager assignmentManager;
66    private final List<ServerName> servers;
67    private final Map<String,Integer> frags;
68    // 66, 1
69    
70    public String formatZKString() {
71      StringBuilder quorums = new StringBuilder();
72      String zkQuorum = master.getZooKeeper().getQuorum();
73  
74      if (null == zkQuorum) {
75        return quorums.toString();
76      }
77  
78      String[] zks = zkQuorum.split(",");
79  
80      if (zks.length == 0) {
81        return quorums.toString();
82      }
83  
84      for(int i = 0; i < zks.length; ++i) {
85        quorums.append(zks[i].trim());
86  
87        if (i != (zks.length - 1)) {
88          quorums.append("<br/>");
89        }
90      }
91  
92      return quorums.toString();
93    }
94  
95    protected static org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData p_implData)
96    {
97      if(! p_implData.getServerManager__IsNotDefault())
98      {
99        p_implData.setServerManager(null);
100     }
101     if(! p_implData.getFormat__IsNotDefault())
102     {
103       p_implData.setFormat("html");
104     }
105     if(! p_implData.getCatalogJanitorEnabled__IsNotDefault())
106     {
107       p_implData.setCatalogJanitorEnabled(true);
108     }
109     if(! p_implData.getDeadServers__IsNotDefault())
110     {
111       p_implData.setDeadServers(null);
112     }
113     if(! p_implData.getFilter__IsNotDefault())
114     {
115       p_implData.setFilter("general");
116     }
117     if(! p_implData.getMetaLocation__IsNotDefault())
118     {
119       p_implData.setMetaLocation(null);
120     }
121     if(! p_implData.getAssignmentManager__IsNotDefault())
122     {
123       p_implData.setAssignmentManager(null);
124     }
125     if(! p_implData.getServers__IsNotDefault())
126     {
127       p_implData.setServers(null);
128     }
129     if(! p_implData.getFrags__IsNotDefault())
130     {
131       p_implData.setFrags(null);
132     }
133     return p_implData;
134   }
135   public MasterStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData p_implData)
136   {
137     super(p_templateManager, __jamon_setOptionalArguments(p_implData));
138     master = p_implData.getMaster();
139     serverManager = p_implData.getServerManager();
140     format = p_implData.getFormat();
141     catalogJanitorEnabled = p_implData.getCatalogJanitorEnabled();
142     deadServers = p_implData.getDeadServers();
143     filter = p_implData.getFilter();
144     metaLocation = p_implData.getMetaLocation();
145     assignmentManager = p_implData.getAssignmentManager();
146     servers = p_implData.getServers();
147     frags = p_implData.getFrags();
148   }
149   
150   public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
151     throws java.io.IOException
152   {
153     // 57, 1
154     if (format.equals("json") )
155     {
156       // 57, 30
157       jamonWriter.write("\n  ");
158       // 58, 3
159       {
160         org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_6 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
161         __jamon__var_6.setFormat("json" );
162         __jamon__var_6.setFilter(filter);
163         __jamon__var_6.renderNoFlush(jamonWriter);
164       }
165       // 58, 68
166       jamonWriter.write("\n  ");
167       // 59, 3
168       return; 
169     }
170     // 60, 7
171     jamonWriter.write("\n");
172     // 61, 1
173     
174 ServerManager serverManager = master.getServerManager();
175 AssignmentManager assignmentManager = master.getAssignmentManager();
176 
177     // 93, 1
178     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>");
179     // 100, 12
180     if (master.isActiveMaster() )
181     {
182       // 100, 43
183       jamonWriter.write("Master: ");
184     }
185     // 100, 51
186     else
187     {
188       // 100, 58
189       jamonWriter.write("Backup Master: ");
190     }
191     // 100, 79
192     jamonWriter.write("\n    ");
193     // 101, 5
194     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getHostname()), jamonWriter);
195     // 101, 47
196     jamonWriter.write("</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta name=\"description\" content=\"\">\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=\"/master-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=\"/tablesDetailed.jsp\">Table Details</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                ");
197     // 129, 17
198     if (HBaseConfiguration.isShowConfInServlet())
199     {
200       // 129, 64
201       jamonWriter.write("\n                <li><a href=\"/conf\">HBase Configuration</a></li>\n                ");
202     }
203     // 131, 23
204     jamonWriter.write("\n               </ul>\n            </div><!--/.nav-collapse -->\n        </div>\n    </div>\n\n    <div class=\"container\">\n\t");
205     // 138, 2
206     if (master.isActiveMaster() )
207     {
208       // 138, 33
209       jamonWriter.write("\n        <div class=\"row inner_header\">\n            <div class=\"page-header\">\n                <h1>Master <small>");
210       // 141, 35
211       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getHostname()), jamonWriter);
212       // 141, 77
213       jamonWriter.write("</small></h1>\n            </div>\n        </div>\n\n        <div class=\"row\">\n        <!-- Various warnings that cluster admins should be aware of -->\n        ");
214       // 147, 9
215       if (JvmVersion.isBadJvmVersion() )
216       {
217         // 147, 45
218         jamonWriter.write("\n          <div class=\"alert alert-error\">\n          Your current JVM version ");
219         // 149, 36
220         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(System.getProperty("java.version")), jamonWriter);
221         // 149, 76
222         jamonWriter.write(" is known to be\n          unstable with HBase. Please see the\n          <a href=\"http://wiki.apache.org/hadoop/Hbase/Troubleshooting#A18\">HBase wiki</a>\n          for details.\n          </div>\n        ");
223       }
224       // 154, 15
225       jamonWriter.write("\n        ");
226       // 155, 9
227       if (master.isInitialized() && !catalogJanitorEnabled )
228       {
229         // 155, 65
230         jamonWriter.write("\n          <div class=\"alert alert-error\">\n          Please note that your cluster is running with the CatalogJanitor disabled. It can be\n          re-enabled from the hbase shell by running the command 'catalogjanitor_switch true'\n          </div>\n        ");
231       }
232       // 160, 15
233       jamonWriter.write("\n        ");
234       // 161, 9
235       if (!master.isBalancerOn() )
236       {
237         // 161, 39
238         jamonWriter.write("\n          <div class=\"alert alert-warning\">\n            The Load Balancer is not enabled which will eventually cause performance degradation\n            in HBase as Regions will not be distributed across all RegionServers. The balancer\n            is only expected to be disabled during rolling upgrade scenarios.\n          </div>\n        ");
239       }
240       // 167, 15
241       jamonWriter.write("\n\n        <section>\n            <h2>Region Servers</h2>\n            ");
242       // 171, 13
243       {
244         org.apache.hadoop.hbase.tmpl.master.RegionServerListTmpl __jamon__var_7 = new org.apache.hadoop.hbase.tmpl.master.RegionServerListTmpl(this.getTemplateManager());
245         __jamon__var_7.setServers(servers );
246         __jamon__var_7.renderNoFlush(jamonWriter, master);
247       }
248       // 171, 74
249       jamonWriter.write("\n\n            ");
250       // 173, 13
251       if ((deadServers != null) )
252       {
253         // 173, 42
254         jamonWriter.write("\n                ");
255         // 174, 17
256         {
257           // 174, 17
258           __jamon_innerUnit__deadRegionServers(jamonWriter);
259         }
260         // 174, 40
261         jamonWriter.write("\n            ");
262       }
263       // 175, 19
264       jamonWriter.write("\n        </section>\n        <section>\n            ");
265       // 178, 13
266       {
267         org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl __jamon__var_8 = new org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl(this.getTemplateManager());
268         __jamon__var_8.renderNoFlush(jamonWriter, master );
269       }
270       // 178, 58
271       jamonWriter.write("\n        </section>\n        <section>\n            <h2>Tables</h2>\n            <div class=\"tabbable\">\n                <ul class=\"nav nav-pills\">\n                    <li class=\"active\">\n                        <a href=\"#tab_userTables\" data-toggle=\"tab\">User Tables</a>\n                    </li>\n                    <li class=\"\">\n                        <a href=\"#tab_catalogTables\" data-toggle=\"tab\">System Tables</a>\n                    </li>\n                    <li class=\"\">\n                        <a href=\"#tab_userSnapshots\" data-toggle=\"tab\">Snapshots</a>\n                    </li>\n                </ul>\n                <div class=\"tab-content\" style=\"padding-bottom: 9px; border-bottom: 1px solid #ddd;\">\n                    <div class=\"tab-pane active\" id=\"tab_userTables\">\n                        ");
272       // 196, 25
273       if ((metaLocation != null) )
274       {
275         // 196, 55
276         jamonWriter.write("\n                            ");
277         // 197, 29
278         {
279           // 197, 29
280           __jamon_innerUnit__userTables(jamonWriter);
281         }
282         // 197, 45
283         jamonWriter.write("\n                        ");
284       }
285       // 198, 31
286       jamonWriter.write("\n                    </div>\n                    <div class=\"tab-pane\" id=\"tab_catalogTables\">\n                        ");
287       // 201, 25
288       if ((metaLocation != null) )
289       {
290         // 201, 55
291         jamonWriter.write("\n                            ");
292         // 202, 29
293         {
294           // 202, 29
295           __jamon_innerUnit__catalogTables(jamonWriter);
296         }
297         // 202, 48
298         jamonWriter.write("\n                        ");
299       }
300       // 203, 31
301       jamonWriter.write("\n                    </div>\n                    <div class=\"tab-pane\" id=\"tab_userSnapshots\">\n                        ");
302       // 206, 25
303       {
304         // 206, 25
305         __jamon_innerUnit__userSnapshots(jamonWriter);
306       }
307       // 206, 44
308       jamonWriter.write("\n                    </div>\n                </div>\n            </div>\n        </section>\n        ");
309       // 211, 9
310       if (master.getAssignmentManager() != null )
311       {
312         // 211, 54
313         jamonWriter.write("\n        ");
314         // 212, 9
315         {
316           org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl __jamon__var_9 = new org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl(this.getTemplateManager());
317           __jamon__var_9.renderNoFlush(jamonWriter, master.getAssignmentManager());
318         }
319         // 212, 90
320         jamonWriter.write("\n        ");
321       }
322       // 213, 15
323       jamonWriter.write("\n\t");
324     }
325     // 214, 2
326     else
327     {
328       // 214, 9
329       jamonWriter.write("\n        <section>\n            ");
330       // 216, 13
331       {
332         org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl __jamon__var_10 = new org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl(this.getTemplateManager());
333         __jamon__var_10.renderNoFlush(jamonWriter, master );
334       }
335       // 216, 58
336       jamonWriter.write("\n        </section>\n\t");
337     }
338     // 218, 8
339     jamonWriter.write("    \n\n\n        <section>\n            ");
340     // 222, 13
341     {
342       org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_11 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
343       __jamon__var_11.setFilter(filter );
344       __jamon__var_11.renderNoFlush(jamonWriter);
345     }
346     // 222, 61
347     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>");
348     // 235, 25
349     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getVersion()), jamonWriter);
350     // 235, 84
351     jamonWriter.write(", revision=");
352     // 235, 95
353     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getRevision()), jamonWriter);
354     // 235, 155
355     jamonWriter.write("</td><td>HBase version and revision</td>\n                </tr>\n                <tr>\n                    <td>HBase Compiled</td>\n                    <td>");
356     // 239, 25
357     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getDate()), jamonWriter);
358     // 239, 81
359     jamonWriter.write(", ");
360     // 239, 83
361     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getUser()), jamonWriter);
362     // 239, 139
363     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>");
364     // 244, 25
365     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getSrcChecksum()), jamonWriter);
366     // 244, 82
367     jamonWriter.write("</td>\n                    <td>HBase source MD5 checksum</td>\n                </tr>\n                <tr>\n                    <td>Hadoop Version</td>\n                    <td>");
368     // 249, 25
369     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getVersion()), jamonWriter);
370     // 249, 78
371     jamonWriter.write(", revision=");
372     // 249, 89
373     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getRevision()), jamonWriter);
374     // 249, 143
375     jamonWriter.write("</td>\n                    <td>Hadoop version and revision</td>\n                </tr>\n                <tr>\n                    <td>Hadoop Compiled</td>\n                    <td>");
376     // 254, 25
377     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getDate()), jamonWriter);
378     // 254, 75
379     jamonWriter.write(", ");
380     // 254, 77
381     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getUser()), jamonWriter);
382     // 254, 127
383     jamonWriter.write("</td>\n                    <td>When Hadoop version was compiled and by whom</td>\n                </tr>\n                <tr>\n                    <td>Zookeeper Quorum</td>\n                    <td> ");
384     // 260, 26
385     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(formatZKString()), jamonWriter);
386     // 260, 48
387     jamonWriter.write(" </td>\n                    <td>Addresses of all registered ZK servers. For more, see <a href=\"/zk.jsp\">zk dump</a>.</td>\n                </tr>\n                <tr>\n                    <td>Zookeeper Base Path</td>\n                    <td> ");
388     // 265, 26
389     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getZooKeeper().getBaseZNode()), jamonWriter);
390     // 265, 68
391     jamonWriter.write("</td>\n                    <td>Root node of this cluster in ZK.</td>\n                </tr>\n                <tr>\n                    <td>HBase Root Directory</td>\n                    <td>");
392     // 270, 25
393     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(FSUtils.getRootDir(master.getConfiguration()).toString()), jamonWriter);
394     // 270, 87
395     jamonWriter.write("</td>\n                    <td>Location of HBase home directory</td>\n                </tr>\n                <tr>\n                    <td>HMaster Start Time</td>\n                    <td>");
396     // 275, 25
397     org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(new Date(master.getMasterStartTime())), jamonWriter);
398     // 275, 68
399     jamonWriter.write("</td>\n                    <td>Date stamp of when this HMaster was started</td>\n                </tr>\n                ");
400     // 278, 17
401     if (master.isActiveMaster() )
402     {
403       // 278, 48
404       jamonWriter.write("\n\t                <tr>\n\t                    <td>HMaster Active Time</td>\n\t                    <td>");
405       // 281, 26
406       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(new Date(master.getMasterActiveTime())), jamonWriter);
407       // 281, 70
408       jamonWriter.write("</td>\n\t                    <td>Date stamp of when this HMaster became active</td>\n\t                </tr>\n\t                <tr>\n\t                    <td>HBase Cluster ID</td>\n\t                    <td>");
409       // 286, 26
410       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getClusterId() != null ? master.getClusterId() : "Not set"), jamonWriter);
411       // 286, 97
412       jamonWriter.write("</td>\n\t                    <td>Unique identifier generated for each HBase cluster</td>\n\t                </tr>\n\t                <tr>\n\t                    <td>Load average</td>\n\t                    <td>");
413       // 291, 26
414       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerManager() == null ? "0.00" :
415 	                      StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad())), jamonWriter);
416       // 292, 98
417       jamonWriter.write("</td>\n\t                    <td>Average number of regions per regionserver. Naive computation.</td>\n\t                </tr>\n\t                ");
418       // 295, 18
419       if (frags != null )
420       {
421         // 295, 39
422         jamonWriter.write("\n\t                <tr>\n\t                    <td>Fragmentation</td>\n\t                    <td>");
423         // 298, 26
424         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a"), jamonWriter);
425         // 298, 108
426         jamonWriter.write("</td>\n\t                    <td>Overall fragmentation of all tables, including hbase:meta</td>\n\t                </tr>\n\t                ");
427       }
428       // 301, 24
429       jamonWriter.write("\n\t                <tr>\n\t                    <td>Coprocessors</td>\n\t                    <td>");
430       // 304, 26
431       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getMasterCoprocessorHost() == null ? "[]" :
432 	                      java.util.Arrays.toString(master.getMasterCoprocessors())), jamonWriter);
433       // 305, 84
434       jamonWriter.write("</td>\n\t                    <td>Coprocessors currently loaded by the master</td>\n\t                </tr>\n\t                <tr>\n\t                    <td>LoadBalancer</td>\n\t                    <td>");
435       // 310, 26
436       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(master.getLoadBalancerClassName()), jamonWriter);
437       // 310, 65
438       jamonWriter.write("</td>\n\t                    <td>LoadBalancer to be used in the Master</td>\n\t                </tr>\n                ");
439     }
440     // 313, 23
441     jamonWriter.write("\n            </table>\n        </section>\n        </div>\n    </div> <!-- /container -->\n\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\n");
442   }
443   
444   
445   // 428, 1
446   private void __jamon_innerUnit__userSnapshots(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
447     throws java.io.IOException
448   {
449     // 429, 1
450     
451    List<SnapshotDescription> snapshots = null;
452    try (Admin admin = master.getConnection().getAdmin()) {
453      snapshots = master.isInitialized() ? admin.listSnapshots() : null;
454    }
455 
456     // 435, 1
457     if ((snapshots != null && snapshots.size() > 0))
458     {
459       // 435, 51
460       jamonWriter.write("\n<table class=\"table table-striped\">\n    <tr>\n        <th>Snapshot Name</th>\n        <th>Table</th>\n        <th>Creation Time</th>\n    </tr>\n    ");
461       // 442, 5
462       for (SnapshotDescription snapshotDesc : snapshots)
463       {
464         // 442, 57
465         jamonWriter.write("\n    ");
466         // 443, 5
467         
468         TableName snapshotTable = TableName.valueOf(snapshotDesc.getTable());
469     
470         // 446, 5
471         jamonWriter.write("<tr>\n        <td><a href=\"snapshot.jsp?name=");
472         // 447, 40
473         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
474         // 447, 68
475         jamonWriter.write("\">");
476         // 447, 70
477         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
478         // 447, 98
479         jamonWriter.write("</a> </td>\n        <td><a href=\"table.jsp?name=");
480         // 448, 37
481         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
482         // 448, 74
483         jamonWriter.write("\">");
484         // 448, 76
485         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
486         // 448, 113
487         jamonWriter.write("</a>\n        </td>\n        <td>");
488         // 450, 13
489         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(new Date(snapshotDesc.getCreationTime())), jamonWriter);
490         // 450, 59
491         jamonWriter.write("</td>\n    </tr>\n    ");
492       }
493       // 452, 12
494       jamonWriter.write("\n    <p>");
495       // 453, 8
496       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshots.size()), jamonWriter);
497       // 453, 30
498       jamonWriter.write(" snapshot(s) in set.</p>\n</table>\n");
499     }
500     // 455, 7
501     jamonWriter.write("\n");
502   }
503   
504   
505   // 325, 1
506   private void __jamon_innerUnit__catalogTables(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
507     throws java.io.IOException
508   {
509     // 326, 1
510     
511  HTableDescriptor[] sysTables = null;
512  try (Admin admin = master.getConnection().getAdmin()) {
513    sysTables = master.isInitialized() ? admin.listTableDescriptorsByNamespace(
514      NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR) : null;
515  }
516 
517     // 333, 1
518     if ((sysTables != null && sysTables.length > 0))
519     {
520       // 333, 51
521       jamonWriter.write("\n<table class=\"table table-striped\">\n<tr>\n    <th>Table Name</th>\n    ");
522       // 337, 5
523       if ((frags != null) )
524       {
525         // 337, 28
526         jamonWriter.write("\n        <th title=\"Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.\">Frag.</th>\n    ");
527       }
528       // 339, 11
529       jamonWriter.write("\n    <th>Description</th>\n</tr>\n");
530       // 342, 1
531       for (HTableDescriptor systemTable : sysTables)
532       {
533         // 342, 49
534         jamonWriter.write("\n<tr>\n");
535         // 344, 1
536         TableName tableName = systemTable.getTableName();
537         // 345, 5
538         jamonWriter.write("<td><a href=\"table.jsp?name=");
539         // 345, 33
540         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName), jamonWriter);
541         // 345, 48
542         jamonWriter.write("\">");
543         // 345, 50
544         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName), jamonWriter);
545         // 345, 65
546         jamonWriter.write("</a></td>\n    ");
547         // 346, 5
548         if ((frags != null))
549         {
550           // 346, 27
551           jamonWriter.write("\n        <td align=\"center\">");
552           // 347, 28
553           org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString())
554         .intValue() + "%" : "n/a"), jamonWriter);
555           // 348, 37
556           jamonWriter.write("</td>\n    ");
557         }
558         // 349, 11
559         jamonWriter.write("\n    ");
560         // 350, 5
561         String description = null;
562         if (tableName.equals(TableName.META_TABLE_NAME)){
563             description = "The hbase:meta table holds references to all User Table regions";
564         } else if (tableName.equals(AccessControlLists.ACL_TABLE_NAME)){
565             description = "The hbase:acl table holds information about acl";
566 	 } else if (tableName.equals(VisibilityConstants.LABELS_TABLE_NAME)){
567 	     description = "The hbase:labels table holds information about visibility labels";
568         } else {
569             description = "The .NAMESPACE. table holds information about namespaces.";
570         }
571     
572         // 361, 5
573         jamonWriter.write("<td>");
574         // 361, 9
575         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(description), jamonWriter);
576         // 361, 26
577         jamonWriter.write("</td>\n</tr>\n");
578       }
579       // 363, 8
580       jamonWriter.write("\n</table>\n");
581     }
582     // 365, 7
583     jamonWriter.write("\n");
584   }
585   
586   
587   // 368, 1
588   private void __jamon_innerUnit__userTables(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
589     throws java.io.IOException
590   {
591     // 369, 1
592     
593    HTableDescriptor[] tables = null; 
594    try (Admin admin = master.getConnection().getAdmin()) {
595      tables = master.isInitialized() ? admin.listTables() : null;
596    }
597 
598     // 375, 1
599     if ((tables != null && tables.length > 0))
600     {
601       // 375, 45
602       jamonWriter.write("\n<table class=\"table table-striped\">\n    <tr>\n        <th>Namespace</th>\n        <th>Table Name</th>\n        ");
603       // 380, 9
604       if ((frags != null) )
605       {
606         // 380, 32
607         jamonWriter.write("\n            <th title=\"Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.\">Frag.</th>\n        ");
608       }
609       // 382, 15
610       jamonWriter.write("\n        <th>Online Regions</th>\n        <th>Offline Regions</th>\n        <th>Failed Regions</th>\n        <th>Split Regions</th>\n        <th>Other Regions</th>\n        <th>Description</th>\n    </tr>\n    ");
611       // 390, 5
612       for (HTableDescriptor htDesc : tables)
613       {
614         // 390, 45
615         jamonWriter.write("\n    ");
616         // 391, 5
617         
618       Map<RegionState.State, List<HRegionInfo>> tableRegions =
619           master.getAssignmentManager().getRegionStates()
620             .getRegionByStateOfTable(htDesc.getTableName());
621       int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size();
622       int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size();
623       int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size();
624       int failedRegionsCount = tableRegions.get(RegionState.State.FAILED_OPEN).size()
625              + tableRegions.get(RegionState.State.FAILED_CLOSE).size();
626       int otherRegionsCount = 0;
627       for (List<HRegionInfo> list: tableRegions.values()) {
628          otherRegionsCount += list.size();
629       }
630       // now subtract known states
631       otherRegionsCount = otherRegionsCount - openRegionsCount
632                      - failedRegionsCount - offlineRegionsCount
633                      - splitRegionsCount;
634     
635         // 409, 5
636         jamonWriter.write("<tr>\n        <td>");
637         // 410, 13
638         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.getTableName().getNamespaceAsString()), jamonWriter);
639         // 410, 63
640         jamonWriter.write("</td>\n        <td><a href=table.jsp?name=");
641         // 411, 36
642         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.getTableName().getNameAsString()), jamonWriter);
643         // 411, 81
644         jamonWriter.write(">");
645         // 411, 82
646         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.getTableName().getQualifierAsString()), jamonWriter);
647         // 411, 132
648         jamonWriter.write("</a> </td>\n        ");
649         // 412, 9
650         if ((frags != null) )
651         {
652           // 412, 32
653           jamonWriter.write("\n            <td align=\"center\">");
654           // 413, 32
655           org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(htDesc.getTableName().getNameAsString()) != null ? frags.get(htDesc.getTableName().getQualifierAsString()).intValue() + "%" : "n/a"), jamonWriter);
656           // 413, 179
657           jamonWriter.write("</td>\n        ");
658         }
659         // 414, 15
660         jamonWriter.write("\n        <td>");
661         // 415, 13
662         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(openRegionsCount), jamonWriter);
663         // 415, 35
664         jamonWriter.write("</td>\n        <td>");
665         // 416, 13
666         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(offlineRegionsCount), jamonWriter);
667         // 416, 38
668         jamonWriter.write("</td>\n        <td>");
669         // 417, 13
670         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(failedRegionsCount), jamonWriter);
671         // 417, 37
672         jamonWriter.write("</td>\n        <td>");
673         // 418, 13
674         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(splitRegionsCount), jamonWriter);
675         // 418, 36
676         jamonWriter.write("</td>\n        <td>");
677         // 419, 13
678         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(otherRegionsCount), jamonWriter);
679         // 419, 36
680         jamonWriter.write("</td>\n        <td>");
681         // 420, 13
682         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.toStringCustomizedValues()), jamonWriter);
683         // 420, 52
684         jamonWriter.write("</td>\n    </tr>\n    ");
685       }
686       // 422, 12
687       jamonWriter.write("\n    <p>");
688       // 423, 8
689       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tables.length), jamonWriter);
690       // 423, 27
691       jamonWriter.write(" table(s) in set. [<a href=tablesDetailed.jsp>Details</a>]</p>\n</table>\n");
692     }
693     // 425, 7
694     jamonWriter.write("\n");
695   }
696   
697   
698   // 459, 1
699   private void __jamon_innerUnit__deadRegionServers(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
700     throws java.io.IOException
701   {
702     // 461, 1
703     if ((deadServers != null && deadServers.size() > 0))
704     {
705       // 461, 55
706       jamonWriter.write("\n<h2>Dead Region Servers</h2>\n<table class=\"table table-striped\">\n    <tr>\n        <th></th>\n        <th>ServerName</th>\n        <th>Stop time</th>\n    </tr>\n    ");
707       // 469, 5
708       
709        DeadServer deadServerUtil = master.getServerManager().getDeadServers();
710        ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
711          Arrays.sort(deadServerNames);
712          for (ServerName deadServerName: deadServerNames) {
713     
714       // 475, 5
715       jamonWriter.write("<tr>\n    \t<th></th>\n        <td>");
716       // 477, 13
717       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerName), jamonWriter);
718       // 477, 33
719       jamonWriter.write("</td>\n        <td>");
720       // 478, 13
721       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerUtil.getTimeOfDeath(deadServerName)), jamonWriter);
722       // 478, 64
723       jamonWriter.write("</td>\n    </tr>\n    ");
724       // 480, 5
725       
726         }
727     
728       // 483, 5
729       jamonWriter.write("<tr>\n        <th>Total: </th>\n        <td>servers: ");
730       // 485, 22
731       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServers.size()), jamonWriter);
732       // 485, 46
733       jamonWriter.write("</td>\n        <th></th>\n    </tr>\n</table>\n");
734     }
735     // 489, 7
736     jamonWriter.write("\n");
737   }
738   
739   
740 }