public static final int compare(CellComparator comparator, ExtendedCell left, byte[] key,
    int offset, int length) {
    // row
    short rrowlength = Bytes.toShort(key, offset);
    int c = comparator.compareRows(left, key, offset + Bytes.SIZEOF_SHORT, rrowlength);
    if (c != 0) return c;

    // Compare the rest of the two KVs without making any assumptions about
    // the common prefix. This function will not compare rows anyway, so we
    // don't need to tell it that the common prefix includes the row.
    return compareWithoutRow(comparator, left, key, offset, length, rrowlength);
  }
Used when a cell needs to be compared with a key byte[] such as cases of finding the index from
the index block, bloom keys from the bloom blocks This byte[] is expected to be serialized in
the KeyValue serialization format If the KeyValue (Cell's) serialization format changes this
method cannot be used.
@param comparator the {@link CellComparator} to use for comparison
@param left       the cell to be compared
@param key        the serialized key part of a KeyValue
@param offset     the offset in the key byte[]
@param length     the length of the key byte[]
@return an int greater than 0 if left is greater than right lesser than 0 if left is lesser
        than right equal to 0 if left is equal to right
hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java