hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [10/51] [partial] hbase-site git commit: Published site at .
Date Tue, 15 Aug 2017 15:06:26 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/07e68d46/testdevapidocs/src-html/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.CacheOnWriteType.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.CacheOnWriteType.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.CacheOnWriteType.html
index 89a03a3..a5070e4 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.CacheOnWriteType.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.CacheOnWriteType.html
@@ -49,435 +49,436 @@
 <span class="sourceLineNo">041</span>import org.apache.hadoop.fs.Path;<a name="line.41"></a>
 <span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.ArrayBackedTag;<a name="line.42"></a>
 <span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.CellComparator;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.HColumnDescriptor;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.HConstants;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.KeyValue;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.hadoop.hbase.Tag;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>import org.apache.hadoop.hbase.client.Durability;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.client.Put;<a name="line.50"></a>
-<span class="sourceLineNo">051</span>import org.apache.hadoop.hbase.fs.HFileSystem;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>import org.apache.hadoop.hbase.io.compress.Compression;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>import org.apache.hadoop.hbase.regionserver.BloomType;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>import org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.regionserver.Region;<a name="line.57"></a>
-<span class="sourceLineNo">058</span>import org.apache.hadoop.hbase.regionserver.StoreFileWriter;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>import org.apache.hadoop.hbase.testclassification.IOTests;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>import org.apache.hadoop.hbase.testclassification.MediumTests;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>import org.apache.hadoop.hbase.util.BloomFilterFactory;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import org.apache.hadoop.hbase.util.ChecksumType;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import org.junit.After;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>import org.junit.AfterClass;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>import org.junit.Before;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>import org.junit.Test;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>import org.junit.experimental.categories.Category;<a name="line.69"></a>
-<span class="sourceLineNo">070</span>import org.junit.runner.RunWith;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>import org.junit.runners.Parameterized;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>import org.junit.runners.Parameterized.Parameters;<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;<a name="line.74"></a>
-<span class="sourceLineNo">075</span><a name="line.75"></a>
-<span class="sourceLineNo">076</span>/**<a name="line.76"></a>
-<span class="sourceLineNo">077</span> * Tests {@link HFile} cache-on-write functionality for the following block<a name="line.77"></a>
-<span class="sourceLineNo">078</span> * types: data blocks, non-root index blocks, and Bloom filter blocks.<a name="line.78"></a>
-<span class="sourceLineNo">079</span> */<a name="line.79"></a>
-<span class="sourceLineNo">080</span>@RunWith(Parameterized.class)<a name="line.80"></a>
-<span class="sourceLineNo">081</span>@Category({IOTests.class, MediumTests.class})<a name="line.81"></a>
-<span class="sourceLineNo">082</span>public class TestCacheOnWrite {<a name="line.82"></a>
-<span class="sourceLineNo">083</span><a name="line.83"></a>
-<span class="sourceLineNo">084</span>  private static final Log LOG = LogFactory.getLog(TestCacheOnWrite.class);<a name="line.84"></a>
-<span class="sourceLineNo">085</span><a name="line.85"></a>
-<span class="sourceLineNo">086</span>  private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();<a name="line.86"></a>
-<span class="sourceLineNo">087</span>  private Configuration conf;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>  private CacheConfig cacheConf;<a name="line.88"></a>
-<span class="sourceLineNo">089</span>  private FileSystem fs;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  private Random rand = new Random(12983177L);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  private Path storeFilePath;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>  private BlockCache blockCache;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>  private String testDescription;<a name="line.93"></a>
-<span class="sourceLineNo">094</span><a name="line.94"></a>
-<span class="sourceLineNo">095</span>  private final CacheOnWriteType cowType;<a name="line.95"></a>
-<span class="sourceLineNo">096</span>  private final Compression.Algorithm compress;<a name="line.96"></a>
-<span class="sourceLineNo">097</span>  private final boolean cacheCompressedData;<a name="line.97"></a>
-<span class="sourceLineNo">098</span><a name="line.98"></a>
-<span class="sourceLineNo">099</span>  private static final int DATA_BLOCK_SIZE = 2048;<a name="line.99"></a>
-<span class="sourceLineNo">100</span>  private static final int NUM_KV = 25000;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>  private static final int INDEX_BLOCK_SIZE = 512;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>  private static final int BLOOM_BLOCK_SIZE = 4096;<a name="line.102"></a>
-<span class="sourceLineNo">103</span>  private static final BloomType BLOOM_TYPE = BloomType.ROWCOL;<a name="line.103"></a>
-<span class="sourceLineNo">104</span>  private static final int CKBYTES = 512;<a name="line.104"></a>
-<span class="sourceLineNo">105</span><a name="line.105"></a>
-<span class="sourceLineNo">106</span>  /** The number of valid key types possible in a store file */<a name="line.106"></a>
-<span class="sourceLineNo">107</span>  private static final int NUM_VALID_KEY_TYPES =<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      KeyValue.Type.values().length - 2;<a name="line.108"></a>
-<span class="sourceLineNo">109</span><a name="line.109"></a>
-<span class="sourceLineNo">110</span>  private static enum CacheOnWriteType {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    DATA_BLOCKS(CacheConfig.CACHE_BLOCKS_ON_WRITE_KEY,<a name="line.111"></a>
-<span class="sourceLineNo">112</span>        BlockType.DATA, BlockType.ENCODED_DATA),<a name="line.112"></a>
-<span class="sourceLineNo">113</span>    BLOOM_BLOCKS(CacheConfig.CACHE_BLOOM_BLOCKS_ON_WRITE_KEY,<a name="line.113"></a>
-<span class="sourceLineNo">114</span>        BlockType.BLOOM_CHUNK),<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    INDEX_BLOCKS(CacheConfig.CACHE_INDEX_BLOCKS_ON_WRITE_KEY,<a name="line.115"></a>
-<span class="sourceLineNo">116</span>        BlockType.LEAF_INDEX, BlockType.INTERMEDIATE_INDEX);<a name="line.116"></a>
-<span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>    private final String confKey;<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    private final BlockType blockType1;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    private final BlockType blockType2;<a name="line.120"></a>
-<span class="sourceLineNo">121</span><a name="line.121"></a>
-<span class="sourceLineNo">122</span>    private CacheOnWriteType(String confKey, BlockType blockType) {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      this(confKey, blockType, blockType);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    }<a name="line.124"></a>
-<span class="sourceLineNo">125</span><a name="line.125"></a>
-<span class="sourceLineNo">126</span>    private CacheOnWriteType(String confKey, BlockType blockType1,<a name="line.126"></a>
-<span class="sourceLineNo">127</span>        BlockType blockType2) {<a name="line.127"></a>
-<span class="sourceLineNo">128</span>      this.blockType1 = blockType1;<a name="line.128"></a>
-<span class="sourceLineNo">129</span>      this.blockType2 = blockType2;<a name="line.129"></a>
-<span class="sourceLineNo">130</span>      this.confKey = confKey;<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
-<span class="sourceLineNo">132</span><a name="line.132"></a>
-<span class="sourceLineNo">133</span>    public boolean shouldBeCached(BlockType blockType) {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      return blockType == blockType1 || blockType == blockType2;<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    }<a name="line.135"></a>
-<span class="sourceLineNo">136</span><a name="line.136"></a>
-<span class="sourceLineNo">137</span>    public void modifyConf(Configuration conf) {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      for (CacheOnWriteType cowType : CacheOnWriteType.values()) {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        conf.setBoolean(cowType.confKey, cowType == this);<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      }<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
-<span class="sourceLineNo">142</span>  }<a name="line.142"></a>
-<span class="sourceLineNo">143</span><a name="line.143"></a>
-<span class="sourceLineNo">144</span>  public TestCacheOnWrite(CacheOnWriteType cowType, Compression.Algorithm compress,<a name="line.144"></a>
-<span class="sourceLineNo">145</span>      boolean cacheCompressedData, BlockCache blockCache) {<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    this.cowType = cowType;<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    this.compress = compress;<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    this.cacheCompressedData = cacheCompressedData;<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    this.blockCache = blockCache;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    testDescription = "[cacheOnWrite=" + cowType + ", compress=" + compress +<a name="line.150"></a>
-<span class="sourceLineNo">151</span>        ", cacheCompressedData=" + cacheCompressedData + "]";<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    LOG.info(testDescription);<a name="line.152"></a>
-<span class="sourceLineNo">153</span>  }<a name="line.153"></a>
-<span class="sourceLineNo">154</span><a name="line.154"></a>
-<span class="sourceLineNo">155</span>  private static List&lt;BlockCache&gt; getBlockCaches() throws IOException {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    Configuration conf = TEST_UTIL.getConfiguration();<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    List&lt;BlockCache&gt; blockcaches = new ArrayList&lt;&gt;();<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    // default<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    blockcaches.add(new CacheConfig(conf).getBlockCache());<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>    //set LruBlockCache.LRU_HARD_CAPACITY_LIMIT_FACTOR_CONFIG_NAME to 2.0f due to HBASE-16287<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    TEST_UTIL.getConfiguration().setFloat(LruBlockCache.LRU_HARD_CAPACITY_LIMIT_FACTOR_CONFIG_NAME, 2.0f);<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    // memory<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    BlockCache lru = new LruBlockCache(128 * 1024 * 1024, 64 * 1024, TEST_UTIL.getConfiguration());<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    blockcaches.add(lru);<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>    // bucket cache<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    FileSystem.get(conf).mkdirs(TEST_UTIL.getDataTestDir());<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    int[] bucketSizes =<a name="line.169"></a>
-<span class="sourceLineNo">170</span>        { INDEX_BLOCK_SIZE, DATA_BLOCK_SIZE, BLOOM_BLOCK_SIZE, 64 * 1024, 128 * 1024 };<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    BlockCache bucketcache =<a name="line.171"></a>
-<span class="sourceLineNo">172</span>        new BucketCache("offheap", 128 * 1024 * 1024, 64 * 1024, bucketSizes, 5, 64 * 100, null);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    blockcaches.add(bucketcache);<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    return blockcaches;<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>  @Parameters<a name="line.177"></a>
-<span class="sourceLineNo">178</span>  public static Collection&lt;Object[]&gt; getParameters() throws IOException {<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    List&lt;Object[]&gt; params = new ArrayList&lt;&gt;();<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    for (BlockCache blockCache : getBlockCaches()) {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>      for (CacheOnWriteType cowType : CacheOnWriteType.values()) {<a name="line.181"></a>
-<span class="sourceLineNo">182</span>        for (Compression.Algorithm compress : HBaseTestingUtility.COMPRESSION_ALGORITHMS) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>          for (boolean cacheCompressedData : new boolean[] { false, true }) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>            params.add(new Object[] { cowType, compress, cacheCompressedData, blockCache });<a name="line.184"></a>
-<span class="sourceLineNo">185</span>          }<a name="line.185"></a>
-<span class="sourceLineNo">186</span>        }<a name="line.186"></a>
-<span class="sourceLineNo">187</span>      }<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    return params;<a name="line.189"></a>
-<span class="sourceLineNo">190</span>  }<a name="line.190"></a>
-<span class="sourceLineNo">191</span><a name="line.191"></a>
-<span class="sourceLineNo">192</span>  private void clearBlockCache(BlockCache blockCache) throws InterruptedException {<a name="line.192"></a>
-<span class="sourceLineNo">193</span>    if (blockCache instanceof LruBlockCache) {<a name="line.193"></a>
-<span class="sourceLineNo">194</span>      ((LruBlockCache) blockCache).clearCache();<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    } else {<a name="line.195"></a>
-<span class="sourceLineNo">196</span>      // BucketCache may not return all cached blocks(blocks in write queue), so check it here.<a name="line.196"></a>
-<span class="sourceLineNo">197</span>      for (int clearCount = 0; blockCache.getBlockCount() &gt; 0; clearCount++) {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        if (clearCount &gt; 0) {<a name="line.198"></a>
-<span class="sourceLineNo">199</span>          LOG.warn("clear block cache " + blockCache + " " + clearCount + " times, "<a name="line.199"></a>
-<span class="sourceLineNo">200</span>              + blockCache.getBlockCount() + " blocks remaining");<a name="line.200"></a>
-<span class="sourceLineNo">201</span>          Thread.sleep(10);<a name="line.201"></a>
-<span class="sourceLineNo">202</span>        }<a name="line.202"></a>
-<span class="sourceLineNo">203</span>        for (CachedBlock block : Lists.newArrayList(blockCache)) {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>          BlockCacheKey key = new BlockCacheKey(block.getFilename(), block.getOffset());<a name="line.204"></a>
-<span class="sourceLineNo">205</span>          // CombinedBucketCache may need evict two times.<a name="line.205"></a>
-<span class="sourceLineNo">206</span>          for (int evictCount = 0; blockCache.evictBlock(key); evictCount++) {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            if (evictCount &gt; 1) {<a name="line.207"></a>
-<span class="sourceLineNo">208</span>              LOG.warn("evict block " + block + " in " + blockCache + " " + evictCount<a name="line.208"></a>
-<span class="sourceLineNo">209</span>                  + " times, maybe a bug here");<a name="line.209"></a>
-<span class="sourceLineNo">210</span>            }<a name="line.210"></a>
-<span class="sourceLineNo">211</span>          }<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>  }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>  @Before<a name="line.217"></a>
-<span class="sourceLineNo">218</span>  public void setUp() throws IOException {<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    conf = TEST_UTIL.getConfiguration();<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    this.conf.set("dfs.datanode.data.dir.perm", "700");<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    conf.setInt(HFileBlockIndex.MAX_CHUNK_SIZE_KEY, INDEX_BLOCK_SIZE);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    conf.setInt(BloomFilterFactory.IO_STOREFILE_BLOOM_BLOCK_SIZE,<a name="line.222"></a>
-<span class="sourceLineNo">223</span>        BLOOM_BLOCK_SIZE);<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    conf.setBoolean(CacheConfig.CACHE_DATA_BLOCKS_COMPRESSED_KEY, cacheCompressedData);<a name="line.224"></a>
-<span class="sourceLineNo">225</span>    cowType.modifyConf(conf);<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    fs = HFileSystem.get(conf);<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    CacheConfig.GLOBAL_BLOCK_CACHE_INSTANCE = blockCache;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    cacheConf =<a name="line.228"></a>
-<span class="sourceLineNo">229</span>        new CacheConfig(blockCache, true, true, cowType.shouldBeCached(BlockType.DATA),<a name="line.229"></a>
-<span class="sourceLineNo">230</span>        cowType.shouldBeCached(BlockType.LEAF_INDEX),<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        cowType.shouldBeCached(BlockType.BLOOM_CHUNK), false, cacheCompressedData,<a name="line.231"></a>
-<span class="sourceLineNo">232</span>            false, false, false);<a name="line.232"></a>
-<span class="sourceLineNo">233</span>  }<a name="line.233"></a>
-<span class="sourceLineNo">234</span><a name="line.234"></a>
-<span class="sourceLineNo">235</span>  @After<a name="line.235"></a>
-<span class="sourceLineNo">236</span>  public void tearDown() throws IOException, InterruptedException {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>    clearBlockCache(blockCache);<a name="line.237"></a>
-<span class="sourceLineNo">238</span>  }<a name="line.238"></a>
-<span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>  @AfterClass<a name="line.240"></a>
-<span class="sourceLineNo">241</span>  public static void afterClass() throws IOException {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    TEST_UTIL.cleanupTestDir();<a name="line.242"></a>
-<span class="sourceLineNo">243</span>  }<a name="line.243"></a>
-<span class="sourceLineNo">244</span><a name="line.244"></a>
-<span class="sourceLineNo">245</span>  private void testStoreFileCacheOnWriteInternals(boolean useTags) throws IOException {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    writeStoreFile(useTags);<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    readStoreFile(useTags);<a name="line.247"></a>
-<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
-<span class="sourceLineNo">249</span><a name="line.249"></a>
-<span class="sourceLineNo">250</span>  private void readStoreFile(boolean useTags) throws IOException {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    HFile.Reader reader = HFile.createReader(fs, storeFilePath, cacheConf, true, conf);<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    LOG.info("HFile information: " + reader);<a name="line.252"></a>
-<span class="sourceLineNo">253</span>    HFileContext meta = new HFileContextBuilder().withCompression(compress)<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      .withBytesPerCheckSum(CKBYTES).withChecksumType(ChecksumType.NULL)<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      .withBlockSize(DATA_BLOCK_SIZE)<a name="line.255"></a>
-<span class="sourceLineNo">256</span>      .withDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.256"></a>
-<span class="sourceLineNo">257</span>      .withIncludesTags(useTags).build();<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    final boolean cacheBlocks = false;<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    final boolean pread = false;<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    HFileScanner scanner = reader.getScanner(cacheBlocks, pread);<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    assertTrue(testDescription, scanner.seekTo());<a name="line.261"></a>
-<span class="sourceLineNo">262</span><a name="line.262"></a>
-<span class="sourceLineNo">263</span>    long offset = 0;<a name="line.263"></a>
-<span class="sourceLineNo">264</span>    EnumMap&lt;BlockType, Integer&gt; blockCountByType = new EnumMap&lt;&gt;(BlockType.class);<a name="line.264"></a>
-<span class="sourceLineNo">265</span><a name="line.265"></a>
-<span class="sourceLineNo">266</span>    DataBlockEncoding encodingInCache = NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding();<a name="line.266"></a>
-<span class="sourceLineNo">267</span>    List&lt;Long&gt; cachedBlocksOffset = new ArrayList&lt;&gt;();<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    Map&lt;Long, HFileBlock&gt; cachedBlocks = new HashMap&lt;&gt;();<a name="line.268"></a>
-<span class="sourceLineNo">269</span>    while (offset &lt; reader.getTrailer().getLoadOnOpenDataOffset()) {<a name="line.269"></a>
-<span class="sourceLineNo">270</span>      // Flags: don't cache the block, use pread, this is not a compaction.<a name="line.270"></a>
-<span class="sourceLineNo">271</span>      // Also, pass null for expected block type to avoid checking it.<a name="line.271"></a>
-<span class="sourceLineNo">272</span>      HFileBlock block = reader.readBlock(offset, -1, false, true, false, true, null,<a name="line.272"></a>
-<span class="sourceLineNo">273</span>          encodingInCache);<a name="line.273"></a>
-<span class="sourceLineNo">274</span>      BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),<a name="line.274"></a>
-<span class="sourceLineNo">275</span>          offset);<a name="line.275"></a>
-<span class="sourceLineNo">276</span>      HFileBlock fromCache = (HFileBlock) blockCache.getBlock(blockCacheKey, true, false, true);<a name="line.276"></a>
-<span class="sourceLineNo">277</span>      boolean isCached = fromCache != null;<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      cachedBlocksOffset.add(offset);<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      cachedBlocks.put(offset, fromCache);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>      boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());<a name="line.280"></a>
-<span class="sourceLineNo">281</span>      assertTrue("shouldBeCached: " + shouldBeCached+ "\n" +<a name="line.281"></a>
-<span class="sourceLineNo">282</span>          "isCached: " + isCached + "\n" +<a name="line.282"></a>
-<span class="sourceLineNo">283</span>          "Test description: " + testDescription + "\n" +<a name="line.283"></a>
-<span class="sourceLineNo">284</span>          "block: " + block + "\n" +<a name="line.284"></a>
-<span class="sourceLineNo">285</span>          "encodingInCache: " + encodingInCache + "\n" +<a name="line.285"></a>
-<span class="sourceLineNo">286</span>          "blockCacheKey: " + blockCacheKey,<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        shouldBeCached == isCached);<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      if (isCached) {<a name="line.288"></a>
-<span class="sourceLineNo">289</span>        if (cacheConf.shouldCacheCompressed(fromCache.getBlockType().getCategory())) {<a name="line.289"></a>
-<span class="sourceLineNo">290</span>          if (compress != Compression.Algorithm.NONE) {<a name="line.290"></a>
-<span class="sourceLineNo">291</span>            assertFalse(fromCache.isUnpacked());<a name="line.291"></a>
-<span class="sourceLineNo">292</span>          }<a name="line.292"></a>
-<span class="sourceLineNo">293</span>          fromCache = fromCache.unpack(meta, reader.getUncachedBlockReader());<a name="line.293"></a>
-<span class="sourceLineNo">294</span>        } else {<a name="line.294"></a>
-<span class="sourceLineNo">295</span>          assertTrue(fromCache.isUnpacked());<a name="line.295"></a>
-<span class="sourceLineNo">296</span>        }<a name="line.296"></a>
-<span class="sourceLineNo">297</span>        // block we cached at write-time and block read from file should be identical<a name="line.297"></a>
-<span class="sourceLineNo">298</span>        assertEquals(block.getChecksumType(), fromCache.getChecksumType());<a name="line.298"></a>
-<span class="sourceLineNo">299</span>        assertEquals(block.getBlockType(), fromCache.getBlockType());<a name="line.299"></a>
-<span class="sourceLineNo">300</span>        assertNotEquals(block.getBlockType(), BlockType.ENCODED_DATA);<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        assertEquals(block.getOnDiskSizeWithHeader(), fromCache.getOnDiskSizeWithHeader());<a name="line.301"></a>
-<span class="sourceLineNo">302</span>        assertEquals(block.getOnDiskSizeWithoutHeader(), fromCache.getOnDiskSizeWithoutHeader());<a name="line.302"></a>
-<span class="sourceLineNo">303</span>        assertEquals(<a name="line.303"></a>
-<span class="sourceLineNo">304</span>          block.getUncompressedSizeWithoutHeader(), fromCache.getUncompressedSizeWithoutHeader());<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      }<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      offset += block.getOnDiskSizeWithHeader();<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      BlockType bt = block.getBlockType();<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      Integer count = blockCountByType.get(bt);<a name="line.308"></a>
-<span class="sourceLineNo">309</span>      blockCountByType.put(bt, (count == null ? 0 : count) + 1);<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    }<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>    LOG.info("Block count by type: " + blockCountByType);<a name="line.312"></a>
-<span class="sourceLineNo">313</span>    String countByType = blockCountByType.toString();<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    if (useTags) {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>      assertEquals("{" + BlockType.DATA<a name="line.315"></a>
-<span class="sourceLineNo">316</span>          + "=2663, LEAF_INDEX=297, BLOOM_CHUNK=9, INTERMEDIATE_INDEX=32}", countByType);<a name="line.316"></a>
-<span class="sourceLineNo">317</span>    } else {<a name="line.317"></a>
-<span class="sourceLineNo">318</span>      assertEquals("{" + BlockType.DATA<a name="line.318"></a>
-<span class="sourceLineNo">319</span>          + "=2498, LEAF_INDEX=278, BLOOM_CHUNK=9, INTERMEDIATE_INDEX=31}", countByType);<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
-<span class="sourceLineNo">321</span><a name="line.321"></a>
-<span class="sourceLineNo">322</span>    // iterate all the keyvalue from hfile<a name="line.322"></a>
-<span class="sourceLineNo">323</span>    while (scanner.next()) {<a name="line.323"></a>
-<span class="sourceLineNo">324</span>      scanner.getCell();<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    }<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    Iterator&lt;Long&gt; iterator = cachedBlocksOffset.iterator();<a name="line.326"></a>
-<span class="sourceLineNo">327</span>    while(iterator.hasNext()) {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>      Long entry = iterator.next();<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),<a name="line.329"></a>
-<span class="sourceLineNo">330</span>          entry);<a name="line.330"></a>
-<span class="sourceLineNo">331</span>      HFileBlock hFileBlock = cachedBlocks.get(entry);<a name="line.331"></a>
-<span class="sourceLineNo">332</span>      if (hFileBlock != null) {<a name="line.332"></a>
-<span class="sourceLineNo">333</span>        // call return twice because for the isCache cased the counter would have got incremented<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        // twice<a name="line.334"></a>
-<span class="sourceLineNo">335</span>        blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.335"></a>
-<span class="sourceLineNo">336</span>        if(cacheCompressedData) {<a name="line.336"></a>
-<span class="sourceLineNo">337</span>          if (this.compress == Compression.Algorithm.NONE<a name="line.337"></a>
-<span class="sourceLineNo">338</span>              || cowType == CacheOnWriteType.INDEX_BLOCKS<a name="line.338"></a>
-<span class="sourceLineNo">339</span>              || cowType == CacheOnWriteType.BLOOM_BLOCKS) {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>            blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.340"></a>
-<span class="sourceLineNo">341</span>          }<a name="line.341"></a>
-<span class="sourceLineNo">342</span>        } else {<a name="line.342"></a>
-<span class="sourceLineNo">343</span>          blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>        }<a name="line.344"></a>
-<span class="sourceLineNo">345</span>      }<a name="line.345"></a>
-<span class="sourceLineNo">346</span>    }<a name="line.346"></a>
-<span class="sourceLineNo">347</span>    scanner.shipped();<a name="line.347"></a>
-<span class="sourceLineNo">348</span>    reader.close();<a name="line.348"></a>
-<span class="sourceLineNo">349</span>  }<a name="line.349"></a>
-<span class="sourceLineNo">350</span><a name="line.350"></a>
-<span class="sourceLineNo">351</span>  public static KeyValue.Type generateKeyType(Random rand) {<a name="line.351"></a>
-<span class="sourceLineNo">352</span>    if (rand.nextBoolean()) {<a name="line.352"></a>
-<span class="sourceLineNo">353</span>      // Let's make half of KVs puts.<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      return KeyValue.Type.Put;<a name="line.354"></a>
-<span class="sourceLineNo">355</span>    } else {<a name="line.355"></a>
-<span class="sourceLineNo">356</span>      KeyValue.Type keyType = KeyValue.Type.values()[1 + rand.nextInt(NUM_VALID_KEY_TYPES)];<a name="line.356"></a>
-<span class="sourceLineNo">357</span>      if (keyType == KeyValue.Type.Minimum || keyType == KeyValue.Type.Maximum) {<a name="line.357"></a>
-<span class="sourceLineNo">358</span>        throw new RuntimeException("Generated an invalid key type: " + keyType + ". "<a name="line.358"></a>
-<span class="sourceLineNo">359</span>            + "Probably the layout of KeyValue.Type has changed.");<a name="line.359"></a>
-<span class="sourceLineNo">360</span>      }<a name="line.360"></a>
-<span class="sourceLineNo">361</span>      return keyType;<a name="line.361"></a>
-<span class="sourceLineNo">362</span>    }<a name="line.362"></a>
-<span class="sourceLineNo">363</span>  }<a name="line.363"></a>
-<span class="sourceLineNo">364</span><a name="line.364"></a>
-<span class="sourceLineNo">365</span>  private void writeStoreFile(boolean useTags) throws IOException {<a name="line.365"></a>
-<span class="sourceLineNo">366</span>    Path storeFileParentDir = new Path(TEST_UTIL.getDataTestDir(),<a name="line.366"></a>
-<span class="sourceLineNo">367</span>        "test_cache_on_write");<a name="line.367"></a>
-<span class="sourceLineNo">368</span>    HFileContext meta = new HFileContextBuilder().withCompression(compress)<a name="line.368"></a>
-<span class="sourceLineNo">369</span>        .withBytesPerCheckSum(CKBYTES).withChecksumType(ChecksumType.NULL)<a name="line.369"></a>
-<span class="sourceLineNo">370</span>        .withBlockSize(DATA_BLOCK_SIZE)<a name="line.370"></a>
-<span class="sourceLineNo">371</span>        .withDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.371"></a>
-<span class="sourceLineNo">372</span>        .withIncludesTags(useTags).build();<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    StoreFileWriter sfw = new StoreFileWriter.Builder(conf, cacheConf, fs)<a name="line.373"></a>
-<span class="sourceLineNo">374</span>        .withOutputDir(storeFileParentDir).withComparator(CellComparator.COMPARATOR)<a name="line.374"></a>
-<span class="sourceLineNo">375</span>        .withFileContext(meta)<a name="line.375"></a>
-<span class="sourceLineNo">376</span>        .withBloomType(BLOOM_TYPE).withMaxKeyCount(NUM_KV).build();<a name="line.376"></a>
-<span class="sourceLineNo">377</span>    byte[] cf = Bytes.toBytes("fam");<a name="line.377"></a>
-<span class="sourceLineNo">378</span>    for (int i = 0; i &lt; NUM_KV; ++i) {<a name="line.378"></a>
-<span class="sourceLineNo">379</span>      byte[] row = RandomKeyValueUtil.randomOrderedKey(rand, i);<a name="line.379"></a>
-<span class="sourceLineNo">380</span>      byte[] qualifier = RandomKeyValueUtil.randomRowOrQualifier(rand);<a name="line.380"></a>
-<span class="sourceLineNo">381</span>      byte[] value = RandomKeyValueUtil.randomValue(rand);<a name="line.381"></a>
-<span class="sourceLineNo">382</span>      KeyValue kv;<a name="line.382"></a>
-<span class="sourceLineNo">383</span>      if(useTags) {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>        Tag t = new ArrayBackedTag((byte) 1, "visibility");<a name="line.384"></a>
-<span class="sourceLineNo">385</span>        List&lt;Tag&gt; tagList = new ArrayList&lt;&gt;();<a name="line.385"></a>
-<span class="sourceLineNo">386</span>        tagList.add(t);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>        Tag[] tags = new Tag[1];<a name="line.387"></a>
-<span class="sourceLineNo">388</span>        tags[0] = t;<a name="line.388"></a>
-<span class="sourceLineNo">389</span>        kv =<a name="line.389"></a>
-<span class="sourceLineNo">390</span>            new KeyValue(row, 0, row.length, cf, 0, cf.length, qualifier, 0, qualifier.length,<a name="line.390"></a>
-<span class="sourceLineNo">391</span>                rand.nextLong(), generateKeyType(rand), value, 0, value.length, tagList);<a name="line.391"></a>
-<span class="sourceLineNo">392</span>      } else {<a name="line.392"></a>
-<span class="sourceLineNo">393</span>        kv =<a name="line.393"></a>
-<span class="sourceLineNo">394</span>            new KeyValue(row, 0, row.length, cf, 0, cf.length, qualifier, 0, qualifier.length,<a name="line.394"></a>
-<span class="sourceLineNo">395</span>                rand.nextLong(), generateKeyType(rand), value, 0, value.length);<a name="line.395"></a>
-<span class="sourceLineNo">396</span>      }<a name="line.396"></a>
-<span class="sourceLineNo">397</span>      sfw.append(kv);<a name="line.397"></a>
-<span class="sourceLineNo">398</span>    }<a name="line.398"></a>
-<span class="sourceLineNo">399</span><a name="line.399"></a>
-<span class="sourceLineNo">400</span>    sfw.close();<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    storeFilePath = sfw.getPath();<a name="line.401"></a>
-<span class="sourceLineNo">402</span>  }<a name="line.402"></a>
-<span class="sourceLineNo">403</span><a name="line.403"></a>
-<span class="sourceLineNo">404</span>  private void testNotCachingDataBlocksDuringCompactionInternals(boolean useTags)<a name="line.404"></a>
-<span class="sourceLineNo">405</span>      throws IOException, InterruptedException {<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    // TODO: need to change this test if we add a cache size threshold for<a name="line.406"></a>
-<span class="sourceLineNo">407</span>    // compactions, or if we implement some other kind of intelligent logic for<a name="line.407"></a>
-<span class="sourceLineNo">408</span>    // deciding what blocks to cache-on-write on compaction.<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    final String table = "CompactionCacheOnWrite";<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    final String cf = "myCF";<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    final byte[] cfBytes = Bytes.toBytes(cf);<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    final int maxVersions = 3;<a name="line.412"></a>
-<span class="sourceLineNo">413</span>    Region region = TEST_UTIL.createTestRegion(table, <a name="line.413"></a>
-<span class="sourceLineNo">414</span>        new HColumnDescriptor(cf)<a name="line.414"></a>
-<span class="sourceLineNo">415</span>            .setCompressionType(compress)<a name="line.415"></a>
-<span class="sourceLineNo">416</span>            .setBloomFilterType(BLOOM_TYPE)<a name="line.416"></a>
-<span class="sourceLineNo">417</span>            .setMaxVersions(maxVersions)<a name="line.417"></a>
-<span class="sourceLineNo">418</span>            .setDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.418"></a>
-<span class="sourceLineNo">419</span>    );<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    int rowIdx = 0;<a name="line.420"></a>
-<span class="sourceLineNo">421</span>    long ts = EnvironmentEdgeManager.currentTime();<a name="line.421"></a>
-<span class="sourceLineNo">422</span>    for (int iFile = 0; iFile &lt; 5; ++iFile) {<a name="line.422"></a>
-<span class="sourceLineNo">423</span>      for (int iRow = 0; iRow &lt; 500; ++iRow) {<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        String rowStr = "" + (rowIdx * rowIdx * rowIdx) + "row" + iFile + "_" + <a name="line.424"></a>
-<span class="sourceLineNo">425</span>            iRow;<a name="line.425"></a>
-<span class="sourceLineNo">426</span>        Put p = new Put(Bytes.toBytes(rowStr));<a name="line.426"></a>
-<span class="sourceLineNo">427</span>        ++rowIdx;<a name="line.427"></a>
-<span class="sourceLineNo">428</span>        for (int iCol = 0; iCol &lt; 10; ++iCol) {<a name="line.428"></a>
-<span class="sourceLineNo">429</span>          String qualStr = "col" + iCol;<a name="line.429"></a>
-<span class="sourceLineNo">430</span>          String valueStr = "value_" + rowStr + "_" + qualStr;<a name="line.430"></a>
-<span class="sourceLineNo">431</span>          for (int iTS = 0; iTS &lt; 5; ++iTS) {<a name="line.431"></a>
-<span class="sourceLineNo">432</span>            if (useTags) {<a name="line.432"></a>
-<span class="sourceLineNo">433</span>              Tag t = new ArrayBackedTag((byte) 1, "visibility");<a name="line.433"></a>
-<span class="sourceLineNo">434</span>              Tag[] tags = new Tag[1];<a name="line.434"></a>
-<span class="sourceLineNo">435</span>              tags[0] = t;<a name="line.435"></a>
-<span class="sourceLineNo">436</span>              KeyValue kv = new KeyValue(Bytes.toBytes(rowStr), cfBytes, Bytes.toBytes(qualStr),<a name="line.436"></a>
-<span class="sourceLineNo">437</span>                  HConstants.LATEST_TIMESTAMP, Bytes.toBytes(valueStr), tags);<a name="line.437"></a>
-<span class="sourceLineNo">438</span>              p.add(kv);<a name="line.438"></a>
-<span class="sourceLineNo">439</span>            } else {<a name="line.439"></a>
-<span class="sourceLineNo">440</span>              p.addColumn(cfBytes, Bytes.toBytes(qualStr), ts++, Bytes.toBytes(valueStr));<a name="line.440"></a>
-<span class="sourceLineNo">441</span>            }<a name="line.441"></a>
-<span class="sourceLineNo">442</span>          }<a name="line.442"></a>
-<span class="sourceLineNo">443</span>        }<a name="line.443"></a>
-<span class="sourceLineNo">444</span>        p.setDurability(Durability.ASYNC_WAL);<a name="line.444"></a>
-<span class="sourceLineNo">445</span>        region.put(p);<a name="line.445"></a>
-<span class="sourceLineNo">446</span>      }<a name="line.446"></a>
-<span class="sourceLineNo">447</span>      region.flush(true);<a name="line.447"></a>
-<span class="sourceLineNo">448</span>    }<a name="line.448"></a>
-<span class="sourceLineNo">449</span>    clearBlockCache(blockCache);<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    assertEquals(0, blockCache.getBlockCount());<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    region.compact(false);<a name="line.451"></a>
-<span class="sourceLineNo">452</span>    LOG.debug("compactStores() returned");<a name="line.452"></a>
-<span class="sourceLineNo">453</span><a name="line.453"></a>
-<span class="sourceLineNo">454</span>    for (CachedBlock block: blockCache) {<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      assertNotEquals(BlockType.ENCODED_DATA, block.getBlockType());<a name="line.455"></a>
-<span class="sourceLineNo">456</span>      assertNotEquals(BlockType.DATA, block.getBlockType());<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    }<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    ((HRegion)region).close();<a name="line.458"></a>
-<span class="sourceLineNo">459</span>  }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>  @Test<a name="line.461"></a>
-<span class="sourceLineNo">462</span>  public void testStoreFileCacheOnWrite() throws IOException {<a name="line.462"></a>
-<span class="sourceLineNo">463</span>    testStoreFileCacheOnWriteInternals(false);<a name="line.463"></a>
-<span class="sourceLineNo">464</span>    testStoreFileCacheOnWriteInternals(true);<a name="line.464"></a>
-<span class="sourceLineNo">465</span>  }<a name="line.465"></a>
-<span class="sourceLineNo">466</span><a name="line.466"></a>
-<span class="sourceLineNo">467</span>  @Test<a name="line.467"></a>
-<span class="sourceLineNo">468</span>  public void testNotCachingDataBlocksDuringCompaction() throws IOException, InterruptedException {<a name="line.468"></a>
-<span class="sourceLineNo">469</span>    testNotCachingDataBlocksDuringCompactionInternals(false);<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    testNotCachingDataBlocksDuringCompactionInternals(true);<a name="line.470"></a>
-<span class="sourceLineNo">471</span>  }<a name="line.471"></a>
-<span class="sourceLineNo">472</span>}<a name="line.472"></a>
+<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.HBaseCommonTestingUtility;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.HColumnDescriptor;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.HConstants;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>import org.apache.hadoop.hbase.KeyValue;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>import org.apache.hadoop.hbase.Tag;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>import org.apache.hadoop.hbase.client.Durability;<a name="line.50"></a>
+<span class="sourceLineNo">051</span>import org.apache.hadoop.hbase.client.Put;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>import org.apache.hadoop.hbase.fs.HFileSystem;<a name="line.52"></a>
+<span class="sourceLineNo">053</span>import org.apache.hadoop.hbase.io.compress.Compression;<a name="line.53"></a>
+<span class="sourceLineNo">054</span>import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>import org.apache.hadoop.hbase.regionserver.BloomType;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>import org.apache.hadoop.hbase.regionserver.Region;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>import org.apache.hadoop.hbase.regionserver.StoreFileWriter;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>import org.apache.hadoop.hbase.testclassification.IOTests;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>import org.apache.hadoop.hbase.testclassification.MediumTests;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import org.apache.hadoop.hbase.util.BloomFilterFactory;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import org.apache.hadoop.hbase.util.ChecksumType;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.65"></a>
+<span class="sourceLineNo">066</span>import org.junit.After;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>import org.junit.AfterClass;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>import org.junit.Before;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>import org.junit.Test;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>import org.junit.experimental.categories.Category;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>import org.junit.runner.RunWith;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>import org.junit.runners.Parameterized;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>import org.junit.runners.Parameterized.Parameters;<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>/**<a name="line.77"></a>
+<span class="sourceLineNo">078</span> * Tests {@link HFile} cache-on-write functionality for the following block<a name="line.78"></a>
+<span class="sourceLineNo">079</span> * types: data blocks, non-root index blocks, and Bloom filter blocks.<a name="line.79"></a>
+<span class="sourceLineNo">080</span> */<a name="line.80"></a>
+<span class="sourceLineNo">081</span>@RunWith(Parameterized.class)<a name="line.81"></a>
+<span class="sourceLineNo">082</span>@Category({IOTests.class, MediumTests.class})<a name="line.82"></a>
+<span class="sourceLineNo">083</span>public class TestCacheOnWrite {<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>  private static final Log LOG = LogFactory.getLog(TestCacheOnWrite.class);<a name="line.85"></a>
+<span class="sourceLineNo">086</span><a name="line.86"></a>
+<span class="sourceLineNo">087</span>  private static final HBaseTestingUtility TEST_UTIL = HBaseTestingUtility.createLocalHTU();<a name="line.87"></a>
+<span class="sourceLineNo">088</span>  private Configuration conf;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>  private CacheConfig cacheConf;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>  private FileSystem fs;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  private Random rand = new Random(12983177L);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>  private Path storeFilePath;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>  private BlockCache blockCache;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  private String testDescription;<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>  private final CacheOnWriteType cowType;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>  private final Compression.Algorithm compress;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>  private final boolean cacheCompressedData;<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>  private static final int DATA_BLOCK_SIZE = 2048;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>  private static final int NUM_KV = 25000;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>  private static final int INDEX_BLOCK_SIZE = 512;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  private static final int BLOOM_BLOCK_SIZE = 4096;<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  private static final BloomType BLOOM_TYPE = BloomType.ROWCOL;<a name="line.104"></a>
+<span class="sourceLineNo">105</span>  private static final int CKBYTES = 512;<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>  /** The number of valid key types possible in a store file */<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  private static final int NUM_VALID_KEY_TYPES =<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      KeyValue.Type.values().length - 2;<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>  private static enum CacheOnWriteType {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    DATA_BLOCKS(CacheConfig.CACHE_BLOCKS_ON_WRITE_KEY,<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        BlockType.DATA, BlockType.ENCODED_DATA),<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    BLOOM_BLOCKS(CacheConfig.CACHE_BLOOM_BLOCKS_ON_WRITE_KEY,<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        BlockType.BLOOM_CHUNK),<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    INDEX_BLOCKS(CacheConfig.CACHE_INDEX_BLOCKS_ON_WRITE_KEY,<a name="line.116"></a>
+<span class="sourceLineNo">117</span>        BlockType.LEAF_INDEX, BlockType.INTERMEDIATE_INDEX);<a name="line.117"></a>
+<span class="sourceLineNo">118</span><a name="line.118"></a>
+<span class="sourceLineNo">119</span>    private final String confKey;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    private final BlockType blockType1;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    private final BlockType blockType2;<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>    private CacheOnWriteType(String confKey, BlockType blockType) {<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      this(confKey, blockType, blockType);<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    }<a name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>    private CacheOnWriteType(String confKey, BlockType blockType1,<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        BlockType blockType2) {<a name="line.128"></a>
+<span class="sourceLineNo">129</span>      this.blockType1 = blockType1;<a name="line.129"></a>
+<span class="sourceLineNo">130</span>      this.blockType2 = blockType2;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>      this.confKey = confKey;<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    }<a name="line.132"></a>
+<span class="sourceLineNo">133</span><a name="line.133"></a>
+<span class="sourceLineNo">134</span>    public boolean shouldBeCached(BlockType blockType) {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      return blockType == blockType1 || blockType == blockType2;<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    }<a name="line.136"></a>
+<span class="sourceLineNo">137</span><a name="line.137"></a>
+<span class="sourceLineNo">138</span>    public void modifyConf(Configuration conf) {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      for (CacheOnWriteType cowType : CacheOnWriteType.values()) {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        conf.setBoolean(cowType.confKey, cowType == this);<a name="line.140"></a>
+<span class="sourceLineNo">141</span>      }<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    }<a name="line.142"></a>
+<span class="sourceLineNo">143</span>  }<a name="line.143"></a>
+<span class="sourceLineNo">144</span><a name="line.144"></a>
+<span class="sourceLineNo">145</span>  public TestCacheOnWrite(CacheOnWriteType cowType, Compression.Algorithm compress,<a name="line.145"></a>
+<span class="sourceLineNo">146</span>      boolean cacheCompressedData, BlockCache blockCache) {<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    this.cowType = cowType;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    this.compress = compress;<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    this.cacheCompressedData = cacheCompressedData;<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    this.blockCache = blockCache;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    testDescription = "[cacheOnWrite=" + cowType + ", compress=" + compress +<a name="line.151"></a>
+<span class="sourceLineNo">152</span>        ", cacheCompressedData=" + cacheCompressedData + "]";<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    LOG.info(testDescription);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>  }<a name="line.154"></a>
+<span class="sourceLineNo">155</span><a name="line.155"></a>
+<span class="sourceLineNo">156</span>  private static List&lt;BlockCache&gt; getBlockCaches() throws IOException {<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    Configuration conf = TEST_UTIL.getConfiguration();<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    List&lt;BlockCache&gt; blockcaches = new ArrayList&lt;&gt;();<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    // default<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    blockcaches.add(new CacheConfig(conf).getBlockCache());<a name="line.160"></a>
+<span class="sourceLineNo">161</span><a name="line.161"></a>
+<span class="sourceLineNo">162</span>    //set LruBlockCache.LRU_HARD_CAPACITY_LIMIT_FACTOR_CONFIG_NAME to 2.0f due to HBASE-16287<a name="line.162"></a>
+<span class="sourceLineNo">163</span>    TEST_UTIL.getConfiguration().setFloat(LruBlockCache.LRU_HARD_CAPACITY_LIMIT_FACTOR_CONFIG_NAME, 2.0f);<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    // memory<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    BlockCache lru = new LruBlockCache(128 * 1024 * 1024, 64 * 1024, TEST_UTIL.getConfiguration());<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    blockcaches.add(lru);<a name="line.166"></a>
+<span class="sourceLineNo">167</span><a name="line.167"></a>
+<span class="sourceLineNo">168</span>    // bucket cache<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    FileSystem.get(conf).mkdirs(TEST_UTIL.getDataTestDir());<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    int[] bucketSizes =<a name="line.170"></a>
+<span class="sourceLineNo">171</span>        { INDEX_BLOCK_SIZE, DATA_BLOCK_SIZE, BLOOM_BLOCK_SIZE, 64 * 1024, 128 * 1024 };<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    BlockCache bucketcache =<a name="line.172"></a>
+<span class="sourceLineNo">173</span>        new BucketCache("offheap", 128 * 1024 * 1024, 64 * 1024, bucketSizes, 5, 64 * 100, null);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    blockcaches.add(bucketcache);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    return blockcaches;<a name="line.175"></a>
+<span class="sourceLineNo">176</span>  }<a name="line.176"></a>
+<span class="sourceLineNo">177</span><a name="line.177"></a>
+<span class="sourceLineNo">178</span>  @Parameters<a name="line.178"></a>
+<span class="sourceLineNo">179</span>  public static Collection&lt;Object[]&gt; getParameters() throws IOException {<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    List&lt;Object[]&gt; params = new ArrayList&lt;&gt;();<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    for (BlockCache blockCache : getBlockCaches()) {<a name="line.181"></a>
+<span class="sourceLineNo">182</span>      for (CacheOnWriteType cowType : CacheOnWriteType.values()) {<a name="line.182"></a>
+<span class="sourceLineNo">183</span>        for (Compression.Algorithm compress : HBaseCommonTestingUtility.COMPRESSION_ALGORITHMS) {<a name="line.183"></a>
+<span class="sourceLineNo">184</span>          for (boolean cacheCompressedData : new boolean[] { false, true }) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>            params.add(new Object[] { cowType, compress, cacheCompressedData, blockCache });<a name="line.185"></a>
+<span class="sourceLineNo">186</span>          }<a name="line.186"></a>
+<span class="sourceLineNo">187</span>        }<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      }<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    }<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    return params;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>  }<a name="line.191"></a>
+<span class="sourceLineNo">192</span><a name="line.192"></a>
+<span class="sourceLineNo">193</span>  private void clearBlockCache(BlockCache blockCache) throws InterruptedException {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    if (blockCache instanceof LruBlockCache) {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>      ((LruBlockCache) blockCache).clearCache();<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    } else {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      // BucketCache may not return all cached blocks(blocks in write queue), so check it here.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>      for (int clearCount = 0; blockCache.getBlockCount() &gt; 0; clearCount++) {<a name="line.198"></a>
+<span class="sourceLineNo">199</span>        if (clearCount &gt; 0) {<a name="line.199"></a>
+<span class="sourceLineNo">200</span>          LOG.warn("clear block cache " + blockCache + " " + clearCount + " times, "<a name="line.200"></a>
+<span class="sourceLineNo">201</span>              + blockCache.getBlockCount() + " blocks remaining");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>          Thread.sleep(10);<a name="line.202"></a>
+<span class="sourceLineNo">203</span>        }<a name="line.203"></a>
+<span class="sourceLineNo">204</span>        for (CachedBlock block : Lists.newArrayList(blockCache)) {<a name="line.204"></a>
+<span class="sourceLineNo">205</span>          BlockCacheKey key = new BlockCacheKey(block.getFilename(), block.getOffset());<a name="line.205"></a>
+<span class="sourceLineNo">206</span>          // CombinedBucketCache may need evict two times.<a name="line.206"></a>
+<span class="sourceLineNo">207</span>          for (int evictCount = 0; blockCache.evictBlock(key); evictCount++) {<a name="line.207"></a>
+<span class="sourceLineNo">208</span>            if (evictCount &gt; 1) {<a name="line.208"></a>
+<span class="sourceLineNo">209</span>              LOG.warn("evict block " + block + " in " + blockCache + " " + evictCount<a name="line.209"></a>
+<span class="sourceLineNo">210</span>                  + " times, maybe a bug here");<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            }<a name="line.211"></a>
+<span class="sourceLineNo">212</span>          }<a name="line.212"></a>
+<span class="sourceLineNo">213</span>        }<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      }<a name="line.214"></a>
+<span class="sourceLineNo">215</span>    }<a name="line.215"></a>
+<span class="sourceLineNo">216</span>  }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>  @Before<a name="line.218"></a>
+<span class="sourceLineNo">219</span>  public void setUp() throws IOException {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    conf = TEST_UTIL.getConfiguration();<a name="line.220"></a>
+<span class="sourceLineNo">221</span>    this.conf.set("dfs.datanode.data.dir.perm", "700");<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    conf.setInt(HFileBlockIndex.MAX_CHUNK_SIZE_KEY, INDEX_BLOCK_SIZE);<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    conf.setInt(BloomFilterFactory.IO_STOREFILE_BLOOM_BLOCK_SIZE,<a name="line.223"></a>
+<span class="sourceLineNo">224</span>        BLOOM_BLOCK_SIZE);<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    conf.setBoolean(CacheConfig.CACHE_DATA_BLOCKS_COMPRESSED_KEY, cacheCompressedData);<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    cowType.modifyConf(conf);<a name="line.226"></a>
+<span class="sourceLineNo">227</span>    fs = HFileSystem.get(conf);<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    CacheConfig.GLOBAL_BLOCK_CACHE_INSTANCE = blockCache;<a name="line.228"></a>
+<span class="sourceLineNo">229</span>    cacheConf =<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        new CacheConfig(blockCache, true, true, cowType.shouldBeCached(BlockType.DATA),<a name="line.230"></a>
+<span class="sourceLineNo">231</span>        cowType.shouldBeCached(BlockType.LEAF_INDEX),<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        cowType.shouldBeCached(BlockType.BLOOM_CHUNK), false, cacheCompressedData,<a name="line.232"></a>
+<span class="sourceLineNo">233</span>            false, false, false);<a name="line.233"></a>
+<span class="sourceLineNo">234</span>  }<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>  @After<a name="line.236"></a>
+<span class="sourceLineNo">237</span>  public void tearDown() throws IOException, InterruptedException {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>    clearBlockCache(blockCache);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>  }<a name="line.239"></a>
+<span class="sourceLineNo">240</span><a name="line.240"></a>
+<span class="sourceLineNo">241</span>  @AfterClass<a name="line.241"></a>
+<span class="sourceLineNo">242</span>  public static void afterClass() throws IOException {<a name="line.242"></a>
+<span class="sourceLineNo">243</span>    TEST_UTIL.cleanupTestDir();<a name="line.243"></a>
+<span class="sourceLineNo">244</span>  }<a name="line.244"></a>
+<span class="sourceLineNo">245</span><a name="line.245"></a>
+<span class="sourceLineNo">246</span>  private void testStoreFileCacheOnWriteInternals(boolean useTags) throws IOException {<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    writeStoreFile(useTags);<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    readStoreFile(useTags);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>  }<a name="line.249"></a>
+<span class="sourceLineNo">250</span><a name="line.250"></a>
+<span class="sourceLineNo">251</span>  private void readStoreFile(boolean useTags) throws IOException {<a name="line.251"></a>
+<span class="sourceLineNo">252</span>    HFile.Reader reader = HFile.createReader(fs, storeFilePath, cacheConf, true, conf);<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    LOG.info("HFile information: " + reader);<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    HFileContext meta = new HFileContextBuilder().withCompression(compress)<a name="line.254"></a>
+<span class="sourceLineNo">255</span>      .withBytesPerCheckSum(CKBYTES).withChecksumType(ChecksumType.NULL)<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      .withBlockSize(DATA_BLOCK_SIZE)<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      .withDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.257"></a>
+<span class="sourceLineNo">258</span>      .withIncludesTags(useTags).build();<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    final boolean cacheBlocks = false;<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    final boolean pread = false;<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    HFileScanner scanner = reader.getScanner(cacheBlocks, pread);<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    assertTrue(testDescription, scanner.seekTo());<a name="line.262"></a>
+<span class="sourceLineNo">263</span><a name="line.263"></a>
+<span class="sourceLineNo">264</span>    long offset = 0;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    EnumMap&lt;BlockType, Integer&gt; blockCountByType = new EnumMap&lt;&gt;(BlockType.class);<a name="line.265"></a>
+<span class="sourceLineNo">266</span><a name="line.266"></a>
+<span class="sourceLineNo">267</span>    DataBlockEncoding encodingInCache = NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding();<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    List&lt;Long&gt; cachedBlocksOffset = new ArrayList&lt;&gt;();<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    Map&lt;Long, HFileBlock&gt; cachedBlocks = new HashMap&lt;&gt;();<a name="line.269"></a>
+<span class="sourceLineNo">270</span>    while (offset &lt; reader.getTrailer().getLoadOnOpenDataOffset()) {<a name="line.270"></a>
+<span class="sourceLineNo">271</span>      // Flags: don't cache the block, use pread, this is not a compaction.<a name="line.271"></a>
+<span class="sourceLineNo">272</span>      // Also, pass null for expected block type to avoid checking it.<a name="line.272"></a>
+<span class="sourceLineNo">273</span>      HFileBlock block = reader.readBlock(offset, -1, false, true, false, true, null,<a name="line.273"></a>
+<span class="sourceLineNo">274</span>          encodingInCache);<a name="line.274"></a>
+<span class="sourceLineNo">275</span>      BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),<a name="line.275"></a>
+<span class="sourceLineNo">276</span>          offset);<a name="line.276"></a>
+<span class="sourceLineNo">277</span>      HFileBlock fromCache = (HFileBlock) blockCache.getBlock(blockCacheKey, true, false, true);<a name="line.277"></a>
+<span class="sourceLineNo">278</span>      boolean isCached = fromCache != null;<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      cachedBlocksOffset.add(offset);<a name="line.279"></a>
+<span class="sourceLineNo">280</span>      cachedBlocks.put(offset, fromCache);<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());<a name="line.281"></a>
+<span class="sourceLineNo">282</span>      assertTrue("shouldBeCached: " + shouldBeCached+ "\n" +<a name="line.282"></a>
+<span class="sourceLineNo">283</span>          "isCached: " + isCached + "\n" +<a name="line.283"></a>
+<span class="sourceLineNo">284</span>          "Test description: " + testDescription + "\n" +<a name="line.284"></a>
+<span class="sourceLineNo">285</span>          "block: " + block + "\n" +<a name="line.285"></a>
+<span class="sourceLineNo">286</span>          "encodingInCache: " + encodingInCache + "\n" +<a name="line.286"></a>
+<span class="sourceLineNo">287</span>          "blockCacheKey: " + blockCacheKey,<a name="line.287"></a>
+<span class="sourceLineNo">288</span>        shouldBeCached == isCached);<a name="line.288"></a>
+<span class="sourceLineNo">289</span>      if (isCached) {<a name="line.289"></a>
+<span class="sourceLineNo">290</span>        if (cacheConf.shouldCacheCompressed(fromCache.getBlockType().getCategory())) {<a name="line.290"></a>
+<span class="sourceLineNo">291</span>          if (compress != Compression.Algorithm.NONE) {<a name="line.291"></a>
+<span class="sourceLineNo">292</span>            assertFalse(fromCache.isUnpacked());<a name="line.292"></a>
+<span class="sourceLineNo">293</span>          }<a name="line.293"></a>
+<span class="sourceLineNo">294</span>          fromCache = fromCache.unpack(meta, reader.getUncachedBlockReader());<a name="line.294"></a>
+<span class="sourceLineNo">295</span>        } else {<a name="line.295"></a>
+<span class="sourceLineNo">296</span>          assertTrue(fromCache.isUnpacked());<a name="line.296"></a>
+<span class="sourceLineNo">297</span>        }<a name="line.297"></a>
+<span class="sourceLineNo">298</span>        // block we cached at write-time and block read from file should be identical<a name="line.298"></a>
+<span class="sourceLineNo">299</span>        assertEquals(block.getChecksumType(), fromCache.getChecksumType());<a name="line.299"></a>
+<span class="sourceLineNo">300</span>        assertEquals(block.getBlockType(), fromCache.getBlockType());<a name="line.300"></a>
+<span class="sourceLineNo">301</span>        assertNotEquals(block.getBlockType(), BlockType.ENCODED_DATA);<a name="line.301"></a>
+<span class="sourceLineNo">302</span>        assertEquals(block.getOnDiskSizeWithHeader(), fromCache.getOnDiskSizeWithHeader());<a name="line.302"></a>
+<span class="sourceLineNo">303</span>        assertEquals(block.getOnDiskSizeWithoutHeader(), fromCache.getOnDiskSizeWithoutHeader());<a name="line.303"></a>
+<span class="sourceLineNo">304</span>        assertEquals(<a name="line.304"></a>
+<span class="sourceLineNo">305</span>          block.getUncompressedSizeWithoutHeader(), fromCache.getUncompressedSizeWithoutHeader());<a name="line.305"></a>
+<span class="sourceLineNo">306</span>      }<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      offset += block.getOnDiskSizeWithHeader();<a name="line.307"></a>
+<span class="sourceLineNo">308</span>      BlockType bt = block.getBlockType();<a name="line.308"></a>
+<span class="sourceLineNo">309</span>      Integer count = blockCountByType.get(bt);<a name="line.309"></a>
+<span class="sourceLineNo">310</span>      blockCountByType.put(bt, (count == null ? 0 : count) + 1);<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    }<a name="line.311"></a>
+<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">313</span>    LOG.info("Block count by type: " + blockCountByType);<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    String countByType = blockCountByType.toString();<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    if (useTags) {<a name="line.315"></a>
+<span class="sourceLineNo">316</span>      assertEquals("{" + BlockType.DATA<a name="line.316"></a>
+<span class="sourceLineNo">317</span>          + "=2663, LEAF_INDEX=297, BLOOM_CHUNK=9, INTERMEDIATE_INDEX=32}", countByType);<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    } else {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>      assertEquals("{" + BlockType.DATA<a name="line.319"></a>
+<span class="sourceLineNo">320</span>          + "=2498, LEAF_INDEX=278, BLOOM_CHUNK=9, INTERMEDIATE_INDEX=31}", countByType);<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    }<a name="line.321"></a>
+<span class="sourceLineNo">322</span><a name="line.322"></a>
+<span class="sourceLineNo">323</span>    // iterate all the keyvalue from hfile<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    while (scanner.next()) {<a name="line.324"></a>
+<span class="sourceLineNo">325</span>      scanner.getCell();<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    }<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    Iterator&lt;Long&gt; iterator = cachedBlocksOffset.iterator();<a name="line.327"></a>
+<span class="sourceLineNo">328</span>    while(iterator.hasNext()) {<a name="line.328"></a>
+<span class="sourceLineNo">329</span>      Long entry = iterator.next();<a name="line.329"></a>
+<span class="sourceLineNo">330</span>      BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),<a name="line.330"></a>
+<span class="sourceLineNo">331</span>          entry);<a name="line.331"></a>
+<span class="sourceLineNo">332</span>      HFileBlock hFileBlock = cachedBlocks.get(entry);<a name="line.332"></a>
+<span class="sourceLineNo">333</span>      if (hFileBlock != null) {<a name="line.333"></a>
+<span class="sourceLineNo">334</span>        // call return twice because for the isCache cased the counter would have got incremented<a name="line.334"></a>
+<span class="sourceLineNo">335</span>        // twice<a name="line.335"></a>
+<span class="sourceLineNo">336</span>        blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.336"></a>
+<span class="sourceLineNo">337</span>        if(cacheCompressedData) {<a name="line.337"></a>
+<span class="sourceLineNo">338</span>          if (this.compress == Compression.Algorithm.NONE<a name="line.338"></a>
+<span class="sourceLineNo">339</span>              || cowType == CacheOnWriteType.INDEX_BLOCKS<a name="line.339"></a>
+<span class="sourceLineNo">340</span>              || cowType == CacheOnWriteType.BLOOM_BLOCKS) {<a name="line.340"></a>
+<span class="sourceLineNo">341</span>            blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>          }<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        } else {<a name="line.343"></a>
+<span class="sourceLineNo">344</span>          blockCache.returnBlock(blockCacheKey, hFileBlock);<a name="line.344"></a>
+<span class="sourceLineNo">345</span>        }<a name="line.345"></a>
+<span class="sourceLineNo">346</span>      }<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    }<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    scanner.shipped();<a name="line.348"></a>
+<span class="sourceLineNo">349</span>    reader.close();<a name="line.349"></a>
+<span class="sourceLineNo">350</span>  }<a name="line.350"></a>
+<span class="sourceLineNo">351</span><a name="line.351"></a>
+<span class="sourceLineNo">352</span>  public static KeyValue.Type generateKeyType(Random rand) {<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    if (rand.nextBoolean()) {<a name="line.353"></a>
+<span class="sourceLineNo">354</span>      // Let's make half of KVs puts.<a name="line.354"></a>
+<span class="sourceLineNo">355</span>      return KeyValue.Type.Put;<a name="line.355"></a>
+<span class="sourceLineNo">356</span>    } else {<a name="line.356"></a>
+<span class="sourceLineNo">357</span>      KeyValue.Type keyType = KeyValue.Type.values()[1 + rand.nextInt(NUM_VALID_KEY_TYPES)];<a name="line.357"></a>
+<span class="sourceLineNo">358</span>      if (keyType == KeyValue.Type.Minimum || keyType == KeyValue.Type.Maximum) {<a name="line.358"></a>
+<span class="sourceLineNo">359</span>        throw new RuntimeException("Generated an invalid key type: " + keyType + ". "<a name="line.359"></a>
+<span class="sourceLineNo">360</span>            + "Probably the layout of KeyValue.Type has changed.");<a name="line.360"></a>
+<span class="sourceLineNo">361</span>      }<a name="line.361"></a>
+<span class="sourceLineNo">362</span>      return keyType;<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    }<a name="line.363"></a>
+<span class="sourceLineNo">364</span>  }<a name="line.364"></a>
+<span class="sourceLineNo">365</span><a name="line.365"></a>
+<span class="sourceLineNo">366</span>  private void writeStoreFile(boolean useTags) throws IOException {<a name="line.366"></a>
+<span class="sourceLineNo">367</span>    Path storeFileParentDir = new Path(TEST_UTIL.getDataTestDir(),<a name="line.367"></a>
+<span class="sourceLineNo">368</span>        "test_cache_on_write");<a name="line.368"></a>
+<span class="sourceLineNo">369</span>    HFileContext meta = new HFileContextBuilder().withCompression(compress)<a name="line.369"></a>
+<span class="sourceLineNo">370</span>        .withBytesPerCheckSum(CKBYTES).withChecksumType(ChecksumType.NULL)<a name="line.370"></a>
+<span class="sourceLineNo">371</span>        .withBlockSize(DATA_BLOCK_SIZE)<a name="line.371"></a>
+<span class="sourceLineNo">372</span>        .withDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.372"></a>
+<span class="sourceLineNo">373</span>        .withIncludesTags(useTags).build();<a name="line.373"></a>
+<span class="sourceLineNo">374</span>    StoreFileWriter sfw = new StoreFileWriter.Builder(conf, cacheConf, fs)<a name="line.374"></a>
+<span class="sourceLineNo">375</span>        .withOutputDir(storeFileParentDir).withComparator(CellComparator.COMPARATOR)<a name="line.375"></a>
+<span class="sourceLineNo">376</span>        .withFileContext(meta)<a name="line.376"></a>
+<span class="sourceLineNo">377</span>        .withBloomType(BLOOM_TYPE).withMaxKeyCount(NUM_KV).build();<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    byte[] cf = Bytes.toBytes("fam");<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    for (int i = 0; i &lt; NUM_KV; ++i) {<a name="line.379"></a>
+<span class="sourceLineNo">380</span>      byte[] row = RandomKeyValueUtil.randomOrderedKey(rand, i);<a name="line.380"></a>
+<span class="sourceLineNo">381</span>      byte[] qualifier = RandomKeyValueUtil.randomRowOrQualifier(rand);<a name="line.381"></a>
+<span class="sourceLineNo">382</span>      byte[] value = RandomKeyValueUtil.randomValue(rand);<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      KeyValue kv;<a name="line.383"></a>
+<span class="sourceLineNo">384</span>      if(useTags) {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>        Tag t = new ArrayBackedTag((byte) 1, "visibility");<a name="line.385"></a>
+<span class="sourceLineNo">386</span>        List&lt;Tag&gt; tagList = new ArrayList&lt;&gt;();<a name="line.386"></a>
+<span class="sourceLineNo">387</span>        tagList.add(t);<a name="line.387"></a>
+<span class="sourceLineNo">388</span>        Tag[] tags = new Tag[1];<a name="line.388"></a>
+<span class="sourceLineNo">389</span>        tags[0] = t;<a name="line.389"></a>
+<span class="sourceLineNo">390</span>        kv =<a name="line.390"></a>
+<span class="sourceLineNo">391</span>            new KeyValue(row, 0, row.length, cf, 0, cf.length, qualifier, 0, qualifier.length,<a name="line.391"></a>
+<span class="sourceLineNo">392</span>                rand.nextLong(), generateKeyType(rand), value, 0, value.length, tagList);<a name="line.392"></a>
+<span class="sourceLineNo">393</span>      } else {<a name="line.393"></a>
+<span class="sourceLineNo">394</span>        kv =<a name="line.394"></a>
+<span class="sourceLineNo">395</span>            new KeyValue(row, 0, row.length, cf, 0, cf.length, qualifier, 0, qualifier.length,<a name="line.395"></a>
+<span class="sourceLineNo">396</span>                rand.nextLong(), generateKeyType(rand), value, 0, value.length);<a name="line.396"></a>
+<span class="sourceLineNo">397</span>      }<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      sfw.append(kv);<a name="line.398"></a>
+<span class="sourceLineNo">399</span>    }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>    sfw.close();<a name="line.401"></a>
+<span class="sourceLineNo">402</span>    storeFilePath = sfw.getPath();<a name="line.402"></a>
+<span class="sourceLineNo">403</span>  }<a name="line.403"></a>
+<span class="sourceLineNo">404</span><a name="line.404"></a>
+<span class="sourceLineNo">405</span>  private void testNotCachingDataBlocksDuringCompactionInternals(boolean useTags)<a name="line.405"></a>
+<span class="sourceLineNo">406</span>      throws IOException, InterruptedException {<a name="line.406"></a>
+<span class="sourceLineNo">407</span>    // TODO: need to change this test if we add a cache size threshold for<a name="line.407"></a>
+<span class="sourceLineNo">408</span>    // compactions, or if we implement some other kind of intelligent logic for<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    // deciding what blocks to cache-on-write on compaction.<a name="line.409"></a>
+<span class="sourceLineNo">410</span>    final String table = "CompactionCacheOnWrite";<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    final String cf = "myCF";<a name="line.411"></a>
+<span class="sourceLineNo">412</span>    final byte[] cfBytes = Bytes.toBytes(cf);<a name="line.412"></a>
+<span class="sourceLineNo">413</span>    final int maxVersions = 3;<a name="line.413"></a>
+<span class="sourceLineNo">414</span>    Region region = TEST_UTIL.createTestRegion(table, <a name="line.414"></a>
+<span class="sourceLineNo">415</span>        new HColumnDescriptor(cf)<a name="line.415"></a>
+<span class="sourceLineNo">416</span>            .setCompressionType(compress)<a name="line.416"></a>
+<span class="sourceLineNo">417</span>            .setBloomFilterType(BLOOM_TYPE)<a name="line.417"></a>
+<span class="sourceLineNo">418</span>            .setMaxVersions(maxVersions)<a name="line.418"></a>
+<span class="sourceLineNo">419</span>            .setDataBlockEncoding(NoOpDataBlockEncoder.INSTANCE.getDataBlockEncoding())<a name="line.419"></a>
+<span class="sourceLineNo">420</span>    );<a name="line.420"></a>
+<span class="sourceLineNo">421</span>    int rowIdx = 0;<a name="line.421"></a>
+<span class="sourceLineNo">422</span>    long ts = EnvironmentEdgeManager.currentTime();<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    for (int iFile = 0; iFile &lt; 5; ++iFile) {<a name="line.423"></a>
+<span class="sourceLineNo">424</span>      for (int iRow = 0; iRow &lt; 500; ++iRow) {<a name="line.424"></a>
+<span class="sourceLineNo">425</span>        String rowStr = "" + (rowIdx * rowIdx * rowIdx) + "row" + iFile + "_" + <a name="line.425"></a>
+<span class="sourceLineNo">426</span>            iRow;<a name="line.426"></a>
+<span class="sourceLineNo">427</span>        Put p = new Put(Bytes.toBytes(rowStr));<a name="line.427"></a>
+<span class="sourceLineNo">428</span>        ++rowIdx;<a name="line.428"></a>
+<span class="sourceLineNo">429</span>        for (int iCol = 0; iCol &lt; 10; ++iCol) {<a name="line.429"></a>
+<span class="sourceLineNo">430</span>          String qualStr = "col" + iCol;<a name="line.430"></a>
+<span class="sourceLineNo">431</span>          String valueStr = "value_" + rowStr + "_" + qualStr;<a name="line.431"></a>
+<span class="sourceLineNo">432</span>          for (int iTS = 0; iTS &lt; 5; ++iTS) {<a name="line.432"></a>
+<span class="sourceLineNo">433</span>            if (useTags) {<a name="line.433"></a>
+<span class="sourceLineNo">434</span>              Tag t = new ArrayBackedTag((byte) 1, "visibility");<a name="line.434"></a>
+<span class="sourceLineNo">435</span>              Tag[] tags = new Tag[1];<a name="line.435"></a>
+<span class="sourceLineNo">436</span>              tags[0] = t;<a name="line.436"></a>
+<span class="sourceLineNo">437</span>              KeyValue kv = new KeyValue(Bytes.toBytes(rowStr), cfBytes, Bytes.toBytes(qualStr),<a name="line.437"></a>
+<span class="sourceLineNo">438</span>                  HConstants.LATEST_TIMESTAMP, Bytes.toBytes(valueStr), tags);<a name="line.438"></a>
+<span class="sourceLineNo">439</span>              p.add(kv);<a name="line.439"></a>
+<span class="sourceLineNo">440</span>            } else {<a name="line.440"></a>
+<span class="sourceLineNo">441</span>              p.addColumn(cfBytes, Bytes.toBytes(qualStr), ts++, Bytes.toBytes(valueStr));<a name="line.441"></a>
+<span class="sourceLineNo">442</span>            }<a name="line.442"></a>
+<span class="sourceLineNo">443</span>          }<a name="line.443"></a>
+<span class="sourceLineNo">444</span>        }<a name="line.444"></a>
+<span class="sourceLineNo">445</span>        p.setDurability(Durability.ASYNC_WAL);<a name="line.445"></a>
+<span class="sourceLineNo">446</span>        region.put(p);<a name="line.446"></a>
+<span class="sourceLineNo">447</span>      }<a name="line.447"></a>
+<span class="sourceLineNo">448</span>      region.flush(true);<a name="line.448"></a>
+<span class="sourceLineNo">449</span>    }<a name="line.449"></a>
+<span class="sourceLineNo">450</span>    clearBlockCache(blockCache);<a name="line.450"></a>
+<span class="sourceLineNo">451</span>    assertEquals(0, blockCache.getBlockCount());<a name="line.451"></a>
+<span class="sourceLineNo">452</span>    region.compact(false);<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    LOG.debug("compactStores() returned");<a name="line.453"></a>
+<span class="sourceLineNo">454</span><a name="line.454"></a>
+<span class="sourceLineNo">455</span>    for (CachedBlock block: blockCache) {<a name="line.455"></a>
+<span class="sourceLineNo">456</span>      assertNotEquals(BlockType.ENCODED_DATA, block.getBlockType());<a name="line.456"></a>
+<span class="sourceLineNo">457</span>      assertNotEquals(BlockType.DATA, block.getBlockType());<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    }<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    ((HRegion)region).close();<a name="line.459"></a>
+<span class="sourceLineNo">460</span>  }<a name="line.460"></a>
+<span class="sourceLineNo">461</span><a name="line.461"></a>
+<span class="sourceLineNo">462</span>  @Test<a name="line.462"></a>
+<span class="sourceLineNo">463</span>  public void testStoreFileCacheOnWrite() throws IOException {<a name="line.463"></a>
+<span class="sourceLineNo">464</span>    testStoreFileCacheOnWriteInternals(false);<a name="line.464"></a>
+<span class="sourceLineNo">465</span>    testStoreFileCacheOnWriteInternals(true);<a name="line.465"></a>
+<span class="sourceLineNo">466</span>  }<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>  @Test<a name="line.468"></a>
+<span class="sourceLineNo">469</span>  public void testNotCachingDataBlocksDuringCompaction() throws IOException, InterruptedException {<a name="line.469"></a>
+<span class="sourceLineNo">470</span>    testNotCachingDataBlocksDuringCompactionInternals(false);<a name="line.470"></a>
+<span class="sourceLineNo">471</span>    testNotCachingDataBlocksDuringCompactionInternals(true);<a name="line.471"></a>
+<span class="sourceLineNo">472</span>  }<a name="line.472"></a>
+<span class="sourceLineNo">473</span>}<a name="line.473"></a>
 
 
 


Mime
View raw message