View Javadoc

1   // Autogenerated Jamon proxy
2   // /Users/stack/checkouts/hbase.git.commit/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 23, 1
7   import java.util.*;
8   // 24, 1
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 25, 1
11  import org.apache.hadoop.hbase.regionserver.MetricsRegionServerWrapper;
12  // 26, 1
13  import org.apache.hadoop.hbase.util.Bytes;
14  // 27, 1
15  import org.apache.hadoop.hbase.HRegionInfo;
16  // 28, 1
17  import org.apache.hadoop.hbase.ServerName;
18  // 29, 1
19  import org.apache.hadoop.hbase.HBaseConfiguration;
20  // 30, 1
21  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
22  // 31, 1
23  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
24  // 32, 1
25  import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
26  // 33, 1
27  import org.apache.hadoop.hbase.util.DirectMemoryUtils;
28  // 34, 1
29  import org.apache.hadoop.util.StringUtils;
30  // 35, 1
31  import com.yammer.metrics.stats.Snapshot;
32  // 36, 1
33  import java.lang.management.ManagementFactory;
34  
35  @org.jamon.annotations.Template(
36    signature = "FB16FA9F74B30B8FFC482F2E105C6509",
37    requiredArguments = {
38      @org.jamon.annotations.Argument(name = "mWrap", type = "MetricsRegionServerWrapper")})
39  public class ServerMetricsTmpl
40    extends org.jamon.AbstractTemplateProxy
41  {
42    
43    public ServerMetricsTmpl(org.jamon.TemplateManager p_manager)
44    {
45       super(p_manager);
46    }
47    
48    public ServerMetricsTmpl()
49    {
50       super("/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl");
51    }
52    
53    protected interface Intf
54      extends org.jamon.AbstractTemplateProxy.Intf{
55      
56      void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
57      
58    }
59    public static class ImplData
60      extends org.jamon.AbstractTemplateProxy.ImplData
61    {
62      // 20, 1
63      public void setMWrap(MetricsRegionServerWrapper mWrap)
64      {
65        // 20, 1
66        m_mWrap = mWrap;
67      }
68      public MetricsRegionServerWrapper getMWrap()
69      {
70        return m_mWrap;
71      }
72      private MetricsRegionServerWrapper m_mWrap;
73    }
74    @Override
75    protected ImplData makeImplData()
76    {
77      return new ImplData();
78    }
79    @Override @SuppressWarnings("unchecked") public ImplData getImplData()
80    {
81      return (ImplData) super.getImplData();
82    }
83    
84    
85    @Override
86    public org.jamon.AbstractTemplateImpl constructImpl(Class<? extends org.jamon.AbstractTemplateImpl> p_class){
87      try
88      {
89        return p_class
90          .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
91          .newInstance(new Object [] { getTemplateManager(), getImplData()});
92      }
93      catch (RuntimeException e)
94      {
95        throw e;
96      }
97      catch (Exception e)
98      {
99        throw new RuntimeException(e);
100     }
101   }
102   
103   @Override
104   protected org.jamon.AbstractTemplateImpl constructImpl(){
105     return new ServerMetricsTmplImpl(getTemplateManager(), getImplData());
106   }
107   public org.jamon.Renderer makeRenderer(final MetricsRegionServerWrapper mWrap)
108   {
109     return new org.jamon.AbstractRenderer() {
110       @Override
111       public void renderTo(final java.io.Writer jamonWriter)
112         throws java.io.IOException
113       {
114         render(jamonWriter, mWrap);
115       }
116     };
117   }
118   
119   public void render(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
120     throws java.io.IOException
121   {
122     renderNoFlush(jamonWriter, mWrap);
123     jamonWriter.flush();
124   }
125   public void renderNoFlush(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
126     throws java.io.IOException
127   {
128     ImplData implData = getImplData();
129     implData.setMWrap(mWrap);
130     Intf instance = (Intf) getTemplateManager().constructImpl(this);
131     instance.renderNoFlush(jamonWriter);
132     reset();
133   }
134   
135   
136 }