View Javadoc

1   // Autogenerated Jamon implementation
2   // /Users/stack/checkouts/hbase.git/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 Map<String,Integer> frags;
66    private final ServerName metaLocation;
67    private final String format;
68    private final ServerManager serverManager;
69    private final Set<ServerName> deadServers;
70    private final boolean catalogJanitorEnabled;
71    private final AssignmentManager assignmentManager;
72    private final List<ServerName> servers;
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.getFrags__IsNotDefault())
104     {
105       p_implData.setFrags(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.getServerManager__IsNotDefault())
116     {
117       p_implData.setServerManager(null);
118     }
119     if(! p_implData.getDeadServers__IsNotDefault())
120     {
121       p_implData.setDeadServers(null);
122     }
123     if(! p_implData.getCatalogJanitorEnabled__IsNotDefault())
124     {
125       p_implData.setCatalogJanitorEnabled(true);
126     }
127     if(! p_implData.getAssignmentManager__IsNotDefault())
128     {
129       p_implData.setAssignmentManager(null);
130     }
131     if(! p_implData.getServers__IsNotDefault())
132     {
133       p_implData.setServers(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     frags = p_implData.getFrags();
146     metaLocation = p_implData.getMetaLocation();
147     format = p_implData.getFormat();
148     serverManager = p_implData.getServerManager();
149     deadServers = p_implData.getDeadServers();
150     catalogJanitorEnabled = p_implData.getCatalogJanitorEnabled();
151     assignmentManager = p_implData.getAssignmentManager();
152     servers = p_implData.getServers();
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.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   // 484, 1
468   private void __jamon_innerUnit__deadRegionServers(final java.io.Writer jamonWriter)
469     throws java.io.IOException
470   {
471     // 486, 1
472     if ((deadServers != null && deadServers.size() > 0))
473     {
474       // 486, 55
475       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    ");
476       // 494, 5
477       
478        DeadServer deadServerUtil = master.getServerManager().getDeadServers();
479        ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
480          Arrays.sort(deadServerNames);
481          for (ServerName deadServerName: deadServerNames) {
482     
483       // 500, 5
484       jamonWriter.write("<tr>\n    \t<th></th>\n        <td>");
485       // 502, 13
486       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerName), jamonWriter);
487       // 502, 33
488       jamonWriter.write("</td>\n        <td>");
489       // 503, 13
490       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServerUtil.getTimeOfDeath(deadServerName)), jamonWriter);
491       // 503, 64
492       jamonWriter.write("</td>\n    </tr>\n    ");
493       // 505, 5
494       
495         }
496     
497       // 508, 5
498       jamonWriter.write("<tr>\n        <th>Total: </th>\n        <td>servers: ");
499       // 510, 22
500       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(deadServers.size()), jamonWriter);
501       // 510, 46
502       jamonWriter.write("</td>\n        <th></th>\n    </tr>\n</table>\n");
503     }
504     // 514, 7
505     jamonWriter.write("\n");
506   }
507   
508   
509   // 343, 1
510   private void __jamon_innerUnit__catalogTables(final java.io.Writer jamonWriter)
511     throws java.io.IOException
512   {
513     // 344, 1
514     
515  HTableDescriptor[] sysTables = null;
516  try (Admin admin = master.getConnection().getAdmin()) {
517    sysTables = master.isInitialized() ? admin.listTableDescriptorsByNamespace(
518      NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR) : null;
519  }
520 
521     // 351, 1
522     if ((sysTables != null && sysTables.length > 0))
523     {
524       // 351, 51
525       jamonWriter.write("\n<table class=\"table table-striped\">\n<tr>\n    <th>Table Name</th>\n    ");
526       // 355, 5
527       if ((frags != null) )
528       {
529         // 355, 28
530         jamonWriter.write("\n        <th title=\"Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.\">Frag.</th>\n    ");
531       }
532       // 357, 11
533       jamonWriter.write("\n    <th>Description</th>\n</tr>\n");
534       // 360, 1
535       for (HTableDescriptor systemTable : sysTables)
536       {
537         // 360, 49
538         jamonWriter.write("\n<tr>\n");
539         // 362, 1
540         TableName tableName = systemTable.getTableName();
541         // 363, 5
542         jamonWriter.write("<td><a href=\"table.jsp?name=");
543         // 363, 33
544         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName), jamonWriter);
545         // 363, 48
546         jamonWriter.write("\">");
547         // 363, 50
548         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName), jamonWriter);
549         // 363, 65
550         jamonWriter.write("</a></td>\n    ");
551         // 364, 5
552         if ((frags != null))
553         {
554           // 364, 27
555           jamonWriter.write("\n        <td align=\"center\">");
556           // 365, 28
557           org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString())
558         .intValue() + "%" : "n/a"), jamonWriter);
559           // 366, 37
560           jamonWriter.write("</td>\n    ");
561         }
562         // 367, 11
563         jamonWriter.write("\n    ");
564         // 368, 5
565         String description = null;
566         if (tableName.equals(TableName.META_TABLE_NAME)){
567             description = "The hbase:meta table holds references to all User Table regions.";
568         } else if (tableName.equals(Canary.DEFAULT_WRITE_TABLE_NAME)){
569             description = "The hbase:canary table is used to sniff the write availbility of"
570               + " each regionserver.";
571         } else if (tableName.equals(AccessControlLists.ACL_TABLE_NAME)){
572             description = "The hbase:acl table holds information about acl";
573         } else if (tableName.equals(VisibilityConstants.LABELS_TABLE_NAME)){
574             description = "The hbase:labels table holds information about visibility labels.";
575         } else if (tableName.equals(TableName.NAMESPACE_TABLE_NAME)){
576             description = "The hbase:namespace table holds information about namespaces.";
577         } else if (tableName.equals(QuotaUtil.QUOTA_TABLE_NAME)){
578             description = "The hbase:quota table holds quota information about number" +
579             " or size of requests in a given time frame.";
580         }
581     
582         // 385, 5
583         jamonWriter.write("<td>");
584         // 385, 9
585         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(description), jamonWriter);
586         // 385, 26
587         jamonWriter.write("</td>\n</tr>\n");
588       }
589       // 387, 8
590       jamonWriter.write("\n</table>\n");
591     }
592     // 389, 7
593     jamonWriter.write("\n");
594   }
595   
596   
597   // 453, 1
598   private void __jamon_innerUnit__userSnapshots(final java.io.Writer jamonWriter)
599     throws java.io.IOException
600   {
601     // 454, 1
602     
603    List<SnapshotDescription> snapshots = null;
604    try (Admin admin = master.getConnection().getAdmin()) {
605      snapshots = master.isInitialized() ? admin.listSnapshots() : null;
606    }
607 
608     // 460, 1
609     if ((snapshots != null && snapshots.size() > 0))
610     {
611       // 460, 51
612       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    ");
613       // 467, 5
614       for (SnapshotDescription snapshotDesc : snapshots)
615       {
616         // 467, 57
617         jamonWriter.write("\n    ");
618         // 468, 5
619         
620         TableName snapshotTable = TableName.valueOf(snapshotDesc.getTable());
621     
622         // 471, 5
623         jamonWriter.write("<tr>\n        <td><a href=\"snapshot.jsp?name=");
624         // 472, 40
625         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
626         // 472, 68
627         jamonWriter.write("\">");
628         // 472, 70
629         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
630         // 472, 98
631         jamonWriter.write("</a> </td>\n        <td><a href=\"table.jsp?name=");
632         // 473, 37
633         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
634         // 473, 74
635         jamonWriter.write("\">");
636         // 473, 76
637         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshotTable.getNameAsString()), jamonWriter);
638         // 473, 113
639         jamonWriter.write("</a>\n        </td>\n        <td>");
640         // 475, 13
641         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(new Date(snapshotDesc.getCreationTime())), jamonWriter);
642         // 475, 59
643         jamonWriter.write("</td>\n    </tr>\n    ");
644       }
645       // 477, 12
646       jamonWriter.write("\n    <p>");
647       // 478, 8
648       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(snapshots.size()), jamonWriter);
649       // 478, 30
650       jamonWriter.write(" snapshot(s) in set.</p>\n</table>\n");
651     }
652     // 480, 7
653     jamonWriter.write("\n");
654   }
655   
656   
657   // 392, 1
658   private void __jamon_innerUnit__userTables(final java.io.Writer jamonWriter)
659     throws java.io.IOException
660   {
661     // 393, 1
662     
663    HTableDescriptor[] tables = null;
664    try (Admin admin = master.getConnection().getAdmin()) {
665      tables = master.isInitialized() ? admin.listTables() : null;
666    }
667 
668     // 399, 1
669     if ((tables != null && tables.length > 0))
670     {
671       // 399, 45
672       jamonWriter.write("\n<table class=\"table table-striped\">\n    <tr>\n        <th>Namespace</th>\n        <th>Table Name</th>\n        ");
673       // 404, 9
674       if ((frags != null) )
675       {
676         // 404, 32
677         jamonWriter.write("\n            <th title=\"Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.\">Frag.</th>\n        ");
678       }
679       // 406, 15
680       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    ");
681       // 414, 5
682       for (HTableDescriptor htDesc : tables)
683       {
684         // 414, 45
685         jamonWriter.write("\n    ");
686         // 415, 5
687         
688       TableName tableName = htDesc.getTableName();
689       Map<RegionState.State, List<HRegionInfo>> tableRegions =
690           master.getAssignmentManager().getRegionStates()
691             .getRegionByStateOfTable(tableName);
692       int openRegionsCount = tableRegions.get(RegionState.State.OPEN).size();
693       int offlineRegionsCount = tableRegions.get(RegionState.State.OFFLINE).size();
694       int splitRegionsCount = tableRegions.get(RegionState.State.SPLIT).size();
695       int failedRegionsCount = tableRegions.get(RegionState.State.FAILED_OPEN).size()
696              + tableRegions.get(RegionState.State.FAILED_CLOSE).size();
697       int otherRegionsCount = 0;
698       for (List<HRegionInfo> list: tableRegions.values()) {
699          otherRegionsCount += list.size();
700       }
701       // now subtract known states
702       otherRegionsCount = otherRegionsCount - openRegionsCount
703                      - failedRegionsCount - offlineRegionsCount
704                      - splitRegionsCount;
705     
706         // 434, 5
707         jamonWriter.write("<tr>\n        <td>");
708         // 435, 13
709         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getNamespaceAsString()), jamonWriter);
710         // 435, 51
711         jamonWriter.write("</td>\n        <td><a href=table.jsp?name=");
712         // 436, 36
713         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getNameAsString()), jamonWriter);
714         // 436, 69
715         jamonWriter.write(">");
716         // 436, 70
717         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tableName.getQualifierAsString()), jamonWriter);
718         // 436, 108
719         jamonWriter.write("</a> </td>\n        ");
720         // 437, 9
721         if ((frags != null) )
722         {
723           // 437, 32
724           jamonWriter.write("\n            <td align=\"center\">");
725           // 438, 32
726           org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(tableName.getNameAsString()) != null ? frags.get(tableName.getNameAsString()).intValue() + "%" : "n/a"), jamonWriter);
727           // 438, 150
728           jamonWriter.write("</td>\n        ");
729         }
730         // 439, 15
731         jamonWriter.write("\n        <td>");
732         // 440, 13
733         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(openRegionsCount), jamonWriter);
734         // 440, 35
735         jamonWriter.write("</td>\n        <td>");
736         // 441, 13
737         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(offlineRegionsCount), jamonWriter);
738         // 441, 38
739         jamonWriter.write("</td>\n        <td>");
740         // 442, 13
741         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(failedRegionsCount), jamonWriter);
742         // 442, 37
743         jamonWriter.write("</td>\n        <td>");
744         // 443, 13
745         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(splitRegionsCount), jamonWriter);
746         // 443, 36
747         jamonWriter.write("</td>\n        <td>");
748         // 444, 13
749         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(otherRegionsCount), jamonWriter);
750         // 444, 36
751         jamonWriter.write("</td>\n        <td>");
752         // 445, 13
753         org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.toStringCustomizedValues()), jamonWriter);
754         // 445, 52
755         jamonWriter.write("</td>\n    </tr>\n    ");
756       }
757       // 447, 12
758       jamonWriter.write("\n    <p>");
759       // 448, 8
760       org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(tables.length), jamonWriter);
761       // 448, 27
762       jamonWriter.write(" table(s) in set. [<a href=tablesDetailed.jsp>Details</a>]</p>\n</table>\n");
763     }
764     // 450, 7
765     jamonWriter.write("\n");
766   }
767   
768   
769 }