@Override
  public KeyValue clone() throws CloneNotSupportedException {
    KeyValue ret = (KeyValue) super.clone();
    ret.bytes = Arrays.copyOf(this.bytes, this.bytes.length);
    ret.offset = 0;
    ret.length = ret.bytes.length;
    // Important to clone the memstoreTS as well - otherwise memstore's
    // update-in-place methods (eg increment) will end up creating
    // new entries
    ret.setSequenceId(seqId);
    return ret;
  }
Clones a KeyValue. This creates a copy, re-allocating the buffer.
@return Fully copied clone of this KeyValue
@throws CloneNotSupportedException if cloning of keyValue is not supported
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java