hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r816020 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/filter/CompareFilter.java src/test/org/apache/hadoop/hbase/TestSerialization.java
Date Thu, 17 Sep 2009 01:17:19 GMT
Author: jgray
Date: Thu Sep 17 01:17:18 2009
New Revision: 816020

URL: http://svn.apache.org/viewvc?rev=816020&view=rev
Log:
HBASE-1830  HbaseObjectWritable methods should allow null HBCs for when Writable is not Configurable
(Stack via jgray)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/TestSerialization.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=816020&r1=816019&r2=816020&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Sep 17 01:17:18 2009
@@ -28,6 +28,8 @@
    HBASE-1821  Filtering by SingleColumnValueFilter bug
    HBASE-1840  RowLock fails when used with IndexTable (Keith Thomas via Stack)
    HBASE-818   HFile code review and refinement (Schubert Zhang via Stack)
+   HBASE-1830  HbaseObjectWritable methods should allow null HBCs
+               for when Writable is not Configurable (Stack via jgray)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java?rev=816020&r1=816019&r2=816020&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java Thu Sep
17 01:17:18 2009
@@ -27,6 +27,7 @@
 
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.io.HbaseObjectWritable;
 import org.apache.hadoop.io.ObjectWritable;
 
 /**
@@ -125,18 +126,16 @@
           compareOp.name());
     }
   }
-  
-  private static final HBaseConfiguration hbc = new HBaseConfiguration();
-  
+
   public void readFields(DataInput in) throws IOException {
     compareOp = CompareOp.valueOf(in.readUTF());
     comparator = (WritableByteArrayComparable)
-        ObjectWritable.readObject(in, hbc);
+      HbaseObjectWritable.readObject(in, null);
   }
 
   public void write(DataOutput out) throws IOException {
     out.writeUTF(compareOp.name());
-    ObjectWritable.writeObject(out, comparator,
-        WritableByteArrayComparable.class, hbc);
+    HbaseObjectWritable.writeObject(out, comparator,
+      WritableByteArrayComparable.class, null);
   }
 }

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/TestSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/TestSerialization.java?rev=816020&r1=816019&r2=816020&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/TestSerialization.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/TestSerialization.java Thu Sep 17
01:17:18 2009
@@ -34,8 +34,11 @@
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.RowLock;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.filter.BinaryComparator;
 import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
+import org.apache.hadoop.hbase.filter.RowFilter;
+import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
 import org.apache.hadoop.hbase.io.HbaseMapWritable;
 import org.apache.hadoop.hbase.io.TimeRange;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -57,6 +60,14 @@
     super.tearDown();
   }
 
+  public void testCompareFilter() throws Exception {
+    Filter f = new RowFilter(CompareOp.EQUAL,
+      new BinaryComparator(Bytes.toBytes("testRowOne-2")));
+    byte [] bytes = Writables.getBytes(f);
+    Filter ff = (Filter)Writables.getWritable(bytes, new RowFilter());
+    assertNotNull(ff);
+  }
+
   public void testKeyValue() throws Exception {
     byte [] row = Bytes.toBytes(getName());
     byte [] family = Bytes.toBytes(getName());



Mime
View raw message