You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2009/07/08 06:16:52 UTC
svn commit: r792028 - in /hadoop/hbase/trunk: CHANGES.txt
src/java/org/apache/hadoop/hbase/KeyValue.java
Author: stack
Date: Wed Jul 8 04:16:51 2009
New Revision: 792028
URL: http://svn.apache.org/viewvc?rev=792028&view=rev
Log:
HBASE-1622 Make KeyValue implement the Comparable interface to make it work with Cascading -- reversed application
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/KeyValue.java
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=792028&r1=792027&r2=792028&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Jul 8 04:16:51 2009
@@ -450,8 +450,6 @@
HBASE-1620 Need to use special StoreScanner constructor for major compactions
(passed sf, no caching, etc) (Jon Gray via Stack)
HBASE-1624 Don't sort Puts if only one in list in HCM#processBatchOfRows
- HBASE-1622 Make KeyValue implement the Comparable interface to make it work
- with Cascading (Erik Holstad via Stack)
OPTIMIZATIONS
HBASE-1412 Change values for delete column and column family in KeyValue
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/KeyValue.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/KeyValue.java?rev=792028&r1=792027&r2=792028&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/KeyValue.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/KeyValue.java Wed Jul 8 04:16:51 2009
@@ -30,7 +30,7 @@
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.ClassSize;
import org.apache.hadoop.io.RawComparator;
-import org.apache.hadoop.io.WritableComparable;
+import org.apache.hadoop.io.Writable;
/**
* An HBase Key/Value. Instances of this class are immutable. They are not
@@ -53,7 +53,7 @@
* <p>TODO: Group Key-only comparators and operations into a Key class, just
* for neatness sake, if can figure what to call it.
*/
-public class KeyValue implements WritableComparable<KeyValue>, HeapSize {
+public class KeyValue implements Writable, HeapSize {
static final Log LOG = LogFactory.getLog(KeyValue.class);
/**
@@ -61,8 +61,7 @@
*/
public static final char COLUMN_FAMILY_DELIMITER = ':';
- public static final byte[] COLUMN_FAMILY_DELIM_ARRAY =
- new byte[]{COLUMN_FAMILY_DELIMITER};
+ public static final byte[] COLUMN_FAMILY_DELIM_ARRAY = new byte[]{COLUMN_FAMILY_DELIMITER};
/**
* Comparator for plain key/values; i.e. non-catalog table key/values.
@@ -540,12 +539,8 @@
value, voffset, vlength);
}
- /**
- * Needed doing 'contains' on List. Only compares the key portion, not the
- * value.
- * @param other Object to compare ourselves to.
- * @return True if equal to <code>other</code>
- */
+ // Needed doing 'contains' on List. Only compares the key portion, not the
+ // value.
public boolean equals(Object other) {
KeyValue kv = (KeyValue)other;
// Comparing bytes should be fine doing equals test. Shouldn't have to
@@ -1799,7 +1794,6 @@
(2 * Bytes.SIZEOF_INT));
}
- // WritableComparable
// Writable
public void readFields(final DataInput in) throws IOException {
this.length = in.readInt();
@@ -1812,10 +1806,4 @@
out.writeInt(this.length);
out.write(this.bytes, this.offset, this.length);
}
- // Comparable
- public int compareTo(KeyValue that) {
- return KEY_COMPARATOR.compare(this.bytes, this.offset, this.length,
- that.getBuffer(), that.getOffset(), that.getLength());
- }
-
}