hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r816021 - in /hadoop/hbase/branches/0.20: 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:26 GMT
Author: jgray
Date: Thu Sep 17 01:17:25 2009
New Revision: 816021

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

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

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=816021&r1=816020&r2=816021&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Thu Sep 17 01:17:25 2009
@@ -15,6 +15,8 @@
    HBASE-1821  Filtering by SingleColumnValueFilter bug
    HBASE-1840  RowLock fails when used with IndexTable
    HBASE-1818  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-1819  Update to 0.20.1 hadoop and zk 3.2.1

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java?rev=816021&r1=816020&r2=816021&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/filter/CompareFilter.java
Thu Sep 17 01:17:25 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/branches/0.20/src/test/org/apache/hadoop/hbase/TestSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/TestSerialization.java?rev=816021&r1=816020&r2=816021&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/TestSerialization.java (original)
+++ hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/TestSerialization.java Thu
Sep 17 01:17:25 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.BatchOperation;
 import org.apache.hadoop.hbase.io.BatchUpdate;
 import org.apache.hadoop.hbase.io.Cell;
@@ -61,6 +64,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 [] column = Bytes.toBytes(getName() + ":" + getName());



Mime
View raw message