View Javadoc

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