diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java index 572de9f5c7a..fd651307bfc 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.filter; +import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hbase.Cell; @@ -51,6 +52,12 @@ public class ColumnCountGetFilter extends FilterBase { return limit; } + @Override + public boolean filterRowKey(Cell cell) throws IOException { + // Impl in FilterBase might do unnecessary copy for Off heap backed Cells. + return false; + } + @Override public boolean filterAllRemaining() { return this.count > this.limit; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java index 673ca6e37c1..2b5f128b5b4 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java @@ -18,6 +18,7 @@ */ package org.apache.hadoop.hbase.filter; +import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hbase.Cell; @@ -40,8 +41,8 @@ import com.google.protobuf.InvalidProtocolBufferException; */ @InterfaceAudience.Public @InterfaceStability.Stable -public class ColumnPaginationFilter extends FilterBase -{ +public class ColumnPaginationFilter extends FilterBase { + private int limit = 0; private int offset = -1; private byte[] columnOffset = null; @@ -104,6 +105,12 @@ public class ColumnPaginationFilter extends FilterBase return columnOffset; } + @Override + public boolean filterRowKey(Cell cell) throws IOException { + // Impl in FilterBase might do unnecessary copy for Off heap backed Cells. + return false; + } + @Override public ReturnCode filterKeyValue(Cell v) { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java index d2f058a59cd..a89a1f391ca 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.filter; +import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hbase.Cell; @@ -51,6 +52,12 @@ public class ColumnPrefixFilter extends FilterBase { return prefix; } + @Override + public boolean filterRowKey(Cell cell) throws IOException { + // Impl in FilterBase might do unnecessary copy for Off heap backed Cells. + return false; + } + @Override public ReturnCode filterKeyValue(Cell kv) { if (this.prefix == null || kv.getQualifierArray() == null) { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java index d8ea0949f68..c386ad687f9 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.filter; import static org.apache.hadoop.hbase.util.Bytes.len; +import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hbase.Cell; @@ -115,6 +116,12 @@ public class ColumnRangeFilter extends FilterBase { return this.maxColumnInclusive; } + @Override + public boolean filterRowKey(Cell cell) throws IOException { + // Impl in FilterBase might do unnecessary copy for Off heap backed Cells. + return false; + } + @Override public ReturnCode filterKeyValue(Cell kv) { // TODO have a column compare method in Cell diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java index 319e1238b55..f6415244c59 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java @@ -19,8 +19,10 @@ package org.apache.hadoop.hbase.filter; +import java.io.IOException; import java.util.ArrayList; +import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; @@ -97,6 +99,12 @@ public abstract class CompareFilter extends FilterBase { return comparator; } + @Override + public boolean filterRowKey(Cell cell) throws IOException { + // Impl in FilterBase might do unnecessary copy for Off heap backed Cells. + return false; + } + protected boolean doCompare(final CompareOp compareOp, final ByteArrayComparable comparator, final byte [] data, final int offset, final int length) { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java index 88bf842a6f8..a2f90152f7e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.exceptions.DeserializationException; *