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