public static boolean matchingRowColumnBytes(final Cell left, final Cell right) {
    int lrowlength = left.getRowLength();
    int rrowlength = right.getRowLength();
    int lfamlength = left.getFamilyLength();
    int rfamlength = right.getFamilyLength();
    int lqlength = left.getQualifierLength();
    int rqlength = right.getQualifierLength();

    // match length
    if ((lrowlength != rrowlength) || (lfamlength != rfamlength) || (lqlength != rqlength)) {
      return false;
    }

    // match row
    if (
      !Bytes.equals(left.getRowArray(), left.getRowOffset(), lrowlength, right.getRowArray(),
        right.getRowOffset(), rrowlength)
    ) {
      return false;
    }
    // match family
    if (
      !Bytes.equals(left.getFamilyArray(), left.getFamilyOffset(), lfamlength,
        right.getFamilyArray(), right.getFamilyOffset(), rfamlength)
    ) {
      return false;
    }
    // match qualifier
    return Bytes.equals(left.getQualifierArray(), left.getQualifierOffset(), lqlength,
      right.getQualifierArray(), right.getQualifierOffset(), rqlength);
  }
Compares the row and column of two keyvalues for equality
hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java