View Javadoc

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