@Test
  public void testGetOnHeapCacheSize() {
    Configuration copyConf = new Configuration(conf);
    long fixedSize = 1024 * 1024L;
    long onHeapCacheSize = MemorySizeUtil.getOnHeapCacheSize(copyConf);
    assertEquals(null, copyConf.get(HConstants.HFILE_ONHEAP_BLOCK_CACHE_FIXED_SIZE_KEY));
    assertTrue(onHeapCacheSize > 0 && onHeapCacheSize != fixedSize);
    // when HBASE_BLOCK_CACHE_MEMORY_SIZE is set in number
    copyConf.setLong(HConstants.HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY, 3 * 1024 * 1024);
    onHeapCacheSize = MemorySizeUtil.getOnHeapCacheSize(copyConf);
    assertEquals(3 * 1024 * 1024, onHeapCacheSize);
    // when HBASE_BLOCK_CACHE_MEMORY_SIZE is set in human-readable format
    copyConf.set(HConstants.HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY, "2m");
    onHeapCacheSize = MemorySizeUtil.getOnHeapCacheSize(copyConf);
    assertEquals(2 * 1024 * 1024, onHeapCacheSize);
    // when HBASE_BLOCK_CACHE_FIXED_SIZE_KEY is set, it will be a fixed size
    copyConf.setLong(HConstants.HFILE_ONHEAP_BLOCK_CACHE_FIXED_SIZE_KEY, fixedSize);
    onHeapCacheSize = MemorySizeUtil.getOnHeapCacheSize(copyConf);
    assertEquals(fixedSize, onHeapCacheSize);
  }
Assert that when BUCKET_CACHE_COMBINED_KEY is false, the non-default, that we deploy
LruBlockCache as L1 with a BucketCache for L2.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheConfig.java