static int locateNonRootIndexEntry(ByteBuff nonRootBlock, Cell key, CellComparator comparator) {
      int entryIndex = binarySearchNonRootIndex(key, nonRootBlock, comparator);

      if (entryIndex != -1) {
        int numEntries = nonRootBlock.getIntAfterPosition(0);

        // The end of secondary index and the beginning of entries themselves.
        int entriesOffset = Bytes.SIZEOF_INT * (numEntries + 2);

        // The offset of the entry we are interested in relative to the end of
        // the secondary index.
        int entryRelOffset = nonRootBlock.getIntAfterPosition(Bytes.SIZEOF_INT * (1 + entryIndex));

        nonRootBlock.position(entriesOffset + entryRelOffset);
      }

      return entryIndex;
    }
Search for one key using the secondary index in a non-root block. In case of success,
positions the provided buffer at the entry of interest, where the file offset and the
on-disk-size can be read. a non-root block without header. Initial position does not matter.
the byte array containing the key
@return the index position where the given key was found, otherwise return -1 in the case the
        given key is before the first key.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java