public static int compareRow(Cell cell, ByteArrayComparable comparator) {
    if (cell instanceof ByteBufferExtendedCell) {
      return comparator.compareTo(((ByteBufferExtendedCell) cell).getRowByteBuffer(),
        ((ByteBufferExtendedCell) cell).getRowPosition(), cell.getRowLength());
    }
    return comparator.compareTo(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
  }
Compare cell's row against given comparator
@param cell       the cell to use for comparison
@param comparator the {@link CellComparator} to use for comparison
@return result comparing cell's row
hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java