View Javadoc

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