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 format;
66    private final Set<ServerName> deadServers;
67    private final ServerName metaLocation;
68    private final String filter;
69    private final List<ServerName> servers;
70    private final AssignmentManager assignmentManager;
71    private final Map<String,Integer> frags;
72    private final ServerManager serverManager;
73    private final boolean catalogJanitorEnabled;
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.getFormat__IsNotDefault())
104     {
105       p_implData.setFormat("html");
106     }
107     if(! p_implData.getDeadServers__IsNotDefault())
108     {
109       p_implData.setDeadServers(null);
110     }
111     if(! p_implData.getMetaLocation__IsNotDefault())
112     {
113       p_implData.setMetaLocation(null);
114     }
115     if(! p_implData.getFilter__IsNotDefault())
116     {
117       p_implData.setFilter("general");
118     }
119     if(! p_implData.getServers__IsNotDefault())
120     {
121       p_implData.setServers(null);
122     }
123     if(! p_implData.getAssignmentManager__IsNotDefault())
124     {
125       p_implData.setAssignmentManager(null);
126     }
127     if(! p_implData.getFrags__IsNotDefault())
128     {
129       p_implData.setFrags(null);
130     }
131     if(! p_implData.getServerManager__IsNotDefault())
132     {
133       p_implData.setServerManager(null);
134     }
135     if(! p_implData.getCatalogJanitorEnabled__IsNotDefault())
136     {
137       p_implData.setCatalogJanitorEnabled(true);
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     format = p_implData.getFormat();
146     deadServers = p_implData.getDeadServers();
147     metaLocation = p_implData.getMetaLocation();
148     filter = p_implData.getFilter();
149     servers = p_implData.getServers();
150     assignmentManager = p_implData.getAssignmentManager();
151     frags = p_implData.getFrags();
152     serverManager = p_implData.getServerManager();
153     catalogJanitorEnabled = p_implData.getCatalogJanitorEnabled();
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   // 473, 1
484   private void __jamon_innerUnit__userSnapshots(final java.io.Writer jamonWriter)
485     throws java.io.IOException
486   {
487     // 474, 1
488
489    List<SnapshotDescription> snapshots = null;
490    try (Admin admin = master.getConnection().getAdmin()) {
491      snapshots = master.isInitialized() ? admin.listSnapshots() : null;
492    }
493
494     // 480, 1
495     if ((snapshots != null && snapshots.size() > 0))
496     {
497       // 480, 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       // 487, 5
500       for (SnapshotDescription snapshotDesc : snapshots)
501       {
502         // 487, 57
503         jamonWriter.write("\n    ");
504         // 488, 5
505
506         TableName snapshotTable = TableName.valueOf(snapshotDesc.getTable());
507
508         // 491, 5
509         jamonWriter.write("<tr>\n        <td><a href=\"snapshot.jsp?name=");
510         // 492, 40
511         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
512         // 492, 68
513         jamonWriter.write("\">");
514         // 492, 70
515         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
516         // 492, 98
517         jamonWriter.write("</a> </td>\n        <td><a href=\"table.jsp?name=");
518         // 493, 37
519         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
520         // 493, 74
521         jamonWriter.write("\">");
522         // 493, 76
523         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
524         // 493, 113
525         jamonWriter.write("</a>\n        </td>\n        <td>");
526         // 495, 13
527         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(new Date(snapshotDesc.getCreationTime())), jamonWriter);
528         // 495, 59
529         jamonWriter.write("</td>\n    </tr>\n    ");
530       }
531       // 497, 12
532       jamonWriter.write("\n    <p>");
533       // 498, 8
534       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshots.size()), jamonWriter);
535       // 498, 30
536       jamonWriter.write(" snapshot(s) in set. [<a href=\"/snapshotsStats.jsp\">Snapshot Storefile stats</a>]</p>\n</table>\n");
537     }
538     // 500, 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         } else if (tableName.equals(TableName.valueOf("hbase:replication"))) {
617             description = "The hbase:replication table tracks cross cluster replication through " +
618             "WAL file offsets.";
619         }
620
621         // 405, 5
622         jamonWriter.write("<td>");
623         // 405, 9
624         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(description), jamonWriter);
625         // 405, 26
626         jamonWriter.write("</td>\n</tr>\n");
627       }
628       // 407, 8
629       jamonWriter.write("\n</table>\n");
630     }
631     // 409, 7
632     jamonWriter.write("\n");
633   }
634
635
636   // 412, 1
637   private void __jamon_innerUnit__userTables(final java.io.Writer jamonWriter)
638     throws java.io.IOException
639   {
640     // 413, 1
641
642    HTableDescriptor[] tables = null;
643    try (Admin admin = master.getConnection().getAdmin()) {
644      tables = master.isInitialized() ? admin.listTables() : null;
645    }
646
647     // 419, 1
648     if ((tables != null && tables.length > 0))
649     {
650       // 419, 45
651       jamonWriter.write("\n<table class=\"table table-striped\">\n    <tr>\n        <th>Namespace</th>\n        <th>Table Name</th>\n        ");
652       // 424, 9
653       if ((frags != null) )
654       {
655         // 424, 32
656         jamonWriter.write("\n            <th title=\"Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.\">Frag.</th>\n        ");
657       }
658       // 426, 15
659       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    ");
660       // 434, 5
661       for (HTableDescriptor htDesc : tables)
662       {
663         // 434, 45
664         jamonWriter.write("\n    ");
665         // 435, 5
666
667       TableName tableName = htDesc.getTableName();
668       Map<RegionState.State, List<HRegionInfo>> tableRegions =
669           master.getAssignmentManager().getRegionStates()
670             .getRegionByStateOfTable(tableName);
671       int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size();
672       int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size();
673       int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size();
674       int failedRegionsCount = tableRegions.get(RegionState.State.FAILED_OPEN).size()
675              + tableRegions.get(RegionState.State.FAILED_CLOSE).size();
676       int otherRegionsCount = 0;
677       for (List<HRegionInfo> list: tableRegions.values()) {
678          otherRegionsCount += list.size();
679       }
680       // now subtract known states
681       otherRegionsCount = otherRegionsCount - openRegionsCount
682                      - failedRegionsCount - offlineRegionsCount
683                      - splitRegionsCount;
684
685         // 454, 5
686         jamonWriter.write("<tr>\n        <td>");
687         // 455, 13
688         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getNamespaceAsString()), jamonWriter);
689         // 455, 51
690         jamonWriter.write("</td>\n        <td><a href=table.jsp?name=");
691         // 456, 36
692         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getNameAsString()), jamonWriter);
693         // 456, 69
694         jamonWriter.write(">");
695         // 456, 70
696         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getQualifierAsString()), jamonWriter);
697         // 456, 108
698         jamonWriter.write("</a> </td>\n        ");
699         // 457, 9
700         if ((frags != null) )
701         {
702           // 457, 32
703           jamonWriter.write("\n            <td align=\"center\">");
704           // 458, 32
705           org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString()).intValue() + "%" : "n/a"), jamonWriter);
706           // 458, 150
707           jamonWriter.write("</td>\n        ");
708         }
709         // 459, 15
710         jamonWriter.write("\n        <td>");
711         // 460, 13
712         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(openRegionsCount), jamonWriter);
713         // 460, 35
714         jamonWriter.write("</td>\n        <td>");
715         // 461, 13
716         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(offlineRegionsCount), jamonWriter);
717         // 461, 38
718         jamonWriter.write("</td>\n        <td>");
719         // 462, 13
720         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(failedRegionsCount), jamonWriter);
721         // 462, 37
722         jamonWriter.write("</td>\n        <td>");
723         // 463, 13
724         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(splitRegionsCount), jamonWriter);
725         // 463, 36
726         jamonWriter.write("</td>\n        <td>");
727         // 464, 13
728         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(otherRegionsCount), jamonWriter);
729         // 464, 36
730         jamonWriter.write("</td>\n        <td>");
731         // 465, 13
732         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.toStringCustomizedValues()), jamonWriter);
733         // 465, 52
734         jamonWriter.write("</td>\n    </tr>\n    ");
735       }
736       // 467, 12
737       jamonWriter.write("\n    <p>");
738       // 468, 8
739       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tables.length), jamonWriter);
740       // 468, 27
741       jamonWriter.write(" table(s) in set. [<a href=tablesDetailed.jsp>Details</a>]</p>\n</table>\n");
742     }
743     // 470, 7
744     jamonWriter.write("\n");
745   }
746
747
748   // 504, 1
749   private void __jamon_innerUnit__deadRegionServers(final java.io.Writer jamonWriter)
750     throws java.io.IOException
751   {
752     // 506, 1
753     if ((deadServers != null && deadServers.size() > 0))
754     {
755       // 506, 55
756       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    ");
757       // 514, 5
758
759        DeadServer deadServerUtil = master.getServerManager().getDeadServers();
760        ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
761          Arrays.sort(deadServerNames);
762          for (ServerName deadServerName: deadServerNames) {
763
764       // 520, 5
765       jamonWriter.write("<tr>\n    \t<th></th>\n        <td>");
766       // 522, 13
767       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerName), jamonWriter);
768       // 522, 33
769       jamonWriter.write("</td>\n        <td>");
770       // 523, 13
771       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerUtil.getTimeOfDeath(deadServerName)), jamonWriter);
772       // 523, 64
773       jamonWriter.write("</td>\n    </tr>\n    ");
774       // 525, 5
775
776         }
777
778       // 528, 5
779       jamonWriter.write("<tr>\n        <th>Total: </th>\n        <td>servers: ");
780       // 530, 22
781       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServers.size()), jamonWriter);
782       // 530, 46
783       jamonWriter.write("</td>\n        <th></th>\n    </tr>\n</table>\n");
784     }
785     // 534, 7
786     jamonWriter.write("\n");
787   }
788
789
790 }