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