View Javadoc

1   // Autogenerated Jamon implementation
2   // /Users/stack/checkouts/hbase.git.commit/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 24, 9
7   import java.util.*;
8   // 25, 9
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 26, 9
11  import org.apache.hadoop.hbase.util.Bytes;
12  // 27, 9
13  import org.apache.hadoop.hbase.HRegionInfo;
14  // 28, 9
15  import org.apache.hadoop.hbase.ServerName;
16  // 29, 9
17  import org.apache.hadoop.hbase.HBaseConfiguration;
18  // 30, 9
19  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
20  // 31, 9
21  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
22  // 32, 9
23  import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
24  
25  public class RegionListTmplImpl
26    extends org.jamon.AbstractTemplateImpl
27    implements org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl.Intf
28  
29  {
30    private final HRegionServer regionServer;
31    private final List<HRegionInfo> onlineRegions;
32    protected static org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl.ImplData p_implData)
33    {
34      return p_implData;
35    }
36    public RegionListTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.RegionListTmpl.ImplData p_implData)
37    {
38      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
39      regionServer = p_implData.getRegionServer();
40      onlineRegions = p_implData.getOnlineRegions();
41    }
42    
43    public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
44      throws java.io.IOException
45    {
46      // 34, 1
47      if ((onlineRegions != null && onlineRegions.size() > 0) )
48      {
49        // 34, 60
50        jamonWriter.write("\n\n    ");
51        // 36, 5
52        
53          Collections.sort(onlineRegions);
54      
55        // 40, 5
56        jamonWriter.write("<div class=\"tabbable\">\n        <ul class=\"nav nav-pills\">\n            <li class=\"active\"><a href=\"#tab_regionBaseInfo\" data-toggle=\"tab\">Base Info</a> </li>\n            <li><a href=\"#tab_regionRequestStats\" data-toggle=\"tab\">Request metrics</a></li>\n            <li class=\"\"><a href=\"#tab_regionStoreStats\" data-toggle=\"tab\">Storefile Metrics</a></li>\n            <li class=\"\"><a href=\"#tab_regionMemstoreStats\" data-toggle=\"tab\">Memstore Metrics</a></li>\n            <li class=\"\"><a href=\"#tab_regionCompactStats\" data-toggle=\"tab\">Compaction Metrics</a></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_regionBaseInfo\">\n                ");
57        // 50, 17
58        {
59          // 50, 17
60          __jamon_innerUnit__baseInfo(jamonWriter, onlineRegions);
61        }
62        // 50, 63
63        jamonWriter.write("\n            </div>\n            <div class=\"tab-pane\" id=\"tab_regionRequestStats\">\n                ");
64        // 53, 17
65        {
66          // 53, 17
67          __jamon_innerUnit__requestStats(jamonWriter, onlineRegions);
68        }
69        // 53, 67
70        jamonWriter.write("\n            </div>\n            <div class=\"tab-pane\" id=\"tab_regionStoreStats\">\n                ");
71        // 56, 17
72        {
73          // 56, 17
74          __jamon_innerUnit__storeStats(jamonWriter, onlineRegions);
75        }
76        // 56, 65
77        jamonWriter.write("\n            </div>\n            <div class=\"tab-pane\" id=\"tab_regionMemstoreStats\">\n                ");
78        // 59, 17
79        {
80          // 59, 17
81          __jamon_innerUnit__memstoreStats(jamonWriter, onlineRegions);
82        }
83        // 59, 68
84        jamonWriter.write("\n            </div>\n            <div class=\"tab-pane\" id=\"tab_regionCompactStats\">\n                ");
85        // 62, 17
86        {
87          // 62, 17
88          __jamon_innerUnit__compactStats(jamonWriter, onlineRegions);
89        }
90        // 62, 67
91        jamonWriter.write("\n            </div>\n        </div>\n    </div>\n    <p>Region names are made of the containing table's name, a comma,\n    the start key, a comma, and a randomly generated region id.  To illustrate,\n    the region named\n    <em>domains,apache.org,5464829424211263407</em> is party to the table\n    <em>domains</em>, has an id of <em>5464829424211263407</em> and the first key\n    in the region is <em>apache.org</em>.  The <em>hbase:meta</em> 'table' is an internal\n    system table (or 'catalog' tables in db-speak).\n    The hbase:meta table keeps a list of all regions in the system. The empty key is used to denote\n    table start and table end.  A region with an empty start key is the first region in a table.\n    If region has both an empty start and an empty end key, its the only region in the table.  See\n    <a href=\"http://hbase.org\">HBase Home</a> for further explication.<p>\n");
92      }
93      // 77, 1
94      else
95      {
96        // 77, 8
97        jamonWriter.write("\n    <p>Not serving regions</p>\n");
98      }
99      // 79, 7
100     jamonWriter.write("\n\n");
101   }
102   
103   
104   // 102, 1
105   private void __jamon_innerUnit__requestStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final List<HRegionInfo> onlineRegions)
106     throws java.io.IOException
107   {
108     // 106, 5
109     jamonWriter.write("<table class=\"table table-striped\">\n        <tr>\n            <th>Region Name</th>\n            <th>Read Request Count</th>\n            <th>Write Request Count</th>\n        </tr>\n\n        ");
110     // 113, 9
111     for (HRegionInfo r: onlineRegions )
112     {
113       // 113, 46
114       jamonWriter.write("\n\n        <tr>\n        ");
115       // 116, 9
116       
117             RegionLoad load = regionServer.createRegionLoad(r.getEncodedName());
118         
119       // 119, 13
120       jamonWriter.write("<td>");
121       // 119, 17
122       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(r.getRegionNameAsString()), jamonWriter);
123       // 119, 48
124       jamonWriter.write("</td>\n            ");
125       // 120, 13
126       if (load != null )
127       {
128         // 120, 33
129         jamonWriter.write("\n            <td>");
130         // 121, 17
131         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getReadRequestsCount()), jamonWriter);
132         // 121, 50
133         jamonWriter.write("</td>\n            <td>");
134         // 122, 17
135         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getWriteRequestsCount()), jamonWriter);
136         // 122, 51
137         jamonWriter.write("</td>\n            ");
138       }
139       // 123, 19
140       jamonWriter.write("\n        </tr>\n        ");
141     }
142     // 125, 16
143     jamonWriter.write("\n    </table>\n");
144   }
145   
146   
147   // 200, 1
148   private void __jamon_innerUnit__memstoreStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final List<HRegionInfo> onlineRegions)
149     throws java.io.IOException
150   {
151     // 204, 5
152     jamonWriter.write("<table class=\"table table-striped\">\n        <tr>\n            <th>Region Name</th>\n            <th>Memstore Size</th>\n        </tr>\n\n        ");
153     // 210, 9
154     for (HRegionInfo r: onlineRegions )
155     {
156       // 210, 46
157       jamonWriter.write("\n\n        <tr>\n        ");
158       // 213, 9
159       
160             RegionLoad load = regionServer.createRegionLoad(r.getEncodedName());
161         
162       // 216, 13
163       jamonWriter.write("<td>");
164       // 216, 17
165       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(r.getRegionNameAsString()), jamonWriter);
166       // 216, 48
167       jamonWriter.write("</td>\n            ");
168       // 217, 13
169       if (load != null )
170       {
171         // 217, 33
172         jamonWriter.write("\n            <td>");
173         // 218, 17
174         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getMemstoreSizeMB()), jamonWriter);
175         // 218, 47
176         jamonWriter.write("m</td>\n            ");
177       }
178       // 219, 19
179       jamonWriter.write("\n        </tr>\n        ");
180     }
181     // 221, 16
182     jamonWriter.write("\n    </table>\n");
183   }
184   
185   
186   // 166, 1
187   private void __jamon_innerUnit__compactStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final List<HRegionInfo> onlineRegions)
188     throws java.io.IOException
189   {
190     // 170, 5
191     jamonWriter.write("<table class=\"table table-striped\">\n        <tr>\n            <th>Region Name</th>\n            <th>Num. Compacting KVs</th>\n            <th>Num. Compacted KVs</th>\n            <th>Compaction Progress</th>\n        </tr>\n\n        ");
192     // 178, 9
193     for (HRegionInfo r: onlineRegions )
194     {
195       // 178, 46
196       jamonWriter.write("\n\n        <tr>\n        ");
197       // 181, 9
198       
199             RegionLoad load = regionServer.createRegionLoad(r.getEncodedName());
200             String percentDone = "";
201             if  (load != null && load.getTotalCompactingKVs() > 0) {
202             percentDone = String.format("%.2f", 100 *
203             ((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%";
204             }
205         
206       // 189, 13
207       jamonWriter.write("<td>");
208       // 189, 17
209       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(r.getRegionNameAsString()), jamonWriter);
210       // 189, 48
211       jamonWriter.write("</td>\n            ");
212       // 190, 13
213       if (load != null )
214       {
215         // 190, 33
216         jamonWriter.write("\n            <td>");
217         // 191, 17
218         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getTotalCompactingKVs()), jamonWriter);
219         // 191, 51
220         jamonWriter.write("</td>\n            <td>");
221         // 192, 17
222         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getCurrentCompactedKVs()), jamonWriter);
223         // 192, 52
224         jamonWriter.write("</td>\n            <td>");
225         // 193, 17
226         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(percentDone), jamonWriter);
227         // 193, 34
228         jamonWriter.write("</td>\n            ");
229       }
230       // 194, 19
231       jamonWriter.write("\n        </tr>\n        ");
232     }
233     // 196, 16
234     jamonWriter.write("\n    </table>\n");
235   }
236   
237   
238   // 81, 1
239   private void __jamon_innerUnit__baseInfo(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final List<HRegionInfo> onlineRegions)
240     throws java.io.IOException
241   {
242     // 85, 5
243     jamonWriter.write("<table class=\"table table-striped\">\n        <tr>\n            <th>Region Name</th>\n            <th>Start Key</th>\n            <th>End Key</th>\n        </tr>\n\n        ");
244     // 92, 9
245     for (HRegionInfo r: onlineRegions )
246     {
247       // 92, 46
248       jamonWriter.write("\n        <tr>\n            <td>");
249       // 94, 17
250       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(r.getRegionNameAsString()), jamonWriter);
251       // 94, 48
252       jamonWriter.write("</td>\n            <td>");
253       // 95, 17
254       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(Bytes.toStringBinary(r.getStartKey())), jamonWriter);
255       // 95, 60
256       jamonWriter.write("</td>\n            <td>");
257       // 96, 17
258       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(Bytes.toStringBinary(r.getEndKey())), jamonWriter);
259       // 96, 58
260       jamonWriter.write("</td>\n        </tr>\n        ");
261     }
262     // 98, 16
263     jamonWriter.write("\n    </table>\n");
264   }
265   
266   
267   // 130, 1
268   private void __jamon_innerUnit__storeStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final List<HRegionInfo> onlineRegions)
269     throws java.io.IOException
270   {
271     // 134, 5
272     jamonWriter.write("<table class=\"table table-striped\">\n        <tr>\n            <th>Region Name</th>\n            <th>Num. Stores</th>\n            <th>Num. Storefiles</th>\n            <th>Storefile Size Uncompressed</th>\n            <th>Storefile Size</th>\n            <th>Index Size</th>\n            <th>Bloom Size</th>\n        </tr>\n\n        ");
273     // 145, 9
274     for (HRegionInfo r: onlineRegions )
275     {
276       // 145, 46
277       jamonWriter.write("\n\n        <tr>\n        ");
278       // 148, 9
279       
280             RegionLoad load = regionServer.createRegionLoad(r.getEncodedName());
281         
282       // 151, 13
283       jamonWriter.write("<td>");
284       // 151, 17
285       org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(r.getRegionNameAsString()), jamonWriter);
286       // 151, 48
287       jamonWriter.write("</td>\n            ");
288       // 152, 13
289       if (load != null )
290       {
291         // 152, 33
292         jamonWriter.write("\n            <td>");
293         // 153, 17
294         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStores()), jamonWriter);
295         // 153, 39
296         jamonWriter.write("</td>\n            <td>");
297         // 154, 17
298         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStorefiles()), jamonWriter);
299         // 154, 43
300         jamonWriter.write("</td>\n            <td>");
301         // 155, 17
302         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStoreUncompressedSizeMB()), jamonWriter);
303         // 155, 56
304         jamonWriter.write("m</td>\n            <td>");
305         // 156, 17
306         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getStorefileSizeMB()), jamonWriter);
307         // 156, 48
308         jamonWriter.write("m</td>\n            <td>");
309         // 157, 17
310         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getTotalStaticIndexSizeKB()), jamonWriter);
311         // 157, 55
312         jamonWriter.write("k</td>\n            <td>");
313         // 158, 17
314         org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(load.getTotalStaticBloomSizeKB()), jamonWriter);
315         // 158, 55
316         jamonWriter.write("k</td>\n            ");
317       }
318       // 159, 19
319       jamonWriter.write("\n        </tr>\n        ");
320     }
321     // 161, 16
322     jamonWriter.write("\n    </table>\n");
323   }
324   
325   
326 }