@Override
    public long heapSize() {
      // The BlockIndexReader does not have the blockKey, comparator and the midkey atomic reference
      long heapSize =
        ClassSize.align(3 * ClassSize.REFERENCE + 2 * Bytes.SIZEOF_INT + ClassSize.OBJECT);

      // Mid-key metadata.
      heapSize += MID_KEY_METADATA_SIZE;

      heapSize = calculateHeapSizeForBlockKeys(heapSize);

      if (blockOffsets != null) {
        heapSize += ClassSize.align(ClassSize.ARRAY + blockOffsets.length * Bytes.SIZEOF_LONG);
      }

      if (blockDataSizes != null) {
        heapSize += ClassSize.align(ClassSize.ARRAY + blockDataSizes.length * Bytes.SIZEOF_INT);
      }

      return ClassSize.align(heapSize);
    }
Read the root-level metadata of a multi-level block index. Based on
{@link #readRootIndex(DataInput, int)}, but also reads metadata necessary to compute the
mid-key in a multi-level index.
@param blk        the HFile block
@param numEntries the number of root-level index entries
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java