1
2
3
4 package org.apache.hadoop.hbase.tmpl.regionserver;
5
6
7 import java.util.*;
8
9 import org.apache.hadoop.conf.Configuration;
10
11 import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFile;
12
13 import org.apache.hadoop.hbase.io.hfile.BlockCacheUtil;
14
15 import org.apache.hadoop.hbase.io.hfile.CachedBlock;
16
17 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
18
19 import org.apache.hadoop.hbase.io.hfile.BlockCache;
20
21 import org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
22
23 import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
24
25 import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
26
27 import org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
28
29 import org.apache.hadoop.util.StringUtils;
30
31 @org.jamon.annotations.Template(
32 signature = "95C3D36942FE38FFB173E11E1B54D0B2",
33 requiredArguments = {
34 @org.jamon.annotations.Argument(name = "cacheConfig", type = "CacheConfig"),
35 @org.jamon.annotations.Argument(name = "conf", type = "Configuration"),
36 @org.jamon.annotations.Argument(name = "bcn", type = "String"),
37 @org.jamon.annotations.Argument(name = "bcv", type = "String")})
38 public class BlockCacheViewTmpl
39 extends org.jamon.AbstractTemplateProxy
40 {
41
42 public BlockCacheViewTmpl(org.jamon.TemplateManager p_manager)
43 {
44 super(p_manager);
45 }
46
47 protected BlockCacheViewTmpl(String p_path)
48 {
49 super(p_path);
50 }
51
52 public BlockCacheViewTmpl()
53 {
54 super("/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheViewTmpl");
55 }
56
57 public interface Intf
58 extends org.jamon.AbstractTemplateProxy.Intf
59 {
60
61 void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
62
63 }
64 public static class ImplData
65 extends org.jamon.AbstractTemplateProxy.ImplData
66 {
67
68 public void setCacheConfig(CacheConfig cacheConfig)
69 {
70
71 m_cacheConfig = cacheConfig;
72 }
73 public CacheConfig getCacheConfig()
74 {
75 return m_cacheConfig;
76 }
77 private CacheConfig m_cacheConfig;
78
79 public void setConf(Configuration conf)
80 {
81
82 m_conf = conf;
83 }
84 public Configuration getConf()
85 {
86 return m_conf;
87 }
88 private Configuration m_conf;
89
90 public void setBcn(String bcn)
91 {
92
93 m_bcn = bcn;
94 }
95 public String getBcn()
96 {
97 return m_bcn;
98 }
99 private String m_bcn;
100
101 public void setBcv(String bcv)
102 {
103
104 m_bcv = bcv;
105 }
106 public String getBcv()
107 {
108 return m_bcv;
109 }
110 private String m_bcv;
111 }
112 @Override
113 protected org.jamon.AbstractTemplateProxy.ImplData makeImplData()
114 {
115 return new ImplData();
116 }
117 @Override public ImplData getImplData()
118 {
119 return (ImplData) super.getImplData();
120 }
121
122
123 @Override
124 public org.jamon.AbstractTemplateImpl constructImpl(Class<? extends org.jamon.AbstractTemplateImpl> p_class){
125 try
126 {
127 return p_class
128 .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
129 .newInstance(new Object [] { getTemplateManager(), getImplData()});
130 }
131 catch (RuntimeException e)
132 {
133 throw e;
134 }
135 catch (Exception e)
136 {
137 throw new RuntimeException(e);
138 }
139 }
140
141 @Override
142 protected org.jamon.AbstractTemplateImpl constructImpl(){
143 return new BlockCacheViewTmplImpl(getTemplateManager(), getImplData());
144 }
145 public org.jamon.Renderer makeRenderer(final CacheConfig cacheConfig, final Configuration conf, final String bcn, final String bcv)
146 {
147 return new org.jamon.AbstractRenderer() {
148 @Override
149 public void renderTo(final java.io.Writer jamonWriter)
150 throws java.io.IOException
151 {
152 render(jamonWriter, cacheConfig, conf, bcn, bcv);
153 }
154 };
155 }
156
157 public void render(final java.io.Writer jamonWriter, final CacheConfig cacheConfig, final Configuration conf, final String bcn, final String bcv)
158 throws java.io.IOException
159 {
160 renderNoFlush(jamonWriter, cacheConfig, conf, bcn, bcv);
161 jamonWriter.flush();
162 }
163 public void renderNoFlush(final java.io.Writer jamonWriter, final CacheConfig cacheConfig, final Configuration conf, final String bcn, final String bcv)
164 throws java.io.IOException
165 {
166 ImplData implData = getImplData();
167 implData.setCacheConfig(cacheConfig);
168 implData.setConf(conf);
169 implData.setBcn(bcn);
170 implData.setBcv(bcv);
171 Intf instance = (Intf) getTemplateManager().constructImpl(this);
172 instance.renderNoFlush(jamonWriter);
173 reset();
174 }
175
176
177 }