View Javadoc

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