View Javadoc

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