View Javadoc

1   // Autogenerated Jamon proxy
2   // /home/buildslave/odpi-bigtop/output/hbase/hbase-0.98.12/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 35, 1
7   import java.util.Map;
8   // 36, 1
9   import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
10  // 37, 1
11  import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.AgeSnapshot;
12  // 38, 1
13  import org.apache.hadoop.hbase.io.hfile.CachedBlock;
14  // 39, 1
15  import org.apache.hadoop.conf.Configuration;
16  // 40, 1
17  import org.apache.hadoop.hbase.io.hfile.CacheConfig;
18  // 41, 1
19  import org.apache.hadoop.hbase.io.hfile.BlockCache;
20  // 42, 1
21  import org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
22  // 43, 1
23  import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
24  // 44, 1
25  import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
26  // 45, 1
27  import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
28  // 46, 1
29  import org.apache.hadoop.hbase.io.hfile.slab.SlabCache;
30  // 47, 1
31  import org.apache.hadoop.hbase.io.hfile.slab.SingleSizeCache;
32  // 48, 1
33  import org.apache.hadoop.util.StringUtils;
34  
35  @org.jamon.annotations.Template(
36    signature = "8F3892A92B902EE933A05F0ABA2BE807",
37    requiredArguments = {
38      @org.jamon.annotations.Argument(name = "cacheConfig", type = "CacheConfig"),
39      @org.jamon.annotations.Argument(name = "config", type = "Configuration")})
40  public class BlockCacheTmpl
41    extends org.jamon.AbstractTemplateProxy
42  {
43    
44    public BlockCacheTmpl(org.jamon.TemplateManager p_manager)
45    {
46       super(p_manager);
47    }
48    
49    public BlockCacheTmpl()
50    {
51       super("/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl");
52    }
53    
54    protected interface Intf
55      extends org.jamon.AbstractTemplateProxy.Intf{
56      
57      void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
58      
59    }
60    public static class ImplData
61      extends org.jamon.AbstractTemplateProxy.ImplData
62    {
63      // 21, 1
64      public void setCacheConfig(CacheConfig cacheConfig)
65      {
66        // 21, 1
67        m_cacheConfig = cacheConfig;
68      }
69      public CacheConfig getCacheConfig()
70      {
71        return m_cacheConfig;
72      }
73      private CacheConfig m_cacheConfig;
74      // 22, 1
75      public void setConfig(Configuration config)
76      {
77        // 22, 1
78        m_config = config;
79      }
80      public Configuration getConfig()
81      {
82        return m_config;
83      }
84      private Configuration m_config;
85    }
86    @Override
87    protected ImplData makeImplData()
88    {
89      return new ImplData();
90    }
91    @Override @SuppressWarnings("unchecked") public ImplData getImplData()
92    {
93      return (ImplData) super.getImplData();
94    }
95    
96    
97    @Override
98    public org.jamon.AbstractTemplateImpl constructImpl(Class<? extends org.jamon.AbstractTemplateImpl> p_class){
99      try
100     {
101       return p_class
102         .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
103         .newInstance(new Object [] { getTemplateManager(), getImplData()});
104     }
105     catch (RuntimeException e)
106     {
107       throw e;
108     }
109     catch (Exception e)
110     {
111       throw new RuntimeException(e);
112     }
113   }
114   
115   @Override
116   protected org.jamon.AbstractTemplateImpl constructImpl(){
117     return new BlockCacheTmplImpl(getTemplateManager(), getImplData());
118   }
119   public org.jamon.Renderer makeRenderer(final CacheConfig cacheConfig, final Configuration config)
120   {
121     return new org.jamon.AbstractRenderer() {
122       @Override
123       public void renderTo(final java.io.Writer jamonWriter)
124         throws java.io.IOException
125       {
126         render(jamonWriter, cacheConfig, config);
127       }
128     };
129   }
130   
131   public void render(final java.io.Writer jamonWriter, final CacheConfig cacheConfig, final Configuration config)
132     throws java.io.IOException
133   {
134     renderNoFlush(jamonWriter, cacheConfig, config);
135     jamonWriter.flush();
136   }
137   public void renderNoFlush(final java.io.Writer jamonWriter, final CacheConfig cacheConfig, final Configuration config)
138     throws java.io.IOException
139   {
140     ImplData implData = getImplData();
141     implData.setCacheConfig(cacheConfig);
142     implData.setConfig(config);
143     Intf instance = (Intf) getTemplateManager().constructImpl(this);
144     instance.renderNoFlush(jamonWriter);
145     reset();
146   }
147   
148   
149 }