@Test
  public void testReaderBlockAllocationWithCombinedCache() throws IOException {
    // true because caching is fully enabled and block type null
    testReaderBlockAllocationWithCombinedCache(true, true, null, true);
    // false because caching is fully enabled, index block type always goes to on-heap L1
    testReaderBlockAllocationWithCombinedCache(true, true, BlockType.INTERMEDIATE_INDEX, false);
    // true because cacheBlocks takes precedence over cache config which block type is null
    testReaderBlockAllocationWithCombinedCache(false, true, null, true);
    // false because caching is enabled and block type is index, which always goes to L1
    testReaderBlockAllocationWithCombinedCache(false, true, BlockType.INTERMEDIATE_INDEX, false);
    // true because since it's a DATA block, we honor the cache config
    testReaderBlockAllocationWithCombinedCache(false, true, BlockType.DATA, true);
    // true for the following 2 because cacheBlock takes precedence over cache config
    // with caching disabled, we always go to off-heap
    testReaderBlockAllocationWithCombinedCache(true, false, null, true);
    testReaderBlockAllocationWithCombinedCache(true, false, BlockType.INTERMEDIATE_INDEX, false);
    // true for the following 3, because with caching disabled we always go to off-heap
    testReaderBlockAllocationWithCombinedCache(false, false, null, true);
    testReaderBlockAllocationWithCombinedCache(false, false, BlockType.INTERMEDIATE_INDEX, true);
    testReaderBlockAllocationWithCombinedCache(false, false, BlockType.DATA, true);
  }
Tests that we properly allocate from the off-heap or on-heap when CombinedCache is configured.
In this case, we should always use off-heap unless the block is an INDEX (which always goes to
L1 cache which is on-heap)
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java