use of org.apache.hadoop.hbase.io.hfile.IndexOnlyLruBlockCache in project hbase by apache.
the class TestClientSideRegionScanner method testDefaultBlockCache.
@Test
public void testDefaultBlockCache() throws IOException {
Configuration copyConf = new Configuration(conf);
ClientSideRegionScanner clientSideRegionScanner = new ClientSideRegionScanner(copyConf, fs, rootDir, htd, hri, scan, null);
BlockCache blockCache = clientSideRegionScanner.getRegion().getBlockCache();
assertNotNull(blockCache);
assertTrue(blockCache instanceof IndexOnlyLruBlockCache);
assertTrue(HConstants.HBASE_CLIENT_SCANNER_ONHEAP_BLOCK_CACHE_FIXED_SIZE_DEFAULT == blockCache.getMaxSize());
}
use of org.apache.hadoop.hbase.io.hfile.IndexOnlyLruBlockCache in project hbase by apache.
the class TestClientSideRegionScanner method testConfiguredBlockCache.
@Test
public void testConfiguredBlockCache() throws IOException {
Configuration copyConf = new Configuration(conf);
// tiny 1MB fixed cache size
long blockCacheFixedSize = 1024 * 1024L;
copyConf.setLong(HConstants.HFILE_ONHEAP_BLOCK_CACHE_FIXED_SIZE_KEY, blockCacheFixedSize);
ClientSideRegionScanner clientSideRegionScanner = new ClientSideRegionScanner(copyConf, fs, rootDir, htd, hri, scan, null);
BlockCache blockCache = clientSideRegionScanner.getRegion().getBlockCache();
assertNotNull(blockCache);
assertTrue(blockCache instanceof IndexOnlyLruBlockCache);
assertTrue(blockCacheFixedSize == blockCache.getMaxSize());
}
Aggregations