public static KeyValue toNewKeyCell(final ExtendedCell cell) {
    byte[] bytes = new byte[keyLength(cell)];
    appendKeyTo(cell, bytes, 0);
    KeyValue kv = new KeyValue.KeyOnlyKeyValue(bytes, 0, bytes.length);
    // Set the seq id. The new key cell could be used in comparisons so it
    // is important that it uses the seqid also. If not the comparsion would fail
    kv.setSequenceId(cell.getSequenceId());
    return kv;
  }
Copies the key to a new KeyValue
@return the KeyValue that consists only the key part of the incoming cell
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java