diff --git a/src/java/org/apache/hadoop/hbase/HStoreKey.java b/src/java/org/apache/hadoop/hbase/HStoreKey.java index 5eac2336734..8c8b0a78881 100644 --- a/src/java/org/apache/hadoop/hbase/HStoreKey.java +++ b/src/java/org/apache/hadoop/hbase/HStoreKey.java @@ -529,9 +529,6 @@ public class HStoreKey implements WritableComparable { if(rowCompare == 0) rowCompare = Bytes.compareTo(keysA[1], KeysB[1]); return rowCompare; - } - if (regionInfo != null && regionInfo.getTableDesc().getRowKeyComparator() != null) { - return regionInfo.getTableDesc().getRowKeyComparator().compare(rowA, rowB); } return Bytes.compareTo(rowA, rowB); } diff --git a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java index ab55de77346..3223bda8c7f 100644 --- a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -19,12 +19,8 @@ */ package org.apache.hadoop.hbase; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.DataInput; -import java.io.DataInputStream; import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.IOException; import java.util.Collection; import java.util.Collections; @@ -36,7 +32,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.client.tableindexed.IndexSpecification; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.io.ObjectWritable; import org.apache.hadoop.io.WritableComparable; /** @@ -431,47 +426,7 @@ public class HTableDescriptor implements WritableComparable { setValue(MEMCACHE_FLUSHSIZE_KEY, Bytes.toBytes(Integer.toString(memcacheFlushSize))); } - - - public void setRowKeyComparator(WritableComparator newComparator) { - if (newComparator == null) { - return; - } - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(bos); - HBaseConfiguration conf = new HBaseConfiguration(); - try { - ObjectWritable.writeObject(dos, newComparator, WritableComparator.class, conf); - dos.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - setValue(ROW_KEY_COMPARATOR.getBytes(), bos.toByteArray()); - this.comparator = newComparator; - } - - private WritableComparator comparator = null; - public WritableComparator getRowKeyComparator() { - if (comparator != null) { - return comparator; - } - byte[] bytes = getValue(ROW_KEY_COMPARATOR.getBytes()); - if (bytes == null) { - return null; - } - ByteArrayInputStream bis = new ByteArrayInputStream(bytes); - DataInputStream in = new DataInputStream(bis); - HBaseConfiguration conf = new HBaseConfiguration(); - try { - comparator = (WritableComparator) ObjectWritable.readObject(in, conf); - } catch (IOException e) { - throw new RuntimeException(e); - } - return comparator; - } - - public Collection getIndexes() { return indexes.values(); } @@ -708,4 +663,4 @@ public class HTableDescriptor implements WritableComparable { new HColumnDescriptor(HConstants.COLUMN_FAMILY_HISTORIAN, HConstants.ALL_VERSIONS, HColumnDescriptor.CompressionType.NONE, false, false, Integer.MAX_VALUE, HConstants.WEEK_IN_SECONDS, false)}); -} +} \ No newline at end of file