@Override
    public int getEntryBySubEntry(long k) {
      // We define mid-key as the key corresponding to k'th sub-entry
      // (0-based).

      int i = Collections.binarySearch(numSubEntriesAt, k);

      // Exact match: cumulativeWeight[i] = k. This means chunks #0 through
      // #i contain exactly k sub-entries, and the sub-entry #k (0-based)
      // is in the (i + 1)'th chunk.
      if (i >= 0) return i + 1;

      // Inexact match. Return the insertion point.
      return -i - 1;
    }
Finds the entry corresponding to the deeper-level index block containing the given
deeper-level entry (a "sub-entry"), assuming a global 0-based ordering of sub-entries.
<p>
<i> Implementation note. </i> We are looking for i such that numSubEntriesAt[i - 1] <= k <
numSubEntriesAt[i], because a deeper-level block #i (0-based) contains sub-entries #
numSubEntriesAt[i - 1]'th through numSubEntriesAt[i] - 1, assuming a global 0-based ordering
of sub-entries. i is by definition the insertion point of k in numSubEntriesAt.
@param k sub-entry index, from 0 to the total number sub-entries - 1
@return the 0-based index of the entry corresponding to the given sub-entry
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java