default int compareRows(ByteBuffer row, Cell cell) {
    if (cell instanceof ByteBufferExtendedCell) {
      return ByteBufferUtils.compareTo(row, row.position(), row.remaining(),
        ((ByteBufferExtendedCell) cell).getRowByteBuffer(),
        ((ByteBufferExtendedCell) cell).getRowPosition(), cell.getRowLength());
    }
    return ByteBufferUtils.compareTo(row, row.position(), row.remaining(), cell.getRowArray(),
      cell.getRowOffset(), cell.getRowLength());
  }
Lexicographically compare two rows
@param row ByteBuffer that wraps a row; will read from current position and will reading all
           remaining; will not disturb the ByteBuffer internal state.
@return greater than 0 if leftCell is bigger, less than 0 if rightCell is bigger, 0 if both
        cells are equal
hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java