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