hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1405657 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
Date Sun, 04 Nov 2012 22:37:05 GMT
Author: tedyu
Date: Sun Nov  4 22:37:04 2012
New Revision: 1405657

URL: http://svn.apache.org/viewvc?rev=1405657&view=rev
Log:
HBASE-7095 Cannot set 'lenAsVal' for KeyOnlyFilter from shell (Aditya)


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java?rev=1405657&r1=1405656&r2=1405657&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
Sun Nov  4 22:37:04 2012
@@ -51,9 +51,13 @@ public class KeyOnlyFilter extends Filte
   }
 
   public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments)
{
-    Preconditions.checkArgument(filterArguments.size() == 0,
-                                "Expected: 0 but got: %s", filterArguments.size());
-    return new KeyOnlyFilter();
+    Preconditions.checkArgument((filterArguments.size() == 0 || filterArguments.size() ==
1),
+                                "Expected: 0 or 1 but got: %s", filterArguments.size());
+    KeyOnlyFilter filter = new KeyOnlyFilter();
+    if (filterArguments.size() == 1) {
+      filter.lenAsVal = ParseFilter.convertByteArrayToBoolean(filterArguments.get(0));
+    }
+    return filter;
   }
 
   /**



Mime
View raw message