@Override
  public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat,
    boolean updateCacheMetrics) {
    Cacheable block = null;
    // We don't know the block type. We should try to get it on one of the caches only,
    // but not both otherwise we'll over compute on misses. Here we check if the key is on L1,
    // if so, call getBlock on L1 and that will compute the hit. Otherwise, we'll try to get it from
    // L2 and whatever happens, we'll update the stats there.
    boolean existInL1 = l1Cache.containsBlock(cacheKey);
    // if we know it's in L1, just delegate call to l1 and return it
    if (existInL1) {
      block = l1Cache.getBlock(cacheKey, caching, repeat, false);
    } else {
      block = l2Cache.getBlock(cacheKey, caching, repeat, false);
    }
    if (updateCacheMetrics) {
      boolean metaBlock = isMetaBlock(cacheKey.getBlockType());
      if (metaBlock) {
        if (!existInL1 && block != null) {
          LOG.warn("Cache key {} had block type {}, but was found in L2 cache.", cacheKey,
            cacheKey.getBlockType());
          updateBlockMetrics(block, cacheKey, l2Cache, caching);
        } else {
          updateBlockMetrics(block, cacheKey, l1Cache, caching);
        }
      } else {
        if (existInL1) {
          updateBlockMetrics(block, cacheKey, l1Cache, caching);
        } else {
          updateBlockMetrics(block, cacheKey, l2Cache, caching);
        }
      }
    }
    return block;
  }
CombinedBlockCache is an abstraction layer that combines {@link FirstLevelBlockCache} and
{@link BucketCache}. The smaller lruCache is used to cache bloom blocks and index blocks. The
larger Cache is used to cache data blocks.
{@link #getBlock(BlockCacheKey, boolean, boolean, boolean)} reads first from the smaller l1Cache
before looking for the block in the l2Cache. Blocks evicted from l1Cache are put into the bucket
cache. Metrics are the combined size and hits and misses of both caches.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java