hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject hbase git commit: HBASE-13347 Deprecate FirstKeyValueMatchingQualifiersFilter. (Abhishek)
Date Tue, 24 Nov 2015 04:21:16 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 9a91f5ac8 -> daba86773


HBASE-13347 Deprecate FirstKeyValueMatchingQualifiersFilter. (Abhishek)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/daba8677
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/daba8677
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/daba8677

Branch: refs/heads/master
Commit: daba867734b6ce09e61193e90fae2a97755fdb53
Parents: 9a91f5a
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Tue Nov 24 09:50:56 2015 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Tue Nov 24 09:50:56 2015 +0530

----------------------------------------------------------------------
 .../filter/FirstKeyValueMatchingQualifiersFilter.java  |  2 ++
 .../org/apache/hadoop/hbase/mapreduce/RowCounter.java  | 13 +------------
 .../hadoop/hbase/filter/TestFilterSerialization.java   |  1 +
 .../TestFirstKeyValueMatchingQualifiersFilter.java     |  1 +
 4 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/daba8677/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
index 622f5ab..2e9510f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
@@ -43,9 +43,11 @@ import com.google.protobuf.InvalidProtocolBufferException;
  * caveat, this filter is only useful for special cases
  * like {@link org.apache.hadoop.hbase.mapreduce.RowCounter}.
  * <p>
+ * @deprecated Deprecated in 2.0. See HBASE-13347
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
+@Deprecated
 public class FirstKeyValueMatchingQualifiersFilter extends FirstKeyOnlyFilter {
 
   private Set<byte []> qualifiers;

http://git-wip-us.apache.org/repos/asf/hbase/blob/daba8677/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
index 7df2f47..145b366 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
@@ -19,8 +19,6 @@
 package org.apache.hadoop.hbase.mapreduce;
 
 import java.io.IOException;
-import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -34,7 +32,6 @@ import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
-import org.apache.hadoop.hbase.filter.FirstKeyValueMatchingQualifiersFilter;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.mapreduce.Counter;
@@ -150,7 +147,6 @@ public class RowCounter extends Configured implements Tool {
     job.setJarByClass(RowCounter.class);
     Scan scan = new Scan();
     scan.setCacheBlocks(false);
-    Set<byte []> qualifiers = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR);
     if (startKey != null && !startKey.equals("")) {
       scan.setStartRow(Bytes.toBytes(startKey));
     }
@@ -170,14 +166,7 @@ public class RowCounter extends Configured implements Tool {
         }
       }
     }
-    // specified column may or may not be part of first key value for the row.
-    // Hence do not use FirstKeyOnlyFilter if scan has columns, instead use
-    // FirstKeyValueMatchingQualifiersFilter.
-    if (qualifiers.size() == 0) {
-      scan.setFilter(new FirstKeyOnlyFilter());
-    } else {
-      scan.setFilter(new FirstKeyValueMatchingQualifiersFilter(qualifiers));
-    }
+    scan.setFilter(new FirstKeyOnlyFilter());
     scan.setTimeRange(startTime, endTime == 0 ? HConstants.LATEST_TIMESTAMP : endTime);
     job.setOutputFormatClass(NullOutputFormat.class);
     TableMapReduceUtil.initTableMapperJob(tableName, scan,

http://git-wip-us.apache.org/repos/asf/hbase/blob/daba8677/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
index 0a8b4bf..00e3913 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
@@ -127,6 +127,7 @@ public class TestFilterSerialization {
       ProtobufUtil.toFilter(ProtobufUtil.toFilter(filterWrapper))));
   }
 
+  @SuppressWarnings("deprecation")
   @Test
   public void testFirstKeyValueMatchingQualifiersFilter() throws Exception {
     // empty qualifiers set

http://git-wip-us.apache.org/repos/asf/hbase/blob/daba8677/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFirstKeyValueMatchingQualifiersFilter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFirstKeyValueMatchingQualifiersFilter.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFirstKeyValueMatchingQualifiersFilter.java
index fb384a7..0d045f7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFirstKeyValueMatchingQualifiersFilter.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFirstKeyValueMatchingQualifiersFilter.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.experimental.categories.Category;
 
+@SuppressWarnings("deprecation")
 @Category({FilterTests.class, SmallTests.class})
 public class TestFirstKeyValueMatchingQualifiersFilter extends TestCase {
   private static final byte[] ROW = Bytes.toBytes("test");


Mime
View raw message