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