private static int compareCacheBlock(Cacheable left, Cacheable right,
    boolean includeNextBlockMetadata) {
    ByteBuffer l = ByteBuffer.allocate(left.getSerializedLength());
    left.serialize(l, includeNextBlockMetadata);
    ByteBuffer r = ByteBuffer.allocate(right.getSerializedLength());
    right.serialize(r, includeNextBlockMetadata);
    return Bytes.compareTo(l.array(), l.arrayOffset(), l.limit(), r.array(), r.arrayOffset(),
      r.limit());
  }
Get a {@link CachedBlocksByFile} instance and load it up by iterating content in
{@link BlockCache}.
@param conf Used to read configurations
@param bc   Block Cache to iterate.
@return Laoded up instance of CachedBlocksByFile
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheUtil.java