View Javadoc

1   // Autogenerated Jamon proxy
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.commons.math.stat.descriptive.DescriptiveStatistics;
10  // 26, 9
11  import org.apache.hadoop.hbase.regionserver.HRegionServer;
12  // 27, 9
13  import org.apache.hadoop.hbase.util.Bytes;
14  // 28, 9
15  import org.apache.hadoop.hbase.HRegionInfo;
16  // 29, 9
17  import org.apache.hadoop.hbase.regionserver.HRegion;
18  // 30, 9
19  import org.apache.hadoop.hbase.ServerName;
20  // 31, 9
21  import org.apache.hadoop.hbase.HBaseConfiguration;
22  // 32, 9
23  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
24  // 33, 9
25  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
26  // 34, 9
27  import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
28  // 35, 9
29  import org.apache.hadoop.hbase.client.RegionReplicaUtil;
30  // 36, 9
31  import org.apache.hadoop.hbase.regionserver.MetricsRegionWrapper;
32  
33  @org.jamon.annotations.Template(
34    signature = "453B1D06C1C069660F1255077D1DC0CE",
35    requiredArguments = {
36      @org.jamon.annotations.Argument(name = "regionServer", type = "HRegionServer"),
37      @org.jamon.annotations.Argument(name = "onlineRegions", type = "List<HRegionInfo>")})
38  public class RegionListTmpl
39    extends org.jamon.AbstractTemplateProxy
40  {
41    
42    public RegionListTmpl(org.jamon.TemplateManager p_manager)
43    {
44       super(p_manager);
45    }
46    
47    public RegionListTmpl()
48    {
49       super("/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl");
50    }
51    
52    protected interface Intf
53      extends org.jamon.AbstractTemplateProxy.Intf{
54      
55      void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
56      
57    }
58    public static class ImplData
59      extends org.jamon.AbstractTemplateProxy.ImplData
60    {
61      // 20, 9
62      public void setRegionServer(HRegionServer regionServer)
63      {
64        // 20, 9
65        m_regionServer = regionServer;
66      }
67      public HRegionServer getRegionServer()
68      {
69        return m_regionServer;
70      }
71      private HRegionServer m_regionServer;
72      // 21, 9
73      public void setOnlineRegions(List<HRegionInfo> onlineRegions)
74      {
75        // 21, 9
76        m_onlineRegions = onlineRegions;
77      }
78      public List<HRegionInfo> getOnlineRegions()
79      {
80        return m_onlineRegions;
81      }
82      private List<HRegionInfo> m_onlineRegions;
83    }
84    @Override
85    protected ImplData makeImplData()
86    {
87      return new ImplData();
88    }
89    @Override @SuppressWarnings("unchecked") public ImplData getImplData()
90    {
91      return (ImplData) super.getImplData();
92    }
93    
94    
95    @Override
96    public org.jamon.AbstractTemplateImpl constructImpl(Class<? extends org.jamon.AbstractTemplateImpl> p_class){
97      try
98      {
99        return p_class
100         .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
101         .newInstance(new Object [] { getTemplateManager(), getImplData()});
102     }
103     catch (RuntimeException e)
104     {
105       throw e;
106     }
107     catch (Exception e)
108     {
109       throw new RuntimeException(e);
110     }
111   }
112   
113   @Override
114   protected org.jamon.AbstractTemplateImpl constructImpl(){
115     return new RegionListTmplImpl(getTemplateManager(), getImplData());
116   }
117   public org.jamon.Renderer makeRenderer(final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
118   {
119     return new org.jamon.AbstractRenderer() {
120       @Override
121       public void renderTo(final java.io.Writer jamonWriter)
122         throws java.io.IOException
123       {
124         render(jamonWriter, regionServer, onlineRegions);
125       }
126     };
127   }
128   
129   public void render(final java.io.Writer jamonWriter, final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
130     throws java.io.IOException
131   {
132     renderNoFlush(jamonWriter, regionServer, onlineRegions);
133     jamonWriter.flush();
134   }
135   public void renderNoFlush(final java.io.Writer jamonWriter, final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
136     throws java.io.IOException
137   {
138     ImplData implData = getImplData();
139     implData.setRegionServer(regionServer);
140     implData.setOnlineRegions(onlineRegions);
141     Intf instance = (Intf) getTemplateManager().constructImpl(this);
142     instance.renderNoFlush(jamonWriter);
143     reset();
144   }
145   
146   
147 }