diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java index 02b448c..a574115 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java @@ -20,7 +20,6 @@ package org.apache.hadoop.hbase; import java.io.DataInput; -import java.io.DataOutput; import java.io.IOException; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; @@ -36,7 +35,6 @@ import org.apache.hadoop.hbase.io.HeapSize; 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.Writable; import org.apache.hbase.Cell; import org.apache.hbase.cell.CellComparator; @@ -65,7 +63,7 @@ import com.google.common.primitives.Longs; */ @InterfaceAudience.Public @InterfaceStability.Evolving -public class KeyValue implements Cell, Writable, HeapSize { +public class KeyValue implements Cell, HeapSize { static final Log LOG = LogFactory.getLog(KeyValue.class); // TODO: Group Key-only comparators and operations into a Key class, just // for neatness sake, if can figure what to call it. @@ -2660,17 +2658,4 @@ public class KeyValue implements Cell, Writable, HeapSize { this.bytes = new byte[this.length]; in.readFully(this.bytes, 0, this.length); } - - // Writable - @Override - public void readFields(final DataInput in) throws IOException { - int length = in.readInt(); - readFields(length, in); - } - - @Override - public void write(final DataOutput out) throws IOException { - out.writeInt(this.length); - out.write(this.bytes, this.offset, this.length); - } } diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java index 3ed8818..0646673 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java @@ -483,25 +483,6 @@ public class TestKeyValue extends TestCase { } /** - * The row cache is cleared and re-read for the new value - * - * @throws IOException - */ - public void testReadFields() throws IOException { - KeyValue kv1 = new KeyValue(Bytes.toBytes("row1"), Bytes.toBytes("cf1"), - Bytes.toBytes("qualifier1"), 12345L, Bytes.toBytes("value1")); - kv1.getRow(); // set row cache of kv1 - KeyValue kv2 = new KeyValue(Bytes.toBytes("row2"), Bytes.toBytes("cf2"), - Bytes.toBytes("qualifier2"), 12345L, Bytes.toBytes("value2")); - kv1.readFields(new DataInputStream(new ByteArrayInputStream(WritableUtils - .toByteArray(kv2)))); - // check equality - assertEquals(kv1, kv2); - // check cache state (getRow() return the cached value if the cache is set) - assertTrue(Bytes.equals(kv1.getRow(), kv2.getRow())); - } - - /** * Tests that getTimestamp() does always return the proper timestamp, even after updating it. * See HBASE-6265. */