diff --git a/src/java/org/apache/hadoop/hbase/KeyValue.java b/src/java/org/apache/hadoop/hbase/KeyValue.java index 3ff6c6d..aff47f4 100644 --- a/src/java/org/apache/hadoop/hbase/KeyValue.java +++ b/src/java/org/apache/hadoop/hbase/KeyValue.java @@ -612,10 +612,14 @@ public class KeyValue { public byte [] getKey() { int keylength = getKeyLength(); byte [] key = new byte[keylength]; - System.arraycopy(getBuffer(), ROW_OFFSET, key, 0, keylength); + System.arraycopy(getBuffer(), getKeyOffset(), key, 0, keylength); return key; } + public String getKeyString() { + return Bytes.toString(getBuffer(), getKeyOffset(), getKeyLength()); + } + /** * @return Key offset in backing buffer.. */ @@ -943,6 +947,11 @@ public class KeyValue { public KeyComparator getRawComparator() { return this.rawcomparator; } + + @Override + protected Object clone() throws CloneNotSupportedException { + return new RootComparator(); + } } /** @@ -955,6 +964,11 @@ public class KeyValue { public KeyComparator getRawComparator() { return this.rawcomparator; } + + @Override + protected Object clone() throws CloneNotSupportedException { + return new MetaComparator(); + } } /**