hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [19/50] [abbrv] hbase git commit: HBASE-18769 Make CompareFilter use generic CompareOperator instead of internal enum
Date Mon, 11 Sep 2017 07:42:46 GMT
HBASE-18769 Make CompareFilter use generic CompareOperator instead of
internal enum


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

Branch: refs/heads/HBASE-18467
Commit: b8e0a8396f5f6ec02d9382a75f550499d85f3a23
Parents: 3319101
Author: Michael Stack <stack@apache.org>
Authored: Thu Sep 7 13:59:46 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Fri Sep 8 10:06:56 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/Table.java   |   3 +-
 .../hadoop/hbase/filter/CompareFilter.java      | 128 ++++++++++++++++---
 .../hbase/filter/DependentColumnFilter.java     |  40 ++++--
 .../hadoop/hbase/filter/FamilyFilter.java       |  24 +++-
 .../apache/hadoop/hbase/filter/ParseFilter.java |  41 +++++-
 .../hadoop/hbase/filter/QualifierFilter.java    |  23 +++-
 .../apache/hadoop/hbase/filter/RowFilter.java   |  23 +++-
 .../filter/SingleColumnValueExcludeFilter.java  |  69 +++++++++-
 .../hbase/filter/SingleColumnValueFilter.java   | 120 ++++++++++++-----
 .../apache/hadoop/hbase/filter/ValueFilter.java |  23 +++-
 .../hadoop/hbase/quotas/QuotaTableUtil.java     |  15 ++-
 .../hbase/filter/ByteArrayComparable.java       |   2 +-
 .../hbase/IntegrationTestLazyCfLoading.java     |   2 +-
 .../hadoop/hbase/mapreduce/CellCounter.java     |   5 +-
 .../hadoop/hbase/mapreduce/ExportUtils.java     |   3 +-
 .../hadoop/hbase/PerformanceEvaluation.java     |   9 +-
 .../hbase/mapred/TestTableInputFormat.java      |   6 +-
 .../hbase/mapreduce/TestTableInputFormat.java   |   9 +-
 .../hbase/replication/ReplicationTableBase.java |   3 +-
 .../TableBasedReplicationQueuesImpl.java        |   2 +-
 .../hadoop/hbase/rest/model/ScannerModel.java   |  15 ++-
 .../hbase/rest/PerformanceEvaluation.java       |   3 +-
 .../hbase/rest/TestScannersWithFilters.java     |  71 +++++-----
 .../security/access/AccessControlLists.java     |   3 +-
 .../apache/hadoop/hbase/TestSerialization.java  |   2 +-
 ...TestServerSideScanMetricsFromClientSide.java |  19 +--
 .../hadoop/hbase/client/TestCheckAndMutate.java |   4 +-
 .../hadoop/hbase/client/TestFromClientSide.java | 107 ++++++++--------
 .../hbase/filter/TestDependentColumnFilter.java |   9 +-
 .../apache/hadoop/hbase/filter/TestFilter.java  | 115 ++++++++---------
 .../hadoop/hbase/filter/TestFilterList.java     |   9 +-
 .../hbase/filter/TestFilterSerialization.java   |  21 +--
 .../hbase/filter/TestFilterWithScanLimits.java  |   3 +-
 .../hadoop/hbase/filter/TestFilterWrapper.java  |   3 +-
 .../hadoop/hbase/filter/TestParseFilter.java    |  35 +++--
 .../TestSingleColumnValueExcludeFilter.java     |   3 +-
 .../filter/TestSingleColumnValueFilter.java     |  13 +-
 .../hadoop/hbase/thrift2/ThriftUtilities.java   |  17 +--
 src/main/asciidoc/_chapters/architecture.adoc   |  14 +-
 39 files changed, 678 insertions(+), 338 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
index 2409406..66d4616 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
@@ -134,8 +134,7 @@ public interface Table extends Closeable {
    */
   <R> void batchCallback(
     final List<? extends Row> actions, final Object[] results, final Batch.Callback<R> callback
-  )
-    throws IOException, InterruptedException;
+  ) throws IOException, InterruptedException;
 
   /**
    * Extracts certain cells from a given row.

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java
----------------------------------------------------------------------
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 631fbe4..e5fe6fa 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
@@ -54,8 +54,9 @@ public abstract class CompareFilter extends FilterBase {
    * Comparison operators. For filters only!
    * Use {@link CompareOperator} otherwise.
    * It (intentionally) has at least the below enums with same names.
-   * TODO: Replace with generic {@link CompareOperator}
+   * @deprecated  since 2.0.0. Will be removed in 3.0.0. Use {@link CompareOperator} instead.
    */
+  @Deprecated
   @InterfaceAudience.Public
   public enum CompareOp {
     /** less than */
@@ -74,25 +75,43 @@ public abstract class CompareFilter extends FilterBase {
     NO_OP,
   }
 
-  protected CompareOp compareOp;
+  protected CompareOperator op;
   protected ByteArrayComparable comparator;
 
   /**
    * Constructor.
    * @param compareOp the compare op for row matching
    * @param comparator the comparator for row matching
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use other constructor.
    */
+  @Deprecated
   public CompareFilter(final CompareOp compareOp,
       final ByteArrayComparable comparator) {
-    this.compareOp = compareOp;
+    this(CompareOperator.valueOf(compareOp.name()), comparator);
+  }
+
+  /**
+   * Constructor.
+   * @param op the compare op for row matching
+   * @param comparator the comparator for row matching
+   */
+  public CompareFilter(final CompareOperator op,
+                       final ByteArrayComparable comparator) {
+    this.op = op;
     this.comparator = comparator;
   }
 
   /**
    * @return operator
+   * @deprecated  since 2.0.0. Will be removed in 3.0.0. Use {@link #getCompareOperator()} instead.
    */
+  @Deprecated
   public CompareOp getOperator() {
-    return compareOp;
+    return CompareOp.valueOf(op.name());
+  }
+
+  public CompareOperator getCompareOperator() {
+    return op;
   }
 
   /**
@@ -108,6 +127,11 @@ public abstract class CompareFilter extends FilterBase {
     return false;
   }
 
+  /**
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #compareRow(CompareOperator, ByteArrayComparable, Cell)}
+   */
+  @Deprecated
   protected boolean compareRow(final CompareOp compareOp, final ByteArrayComparable comparator,
       final Cell cell) {
     if (compareOp == CompareOp.NO_OP) {
@@ -117,6 +141,20 @@ public abstract class CompareFilter extends FilterBase {
     return compare(compareOp, compareResult);
   }
 
+  protected boolean compareRow(final CompareOperator op, final ByteArrayComparable comparator,
+                               final Cell cell) {
+    if (op == CompareOperator.NO_OP) {
+      return true;
+    }
+    int compareResult = CellComparator.compareRow(cell, comparator);
+    return compare(op, compareResult);
+  }
+
+  /**
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #compareFamily(CompareOperator, ByteArrayComparable, Cell)}
+   */
+  @Deprecated
   protected boolean compareFamily(final CompareOp compareOp, final ByteArrayComparable comparator,
       final Cell cell) {
     if (compareOp == CompareOp.NO_OP) {
@@ -126,8 +164,23 @@ public abstract class CompareFilter extends FilterBase {
     return compare(compareOp, compareResult);
   }
 
+  protected boolean compareFamily(final CompareOperator op, final ByteArrayComparable comparator,
+                                  final Cell cell) {
+    if (op == CompareOperator.NO_OP) {
+      return true;
+    }
+    int compareResult = CellComparator.compareFamily(cell, comparator);
+    return compare(op, compareResult);
+  }
+
+  /**
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #compareQualifier(CompareOperator, ByteArrayComparable, Cell)}
+   */
+  @Deprecated
   protected boolean compareQualifier(final CompareOp compareOp,
       final ByteArrayComparable comparator, final Cell cell) {
+    // We do not call through to the non-deprecated method for perf reasons.
     if (compareOp == CompareOp.NO_OP) {
       return true;
     }
@@ -135,8 +188,24 @@ public abstract class CompareFilter extends FilterBase {
     return compare(compareOp, compareResult);
   }
 
+  protected boolean compareQualifier(final CompareOperator op,
+                                     final ByteArrayComparable comparator, final Cell cell) {
+    // We do not call through to the non-deprecated method for perf reasons.
+    if (op == CompareOperator.NO_OP) {
+      return true;
+    }
+    int compareResult = CellComparator.compareQualifier(cell, comparator);
+    return compare(op, compareResult);
+  }
+
+  /**
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #compareValue(CompareOperator, ByteArrayComparable, Cell)}
+   */
+  @Deprecated
   protected boolean compareValue(final CompareOp compareOp, final ByteArrayComparable comparator,
       final Cell cell) {
+    // We do not call through to the non-deprecated method for perf reasons.
     if (compareOp == CompareOp.NO_OP) {
       return true;
     }
@@ -144,8 +213,17 @@ public abstract class CompareFilter extends FilterBase {
     return compare(compareOp, compareResult);
   }
 
-  private boolean compare(final CompareOp compareOp, int compareResult) {
-    switch (compareOp) {
+  protected boolean compareValue(final CompareOperator op, final ByteArrayComparable comparator,
+                                 final Cell cell) {
+    if (op == CompareOperator.NO_OP) {
+      return true;
+    }
+    int compareResult = CellComparator.compareValue(cell, comparator);
+    return compare(op, compareResult);
+  }
+
+  static boolean compare(final CompareOp op, int compareResult) {
+    switch (op) {
     case LESS:
       return compareResult <= 0;
     case LESS_OR_EQUAL:
@@ -159,7 +237,26 @@ public abstract class CompareFilter extends FilterBase {
     case GREATER:
       return compareResult >= 0;
     default:
-      throw new RuntimeException("Unknown Compare op " + compareOp.name());
+      throw new RuntimeException("Unknown Compare op " + op.name());
+    }
+  }
+
+  static boolean compare(final CompareOperator op, int compareResult) {
+    switch (op) {
+      case LESS:
+        return compareResult <= 0;
+      case LESS_OR_EQUAL:
+        return compareResult < 0;
+      case EQUAL:
+        return compareResult != 0;
+      case NOT_EQUAL:
+        return compareResult == 0;
+      case GREATER_OR_EQUAL:
+        return compareResult > 0;
+      case GREATER:
+        return compareResult >= 0;
+      default:
+        throw new RuntimeException("Unknown Compare op " + op.name());
     }
   }
 
@@ -167,20 +264,20 @@ public abstract class CompareFilter extends FilterBase {
   public static ArrayList<Object> extractArguments(ArrayList<byte []> filterArguments) {
     Preconditions.checkArgument(filterArguments.size() == 2,
                                 "Expected 2 but got: %s", filterArguments.size());
-    CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(0));
+    CompareOperator op = ParseFilter.createCompareOperator(filterArguments.get(0));
     ByteArrayComparable comparator = ParseFilter.createComparator(
       ParseFilter.removeQuotesFromByteArray(filterArguments.get(1)));
 
     if (comparator instanceof RegexStringComparator ||
         comparator instanceof SubstringComparator) {
-      if (compareOp != CompareOp.EQUAL &&
-          compareOp != CompareOp.NOT_EQUAL) {
+      if (op != CompareOperator.EQUAL &&
+          op != CompareOperator.NOT_EQUAL) {
         throw new IllegalArgumentException ("A regexstring comparator and substring comparator" +
                                             " can only be used with EQUAL and NOT_EQUAL");
       }
     }
     ArrayList<Object> arguments = new ArrayList<>(2);
-    arguments.add(compareOp);
+    arguments.add(op);
     arguments.add(comparator);
     return arguments;
   }
@@ -191,7 +288,7 @@ public abstract class CompareFilter extends FilterBase {
   FilterProtos.CompareFilter convert() {
     FilterProtos.CompareFilter.Builder builder =
       FilterProtos.CompareFilter.newBuilder();
-    HBaseProtos.CompareType compareOp = CompareType.valueOf(this.compareOp.name());
+    HBaseProtos.CompareType compareOp = CompareType.valueOf(this.op.name());
     builder.setCompareOp(compareOp);
     if (this.comparator != null) builder.setComparator(ProtobufUtil.toComparator(this.comparator));
     return builder.build();
@@ -206,9 +303,8 @@ public abstract class CompareFilter extends FilterBase {
   boolean areSerializedFieldsEqual(Filter o) {
     if (o == this) return true;
     if (!(o instanceof CompareFilter)) return false;
-
     CompareFilter other = (CompareFilter)o;
-    return this.getOperator().equals(other.getOperator()) &&
+    return this.getCompareOperator().equals(other.getCompareOperator()) &&
       (this.getComparator() == other.getComparator()
         || this.getComparator().areSerializedFieldsEqual(other.getComparator()));
   }
@@ -217,7 +313,7 @@ public abstract class CompareFilter extends FilterBase {
   public String toString() {
     return String.format("%s (%s, %s)",
         this.getClass().getSimpleName(),
-        this.compareOp.name(),
+        this.op.name(),
         Bytes.toStringBinary(this.comparator.getValue()));
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
index 90d00dd..259f38e 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
@@ -26,6 +26,7 @@ import java.util.Set;
 
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -64,12 +65,35 @@ public class DependentColumnFilter extends CompareFilter {
    * @param dropDependentColumn whether the column should be discarded after
    * @param valueCompareOp comparison op 
    * @param valueComparator comparator
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #DependentColumnFilter(byte[], byte[], boolean, CompareOperator, ByteArrayComparable)}
+   * instead.
    */
+  @Deprecated
   public DependentColumnFilter(final byte [] family, final byte[] qualifier,
       final boolean dropDependentColumn, final CompareOp valueCompareOp,
         final ByteArrayComparable valueComparator) {
-    // set up the comparator   
-    super(valueCompareOp, valueComparator);
+    this(family, qualifier, dropDependentColumn, CompareOperator.valueOf(valueCompareOp.name()),
+      valueComparator);
+  }
+
+  /**
+   * Build a dependent column filter with value checking
+   * dependent column varies will be compared using the supplied
+   * compareOp and comparator, for usage of which
+   * refer to {@link CompareFilter}
+   *
+   * @param family dependent column family
+   * @param qualifier dependent column qualifier
+   * @param dropDependentColumn whether the column should be discarded after
+   * @param op Value comparison op
+   * @param valueComparator comparator
+   */
+  public DependentColumnFilter(final byte [] family, final byte[] qualifier,
+                               final boolean dropDependentColumn, final CompareOperator op,
+                               final ByteArrayComparable valueComparator) {
+    // set up the comparator
+    super(op, valueComparator);
     this.columnFamily = family;
     this.columnQualifier = qualifier;
     this.dropDependentColumn = dropDependentColumn;
@@ -140,7 +164,7 @@ public class DependentColumnFilter extends CompareFilter {
     }
     // If it doesn't pass the op, skip it
     if (comparator != null
-        && compareValue(compareOp, comparator, c))
+        && compareValue(getCompareOperator(), comparator, c))
       return ReturnCode.SKIP;
   
     stampSet.add(c.getTimestamp());
@@ -194,11 +218,11 @@ public class DependentColumnFilter extends CompareFilter {
       byte [] family = ParseFilter.removeQuotesFromByteArray(filterArguments.get(0));
       byte [] qualifier = ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
       boolean dropDependentColumn = ParseFilter.convertByteArrayToBoolean(filterArguments.get(2));
-      CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(3));
+      CompareOperator op = ParseFilter.createCompareOperator(filterArguments.get(3));
       ByteArrayComparable comparator = ParseFilter.createComparator(
         ParseFilter.removeQuotesFromByteArray(filterArguments.get(4)));
       return new DependentColumnFilter(family, qualifier, dropDependentColumn,
-                                       compareOp, comparator);
+                                       op, comparator);
     } else {
       throw new IllegalArgumentException("Expected 2, 3 or 5 but got: " + filterArguments.size());
     }
@@ -235,8 +259,8 @@ public class DependentColumnFilter extends CompareFilter {
     } catch (InvalidProtocolBufferException e) {
       throw new DeserializationException(e);
     }
-    final CompareOp valueCompareOp =
-      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
+    final CompareOperator valueCompareOp =
+    CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
     ByteArrayComparable valueComparator = null;
     try {
       if (proto.getCompareFilter().hasComparator()) {
@@ -276,7 +300,7 @@ public class DependentColumnFilter extends CompareFilter {
         Bytes.toStringBinary(this.columnFamily),
         Bytes.toStringBinary(this.columnQualifier),
         this.dropDependentColumn,
-        this.compareOp.name(),
+        this.op.name(),
         this.comparator != null ? Bytes.toStringBinary(this.comparator.getValue()) : "null");
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
index a28855d..1f5c777 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -51,17 +52,31 @@ public class FamilyFilter extends CompareFilter {
    *
    * @param familyCompareOp  the compare op for column family matching
    * @param familyComparator the comparator for column family matching
+   * @deprecated  Since 2.0.0. Will be removed in 3.0.0.
+   *  Use {@link #FamilyFilter(CompareOperator, ByteArrayComparable)}
    */
+  @Deprecated
   public FamilyFilter(final CompareOp familyCompareOp,
                       final ByteArrayComparable familyComparator) {
       super(familyCompareOp, familyComparator);
   }
 
+  /**
+   * Constructor.
+   *
+   * @param op  the compare op for column family matching
+   * @param familyComparator the comparator for column family matching
+   */
+  public FamilyFilter(final CompareOperator op,
+                      final ByteArrayComparable familyComparator) {
+    super(op, familyComparator);
+  }
+
   @Override
   public ReturnCode filterKeyValue(Cell v) {
     int familyLength = v.getFamilyLength();
     if (familyLength > 0) {
-      if (compareFamily(this.compareOp, this.comparator, v)) {
+      if (compareFamily(getCompareOperator(), this.comparator, v)) {
         return ReturnCode.NEXT_ROW;
       }
     }
@@ -70,7 +85,7 @@ public class FamilyFilter extends CompareFilter {
 
   public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
     ArrayList<?> arguments = CompareFilter.extractArguments(filterArguments);
-    CompareOp compareOp = (CompareOp)arguments.get(0);
+    CompareOperator compareOp = (CompareOperator)arguments.get(0);
     ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
     return new FamilyFilter(compareOp, comparator);
   }
@@ -99,8 +114,8 @@ public class FamilyFilter extends CompareFilter {
     } catch (InvalidProtocolBufferException e) {
       throw new DeserializationException(e);
     }
-    final CompareOp valueCompareOp =
-      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
+    final CompareOperator valueCompareOp =
+      CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
     ByteArrayComparable valueComparator = null;
     try {
       if (proto.getCompareFilter().hasComparator()) {
@@ -113,7 +128,6 @@ public class FamilyFilter extends CompareFilter {
   }
 
   /**
-   * @param other
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
index 21cdd9c..3c93870 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
@@ -32,6 +32,7 @@ import java.util.Stack;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -765,12 +766,40 @@ public class ParseFilter {
     }
   }
 
-/**
- * Takes a compareOperator symbol as a byte array and returns the corresponding CompareOperator
- * <p>
- * @param compareOpAsByteArray the comparatorOperator symbol as a byte array
- * @return the Compare Operator
- */
+  /**
+   * Takes a compareOperator symbol as a byte array and returns the corresponding CompareOperator
+   * @deprecated Since 2.0
+   * <p>
+   * @param compareOpAsByteArray the comparatorOperator symbol as a byte array
+   * @return the Compare Operator
+   */
+  public static CompareOperator createCompareOperator (byte [] compareOpAsByteArray) {
+    ByteBuffer compareOp = ByteBuffer.wrap(compareOpAsByteArray);
+    if (compareOp.equals(ParseConstants.LESS_THAN_BUFFER))
+      return CompareOperator.LESS;
+    else if (compareOp.equals(ParseConstants.LESS_THAN_OR_EQUAL_TO_BUFFER))
+      return CompareOperator.LESS_OR_EQUAL;
+    else if (compareOp.equals(ParseConstants.GREATER_THAN_BUFFER))
+      return CompareOperator.GREATER;
+    else if (compareOp.equals(ParseConstants.GREATER_THAN_OR_EQUAL_TO_BUFFER))
+      return CompareOperator.GREATER_OR_EQUAL;
+    else if (compareOp.equals(ParseConstants.NOT_EQUAL_TO_BUFFER))
+      return CompareOperator.NOT_EQUAL;
+    else if (compareOp.equals(ParseConstants.EQUAL_TO_BUFFER))
+      return CompareOperator.EQUAL;
+    else
+      throw new IllegalArgumentException("Invalid compare operator");
+  }
+
+  /**
+   * Takes a compareOperator symbol as a byte array and returns the corresponding CompareOperator
+   * @deprecated Since 2.0
+   * <p>
+   * @param compareOpAsByteArray the comparatorOperator symbol as a byte array
+   * @return the Compare Operator
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #createCompareOperator(byte [])}
+   */
+  @Deprecated
   public static CompareFilter.CompareOp createCompareOp (byte [] compareOpAsByteArray) {
     ByteBuffer compareOp = ByteBuffer.wrap(compareOpAsByteArray);
     if (compareOp.equals(ParseConstants.LESS_THAN_BUFFER))

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
index 72a50fb..9a8d461 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -50,17 +51,30 @@ public class QualifierFilter extends CompareFilter {
    * Constructor.
    * @param op the compare op for column qualifier matching
    * @param qualifierComparator the comparator for column qualifier matching
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #QualifierFilter(CompareOperator, ByteArrayComparable)} instead.
    */
+  @Deprecated
   public QualifierFilter(final CompareOp op,
       final ByteArrayComparable qualifierComparator) {
     super(op, qualifierComparator);
   }
 
+  /**
+   * Constructor.
+   * @param op the compare op for column qualifier matching
+   * @param qualifierComparator the comparator for column qualifier matching
+   */
+  public QualifierFilter(final CompareOperator op,
+                         final ByteArrayComparable qualifierComparator) {
+    super(op, qualifierComparator);
+  }
+
   @Override
   public ReturnCode filterKeyValue(Cell v) {
     int qualifierLength = v.getQualifierLength();
     if (qualifierLength > 0) {
-      if (compareQualifier(this.compareOp, this.comparator, v)) {
+      if (compareQualifier(getCompareOperator(), this.comparator, v)) {
         return ReturnCode.SKIP;
       }
     }
@@ -69,7 +83,7 @@ public class QualifierFilter extends CompareFilter {
 
   public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
     ArrayList<?> arguments = CompareFilter.extractArguments(filterArguments);
-    CompareOp compareOp = (CompareOp)arguments.get(0);
+    CompareOperator compareOp = (CompareOperator)arguments.get(0);
     ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
     return new QualifierFilter(compareOp, comparator);
   }
@@ -98,8 +112,8 @@ public class QualifierFilter extends CompareFilter {
     } catch (InvalidProtocolBufferException e) {
       throw new DeserializationException(e);
     }
-    final CompareOp valueCompareOp =
-      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
+    final CompareOperator valueCompareOp =
+      CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
     ByteArrayComparable valueComparator = null;
     try {
       if (proto.getCompareFilter().hasComparator()) {
@@ -112,7 +126,6 @@ public class QualifierFilter extends CompareFilter {
   }
 
   /**
-   * @param other
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
index 3f6136f..ade017d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -51,12 +52,25 @@ public class RowFilter extends CompareFilter {
    * Constructor.
    * @param rowCompareOp the compare op for row matching
    * @param rowComparator the comparator for row matching
+   * @deprecated Since 2.0.0. Will remove in 3.0.0. Use
+   * {@link #RowFilter(CompareOperator, ByteArrayComparable)}} instead.
    */
+  @Deprecated
   public RowFilter(final CompareOp rowCompareOp,
       final ByteArrayComparable rowComparator) {
     super(rowCompareOp, rowComparator);
   }
 
+  /**
+   * Constructor.
+   * @param op the compare op for row matching
+   * @param rowComparator the comparator for row matching
+   */
+  public RowFilter(final CompareOperator op,
+                   final ByteArrayComparable rowComparator) {
+    super(op, rowComparator);
+  }
+
   @Override
   public void reset() {
     this.filterOutRow = false;
@@ -72,7 +86,7 @@ public class RowFilter extends CompareFilter {
 
   @Override
   public boolean filterRowKey(Cell firstRowCell) {
-    if (compareRow(this.compareOp, this.comparator, firstRowCell)) {
+    if (compareRow(getCompareOperator(), this.comparator, firstRowCell)) {
       this.filterOutRow = true;
     }
     return this.filterOutRow;
@@ -86,7 +100,7 @@ public class RowFilter extends CompareFilter {
   public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
     @SuppressWarnings("rawtypes") // for arguments
     ArrayList arguments = CompareFilter.extractArguments(filterArguments);
-    CompareOp compareOp = (CompareOp)arguments.get(0);
+    CompareOperator compareOp = (CompareOperator)arguments.get(0);
     ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
     return new RowFilter(compareOp, comparator);
   }
@@ -115,8 +129,8 @@ public class RowFilter extends CompareFilter {
     } catch (InvalidProtocolBufferException e) {
       throw new DeserializationException(e);
     }
-    final CompareOp valueCompareOp =
-      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
+    final CompareOperator valueCompareOp =
+      CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
     ByteArrayComparable valueComparator = null;
     try {
       if (proto.getCompareFilter().hasComparator()) {
@@ -129,7 +143,6 @@ public class RowFilter extends CompareFilter {
   }
 
   /**
-   * @param other
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
index 6b155b0..74fd9c9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
@@ -26,6 +26,7 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
@@ -52,7 +53,9 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
    * @param qualifier name of column qualifier
    * @param compareOp operator
    * @param value value to compare column values against
+   * {@link #SingleColumnValueExcludeFilter(byte[], byte[], CompareOperator, byte[])}
    */
+  @Deprecated
   public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier,
       CompareOp compareOp, byte[] value) {
     super(family, qualifier, compareOp, value);
@@ -61,6 +64,22 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
   /**
    * Constructor for binary compare of the value of a single column. If the
    * column is found and the condition passes, all columns of the row will be
+   * emitted; except for the tested column value. If the column is not found or
+   * the condition fails, the row will not be emitted.
+   *
+   * @param family name of column family
+   * @param qualifier name of column qualifier
+   * @param op operator
+   * @param value value to compare column values against
+   */
+  public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier,
+                                        CompareOperator op, byte[] value) {
+    super(family, qualifier, op, value);
+  }
+
+  /**
+   * Constructor for binary compare of the value of a single column. If the
+   * column is found and the condition passes, all columns of the row will be
    * emitted; except for the tested column value. If the condition fails, the
    * row will not be emitted.
    * <p>
@@ -72,13 +91,37 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
    * @param qualifier name of column qualifier
    * @param compareOp operator
    * @param comparator Comparator to use.
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #SingleColumnValueExcludeFilter(byte[], byte[], CompareOperator, ByteArrayComparable)}
    */
+  @Deprecated
   public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier,
       CompareOp compareOp, ByteArrayComparable comparator) {
     super(family, qualifier, compareOp, comparator);
   }
 
   /**
+   * Constructor for binary compare of the value of a single column. If the
+   * column is found and the condition passes, all columns of the row will be
+   * emitted; except for the tested column value. If the condition fails, the
+   * row will not be emitted.
+   * <p>
+   * Use the filterIfColumnMissing flag to set whether the rest of the columns
+   * in a row will be emitted if the specified column to check is not found in
+   * the row.
+   *
+   * @param family name of column family
+   * @param qualifier name of column qualifier
+   * @param op operator
+   * @param comparator Comparator to use.
+   */
+  public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier,
+                                        CompareOperator op, ByteArrayComparable comparator) {
+    super(family, qualifier, op, comparator);
+  }
+
+
+  /**
    * Constructor for protobuf deserialization only.
    * @param family
    * @param qualifier
@@ -86,11 +129,30 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
    * @param comparator
    * @param filterIfMissing
    * @param latestVersionOnly
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #SingleColumnValueExcludeFilter(byte[], byte[], CompareOperator, ByteArrayComparable, boolean, boolean)}
    */
+  @Deprecated
   protected SingleColumnValueExcludeFilter(final byte[] family, final byte[] qualifier,
       final CompareOp compareOp, ByteArrayComparable comparator, final boolean filterIfMissing,
       final boolean latestVersionOnly) {
-    super(family, qualifier, compareOp, comparator, filterIfMissing, latestVersionOnly);
+    this(family, qualifier, CompareOperator.valueOf(compareOp.name()), comparator,
+      filterIfMissing, latestVersionOnly);
+  }
+
+  /**
+   * Constructor for protobuf deserialization only.
+   * @param family
+   * @param qualifier
+   * @param op
+   * @param comparator
+   * @param filterIfMissing
+   * @param latestVersionOnly
+   */
+  protected SingleColumnValueExcludeFilter(final byte[] family, final byte[] qualifier,
+      final CompareOperator op, ByteArrayComparable comparator, final boolean filterIfMissing,
+      final boolean latestVersionOnly) {
+    super(family, qualifier, op, comparator, filterIfMissing, latestVersionOnly);
   }
 
   // We cleaned result row in FilterRow to be consistent with scanning process.
@@ -151,8 +213,8 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
     }
 
     FilterProtos.SingleColumnValueFilter parentProto = proto.getSingleColumnValueFilter();
-    final CompareOp compareOp =
-      CompareOp.valueOf(parentProto.getCompareOp().name());
+    final CompareOperator compareOp =
+      CompareOperator.valueOf(parentProto.getCompareOp().name());
     final ByteArrayComparable comparator;
     try {
       comparator = ProtobufUtil.toComparator(parentProto.getComparator());
@@ -167,7 +229,6 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
   }
 
   /**
-   * @param other
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
index c056833..594dbca 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
@@ -71,7 +72,7 @@ public class SingleColumnValueFilter extends FilterBase {
 
   protected byte [] columnFamily;
   protected byte [] columnQualifier;
-  protected CompareOp compareOp;
+  protected CompareOperator op;
   protected org.apache.hadoop.hbase.filter.ByteArrayComparable comparator;
   protected boolean foundColumn = false;
   protected boolean matchedColumn = false;
@@ -91,10 +92,34 @@ public class SingleColumnValueFilter extends FilterBase {
    * @param qualifier name of column qualifier
    * @param compareOp operator
    * @param value value to compare column values against
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #SingleColumnValueFilter(byte[], byte[], CompareOperator, byte[])} instead.
    */
+  @Deprecated
   public SingleColumnValueFilter(final byte [] family, final byte [] qualifier,
       final CompareOp compareOp, final byte[] value) {
-    this(family, qualifier, compareOp, new org.apache.hadoop.hbase.filter.BinaryComparator(value));
+    this(family, qualifier, CompareOperator.valueOf(compareOp.name()),
+      new org.apache.hadoop.hbase.filter.BinaryComparator(value));
+  }
+
+  /**
+   * Constructor for binary compare of the value of a single column.  If the
+   * column is found and the condition passes, all columns of the row will be
+   * emitted.  If the condition fails, the row will not be emitted.
+   * <p>
+   * Use the filterIfColumnMissing flag to set whether the rest of the columns
+   * in a row will be emitted if the specified column to check is not found in
+   * the row.
+   *
+   * @param family name of column family
+   * @param qualifier name of column qualifier
+   * @param op operator
+   * @param value value to compare column values against
+   */
+  public SingleColumnValueFilter(final byte [] family, final byte [] qualifier,
+                                 final CompareOperator op, final byte[] value) {
+    this(family, qualifier, op,
+      new org.apache.hadoop.hbase.filter.BinaryComparator(value));
   }
 
   /**
@@ -110,13 +135,36 @@ public class SingleColumnValueFilter extends FilterBase {
    * @param qualifier name of column qualifier
    * @param compareOp operator
    * @param comparator Comparator to use.
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #SingleColumnValueFilter(byte[], byte[], CompareOperator, ByteArrayComparable)} instead.
    */
+  @Deprecated
   public SingleColumnValueFilter(final byte [] family, final byte [] qualifier,
       final CompareOp compareOp,
       final org.apache.hadoop.hbase.filter.ByteArrayComparable comparator) {
+    this(family, qualifier, CompareOperator.valueOf(compareOp.name()), comparator);
+  }
+
+  /**
+   * Constructor for binary compare of the value of a single column.  If the
+   * column is found and the condition passes, all columns of the row will be
+   * emitted.  If the condition fails, the row will not be emitted.
+   * <p>
+   * Use the filterIfColumnMissing flag to set whether the rest of the columns
+   * in a row will be emitted if the specified column to check is not found in
+   * the row.
+   *
+   * @param family name of column family
+   * @param qualifier name of column qualifier
+   * @param op operator
+   * @param comparator Comparator to use.
+   */
+  public SingleColumnValueFilter(final byte [] family, final byte [] qualifier,
+      final CompareOperator op,
+      final org.apache.hadoop.hbase.filter.ByteArrayComparable comparator) {
     this.columnFamily = family;
     this.columnQualifier = qualifier;
-    this.compareOp = compareOp;
+    this.op = op;
     this.comparator = comparator;
   }
 
@@ -128,21 +176,47 @@ public class SingleColumnValueFilter extends FilterBase {
    * @param comparator
    * @param filterIfMissing
    * @param latestVersionOnly
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use
+   * {@link #SingleColumnValueFilter(byte[], byte[], CompareOperator, ByteArrayComparable,
+   *   boolean, boolean)} instead.
    */
+  @Deprecated
   protected SingleColumnValueFilter(final byte[] family, final byte[] qualifier,
       final CompareOp compareOp, org.apache.hadoop.hbase.filter.ByteArrayComparable comparator,
       final boolean filterIfMissing,
       final boolean latestVersionOnly) {
-    this(family, qualifier, compareOp, comparator);
+    this(family, qualifier, CompareOperator.valueOf(compareOp.name()), comparator, filterIfMissing,
+      latestVersionOnly);
+  }
+
+  /**
+   * Constructor for protobuf deserialization only.
+   * @param family
+   * @param qualifier
+   * @param op
+   * @param comparator
+   * @param filterIfMissing
+   * @param latestVersionOnly
+   */
+  protected SingleColumnValueFilter(final byte[] family, final byte[] qualifier,
+      final CompareOperator op, org.apache.hadoop.hbase.filter.ByteArrayComparable comparator,
+       final boolean filterIfMissing, final boolean latestVersionOnly) {
+    this(family, qualifier, op, comparator);
     this.filterIfMissing = filterIfMissing;
     this.latestVersionOnly = latestVersionOnly;
   }
 
   /**
    * @return operator
+   * @deprecated  since 2.0.0. Will be removed in 3.0.0. Use {@link #getCompareOperator()} instead.
    */
+  @Deprecated
   public CompareOp getOperator() {
-    return compareOp;
+    return CompareOp.valueOf(op.name());
+  }
+
+  public CompareOperator getCompareOperator() {
+    return op;
   }
 
   /**
@@ -195,22 +269,7 @@ public class SingleColumnValueFilter extends FilterBase {
 
   private boolean filterColumnValue(final Cell cell) {
     int compareResult = CellComparator.compareValue(cell, this.comparator);
-    switch (this.compareOp) {
-    case LESS:
-      return compareResult <= 0;
-    case LESS_OR_EQUAL:
-      return compareResult < 0;
-    case EQUAL:
-      return compareResult != 0;
-    case NOT_EQUAL:
-      return compareResult == 0;
-    case GREATER_OR_EQUAL:
-      return compareResult > 0;
-    case GREATER:
-      return compareResult >= 0;
-    default:
-      throw new RuntimeException("Unknown Compare op " + compareOp.name());
-    }
+    return CompareFilter.compare(this.op, compareResult);
   }
 
   public boolean filterRow() {
@@ -276,21 +335,21 @@ public class SingleColumnValueFilter extends FilterBase {
                                 "Expected 4 or 6 but got: %s", filterArguments.size());
     byte [] family = ParseFilter.removeQuotesFromByteArray(filterArguments.get(0));
     byte [] qualifier = ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
-    CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(2));
+    CompareOperator op = ParseFilter.createCompareOperator(filterArguments.get(2));
     org.apache.hadoop.hbase.filter.ByteArrayComparable comparator = ParseFilter.createComparator(
       ParseFilter.removeQuotesFromByteArray(filterArguments.get(3)));
 
     if (comparator instanceof RegexStringComparator ||
         comparator instanceof SubstringComparator) {
-      if (compareOp != CompareOp.EQUAL &&
-          compareOp != CompareOp.NOT_EQUAL) {
+      if (op != CompareOperator.EQUAL &&
+          op != CompareOperator.NOT_EQUAL) {
         throw new IllegalArgumentException ("A regexstring comparator and substring comparator " +
                                             "can only be used with EQUAL and NOT_EQUAL");
       }
     }
 
     SingleColumnValueFilter filter = new SingleColumnValueFilter(family, qualifier,
-                                                                 compareOp, comparator);
+                                                                 op, comparator);
 
     if (filterArguments.size() == 6) {
       boolean filterIfMissing = ParseFilter.convertByteArrayToBoolean(filterArguments.get(4));
@@ -310,7 +369,7 @@ public class SingleColumnValueFilter extends FilterBase {
     if (this.columnQualifier != null) {
       builder.setColumnQualifier(UnsafeByteOperations.unsafeWrap(this.columnQualifier));
     }
-    HBaseProtos.CompareType compareOp = CompareType.valueOf(this.compareOp.name());
+    HBaseProtos.CompareType compareOp = CompareType.valueOf(this.op.name());
     builder.setCompareOp(compareOp);
     builder.setComparator(ProtobufUtil.toComparator(this.comparator));
     builder.setFilterIfMissing(this.filterIfMissing);
@@ -341,8 +400,8 @@ public class SingleColumnValueFilter extends FilterBase {
       throw new DeserializationException(e);
     }
 
-    final CompareOp compareOp =
-      CompareOp.valueOf(proto.getCompareOp().name());
+    final CompareOperator compareOp =
+      CompareOperator.valueOf(proto.getCompareOp().name());
     final org.apache.hadoop.hbase.filter.ByteArrayComparable comparator;
     try {
       comparator = ProtobufUtil.toComparator(proto.getComparator());
@@ -357,7 +416,6 @@ public class SingleColumnValueFilter extends FilterBase {
   }
 
   /**
-   * @param other
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */
@@ -368,7 +426,7 @@ public class SingleColumnValueFilter extends FilterBase {
     SingleColumnValueFilter other = (SingleColumnValueFilter)o;
     return Bytes.equals(this.getFamily(), other.getFamily())
       && Bytes.equals(this.getQualifier(), other.getQualifier())
-      && this.compareOp.equals(other.compareOp)
+      && this.op.equals(other.op)
       && this.getComparator().areSerializedFieldsEqual(other.getComparator())
       && this.getFilterIfMissing() == other.getFilterIfMissing()
       && this.getLatestVersionOnly() == other.getLatestVersionOnly();
@@ -387,7 +445,7 @@ public class SingleColumnValueFilter extends FilterBase {
   public String toString() {
     return String.format("%s (%s, %s, %s, %s)",
         this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily),
-        Bytes.toStringBinary(this.columnQualifier), this.compareOp.name(),
+        Bytes.toStringBinary(this.columnQualifier), this.op.name(),
         Bytes.toStringBinary(this.comparator.getValue()));
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java
index 4edb57b..fcb2830 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -49,15 +50,27 @@ public class ValueFilter extends CompareFilter {
    * Constructor.
    * @param valueCompareOp the compare op for value matching
    * @param valueComparator the comparator for value matching
+   * @deprecated Since 2.0.0. Will be removed in 3.0.0.
+   * Use {@link #ValueFilter(CompareOperator, ByteArrayComparable)}
    */
   public ValueFilter(final CompareOp valueCompareOp,
       final ByteArrayComparable valueComparator) {
     super(valueCompareOp, valueComparator);
   }
 
+  /**
+   * Constructor.
+   * @param valueCompareOp the compare op for value matching
+   * @param valueComparator the comparator for value matching
+   */
+  public ValueFilter(final CompareOperator valueCompareOp,
+                     final ByteArrayComparable valueComparator) {
+    super(valueCompareOp, valueComparator);
+  }
+
   @Override
   public ReturnCode filterKeyValue(Cell v) {
-    if (compareValue(this.compareOp, this.comparator, v)) {
+    if (compareValue(getCompareOperator(), this.comparator, v)) {
       return ReturnCode.SKIP;
     }
     return ReturnCode.INCLUDE;
@@ -66,7 +79,7 @@ public class ValueFilter extends CompareFilter {
   public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
     @SuppressWarnings("rawtypes")  // for arguments
     ArrayList arguments = CompareFilter.extractArguments(filterArguments);
-    CompareOp compareOp = (CompareOp)arguments.get(0);
+    CompareOperator compareOp = (CompareOperator)arguments.get(0);
     ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
     return new ValueFilter(compareOp, comparator);
   }
@@ -95,8 +108,8 @@ public class ValueFilter extends CompareFilter {
     } catch (InvalidProtocolBufferException e) {
       throw new DeserializationException(e);
     }
-    final CompareOp valueCompareOp =
-      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
+    final CompareOperator valueCompareOp =
+      CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
     ByteArrayComparable valueComparator = null;
     try {
       if (proto.getCompareFilter().hasComparator()) {
@@ -109,7 +122,7 @@ public class ValueFilter extends CompareFilter {
   }
 
   /**
-   * @param other
+
    * @return true if and only if the fields of the filter that are serialized
    * are equal to the corresponding fields in other.  Used for testing.
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
index d1bbade..4382e36 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
@@ -32,6 +32,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellScanner;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
@@ -196,9 +197,9 @@ public class QuotaTableUtil {
 
       if (!Strings.isEmpty(filter.getNamespaceFilter())) {
         FilterList nsFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL);
-        nsFilters.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL,
+        nsFilters.addFilter(new RowFilter(CompareOperator.EQUAL,
             new RegexStringComparator(getUserRowKeyRegex(filter.getUserFilter()), 0)));
-        nsFilters.addFilter(new QualifierFilter(CompareFilter.CompareOp.EQUAL,
+        nsFilters.addFilter(new QualifierFilter(CompareOperator.EQUAL,
             new RegexStringComparator(
               getSettingsQualifierRegexForUserNamespace(filter.getNamespaceFilter()), 0)));
         userFilters.addFilter(nsFilters);
@@ -206,25 +207,25 @@ public class QuotaTableUtil {
       }
       if (!Strings.isEmpty(filter.getTableFilter())) {
         FilterList tableFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL);
-        tableFilters.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL,
+        tableFilters.addFilter(new RowFilter(CompareOperator.EQUAL,
             new RegexStringComparator(getUserRowKeyRegex(filter.getUserFilter()), 0)));
-        tableFilters.addFilter(new QualifierFilter(CompareFilter.CompareOp.EQUAL,
+        tableFilters.addFilter(new QualifierFilter(CompareOperator.EQUAL,
             new RegexStringComparator(
               getSettingsQualifierRegexForUserTable(filter.getTableFilter()), 0)));
         userFilters.addFilter(tableFilters);
         hasFilter = true;
       }
       if (!hasFilter) {
-        userFilters.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL,
+        userFilters.addFilter(new RowFilter(CompareOperator.EQUAL,
             new RegexStringComparator(getUserRowKeyRegex(filter.getUserFilter()), 0)));
       }
 
       filterList.addFilter(userFilters);
     } else if (!Strings.isEmpty(filter.getTableFilter())) {
-      filterList.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL,
+      filterList.addFilter(new RowFilter(CompareOperator.EQUAL,
           new RegexStringComparator(getTableRowKeyRegex(filter.getTableFilter()), 0)));
     } else if (!Strings.isEmpty(filter.getNamespaceFilter())) {
-      filterList.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL,
+      filterList.addFilter(new RowFilter(CompareOperator.EQUAL,
           new RegexStringComparator(getNamespaceRowKeyRegex(filter.getNamespaceFilter()), 0)));
     }
     return filterList;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-common/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java
index 8af562e..7254551 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 
 /** Base class for byte array comparators */
 @InterfaceAudience.Public
-// TODO Now we are deviating a lot from the actual Comparable<byte[]> what this implements, by
+// TODO Now we are deviating a lot from the actual Comparable<byte[]> that this implements, by
 // adding special compareTo methods. We have to clean it. Deprecate this class and replace it
 // with a more generic one which says it compares bytes (not necessary a byte array only)
 // BytesComparable implements Comparable<Byte> will work?

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
index 5a22ab6..648e6a6 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java
@@ -165,7 +165,7 @@ public class IntegrationTestLazyCfLoading {
 
     public Filter getScanFilter() {
       SingleColumnValueFilter scf = new SingleColumnValueFilter(ESSENTIAL_CF, FILTER_COLUMN,
-          CompareFilter.CompareOp.EQUAL, Bytes.toBytes(ACCEPTED_VALUE));
+          CompareOperator.EQUAL, Bytes.toBytes(ACCEPTED_VALUE));
       scf.setFilterIfMissing(true);
       return scf;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java
index 078033e..dd8e7ec 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.conf.Configuration;
@@ -124,8 +125,6 @@ public class CellCounter extends Configured implements Tool {
      * @param values  The columns.
      * @param context The current context.
      * @throws IOException When something is broken with the data.
-     * @see org.apache.hadoop.mapreduce.Mapper#map(KEYIN, VALUEIN,
-     *      org.apache.hadoop.mapreduce.Mapper.Context)
      */
 
     @Override
@@ -260,7 +259,7 @@ public class CellCounter extends Configured implements Tool {
     if (filterCriteria == null) return null;
     if (filterCriteria.startsWith("^")) {
       String regexPattern = filterCriteria.substring(1, filterCriteria.length());
-      rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator(regexPattern));
+      rowFilter = new RowFilter(CompareOperator.EQUAL, new RegexStringComparator(regexPattern));
     } else {
       rowFilter = new PrefixFilter(Bytes.toBytesBinary(filterCriteria));
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java
index 9cc2a80..d60dc20 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java
@@ -25,6 +25,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
@@ -86,7 +87,7 @@ public final class ExportUtils {
     if (filterCriteria == null) return null;
     if (filterCriteria.startsWith("^")) {
       String regexPattern = filterCriteria.substring(1, filterCriteria.length());
-      exportFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator(regexPattern));
+      exportFilter = new RowFilter(CompareOperator.EQUAL, new RegexStringComparator(regexPattern));
     } else {
       exportFilter = new PrefixFilter(Bytes.toBytesBinary(filterCriteria));
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 6b058b0..31c0883 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -1889,7 +1889,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.table.put(put);
       RowMutations mutations = new RowMutations(bytes);
       mutations.add(put);
-      this.table.checkAndMutate(bytes, FAMILY_NAME, getQualifier(), CompareOp.EQUAL, bytes,
+      this.table.checkAndMutate(bytes, FAMILY_NAME, getQualifier(), CompareOperator.EQUAL, bytes,
           mutations);
     }
   }
@@ -1906,7 +1906,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       Put put = new Put(bytes);
       put.addColumn(FAMILY_NAME, getQualifier(), bytes);
       this.table.put(put);
-      this.table.checkAndPut(bytes, FAMILY_NAME, getQualifier(), CompareOp.EQUAL, bytes, put);
+      this.table.checkAndPut(bytes, FAMILY_NAME, getQualifier(), CompareOperator.EQUAL, bytes, put);
     }
   }
 
@@ -1924,7 +1924,8 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.table.put(put);
       Delete delete = new Delete(put.getRow());
       delete.addColumn(FAMILY_NAME, getQualifier());
-      this.table.checkAndDelete(bytes, FAMILY_NAME, getQualifier(), CompareOp.EQUAL, bytes, delete);
+      this.table.checkAndDelete(bytes, FAMILY_NAME, getQualifier(),
+        CompareOperator.EQUAL, bytes, delete);
     }
   }
 
@@ -2008,7 +2009,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
     protected Scan constructScan(byte[] valuePrefix) throws IOException {
       FilterList list = new FilterList();
       Filter filter = new SingleColumnValueFilter(
-          FAMILY_NAME, COLUMN_ZERO, CompareFilter.CompareOp.EQUAL,
+          FAMILY_NAME, COLUMN_ZERO, CompareOperator.EQUAL,
           new BinaryComparator(valuePrefix)
       );
       list.addFilter(filter);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java
index f39a7f5..ace2ffa 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java
@@ -405,7 +405,8 @@ public class TestTableInputFormat {
           Bytes.toBytes("columnB") };
         // mandatory
         setInputColumns(inputColumns);
-        Filter exampleFilter = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("aa.*"));
+        Filter exampleFilter =
+          new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
         // optional
         setRowFilter(exampleFilter);
       } catch (IOException exception) {
@@ -449,7 +450,8 @@ public class TestTableInputFormat {
         Bytes.toBytes("columnB") };
       // mandatory
       setInputColumns(inputColumns);
-      Filter exampleFilter = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("aa.*"));
+      Filter exampleFilter =
+        new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
       // optional
       setRowFilter(exampleFilter);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java
index b4c6ab9..db50899 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java
@@ -417,7 +417,8 @@ public class TestTableInputFormat {
         for (byte[] family : inputColumns) {
           scan.addFamily(family);
         }
-        Filter exampleFilter = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("aa.*"));
+        Filter exampleFilter =
+          new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
         scan.setFilter(exampleFilter);
         setScan(scan);
       } catch (IOException exception) {
@@ -445,7 +446,8 @@ public class TestTableInputFormat {
         for (byte[] family : inputColumns) {
           scan.addFamily(family);
         }
-        Filter exampleFilter = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("aa.*"));
+        Filter exampleFilter =
+          new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
         scan.setFilter(exampleFilter);
         setScan(scan);
       } catch (IOException exception) {
@@ -471,7 +473,8 @@ public class TestTableInputFormat {
       for (byte[] family : inputColumns) {
         scan.addFamily(family);
       }
-      Filter exampleFilter = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("aa.*"));
+      Filter exampleFilter =
+        new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
       scan.setFilter(exampleFilter);
       setScan(scan);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java
----------------------------------------------------------------------
diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java
index fa1d2d6..d46341a 100644
--- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java
+++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java
@@ -18,6 +18,7 @@
 */
 package org.apache.hadoop.hbase.replication;
 
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.shaded.com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Abortable;
@@ -325,7 +326,7 @@ abstract class ReplicationTableBase {
   protected ResultScanner getQueuesBelongingToServer(String server) throws IOException {
     Scan scan = new Scan();
     SingleColumnValueFilter filterMyQueues = new SingleColumnValueFilter(CF_QUEUE, COL_QUEUE_OWNER,
-      CompareFilter.CompareOp.EQUAL, Bytes.toBytes(server));
+    CompareOperator.EQUAL, Bytes.toBytes(server));
     scan.setFilter(filterMyQueues);
     scan.addColumn(CF_QUEUE, COL_QUEUE_OWNER);
     scan.addColumn(CF_QUEUE, COL_QUEUE_OWNER_HISTORY);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java
----------------------------------------------------------------------
diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java
index 5b08129..859bf03 100644
--- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java
+++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java
@@ -433,7 +433,7 @@ public class TableBasedReplicationQueuesImpl extends ReplicationTableBase
     }
     scan.setMaxResultSize(1);
     SingleColumnValueFilter checkOwner = new SingleColumnValueFilter(CF_QUEUE, COL_QUEUE_OWNER,
-      CompareFilter.CompareOp.EQUAL, serverNameBytes);
+    CompareOperator.EQUAL, serverNameBytes);
     scan.setFilter(checkOwner);
     ResultScanner scanner = null;
     try (Table replicationTable = getOrBlockOnReplicationTable()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
index 82ac1d0..17426e2 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
@@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.client.Scan;
@@ -383,10 +384,10 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
       case DependentColumnFilter:
         filter = new DependentColumnFilter(Base64.decode(family),
             qualifier != null ? Base64.decode(qualifier) : null,
-            dropDependentColumn, CompareOp.valueOf(op), comparator.build());
+            dropDependentColumn, CompareOperator.valueOf(op), comparator.build());
         break;
       case FamilyFilter:
-        filter = new FamilyFilter(CompareOp.valueOf(op), comparator.build());
+        filter = new FamilyFilter(CompareOperator.valueOf(op), comparator.build());
         break;
       case FilterList: {
         List<Filter> list = new ArrayList<>(filters.size());
@@ -421,18 +422,18 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
         filter = new PrefixFilter(Base64.decode(value));
         break;
       case QualifierFilter:
-        filter = new QualifierFilter(CompareOp.valueOf(op), comparator.build());
+        filter = new QualifierFilter(CompareOperator.valueOf(op), comparator.build());
         break;
       case RandomRowFilter:
         filter = new RandomRowFilter(chance);
         break;
       case RowFilter:
-        filter = new RowFilter(CompareOp.valueOf(op), comparator.build());
+        filter = new RowFilter(CompareOperator.valueOf(op), comparator.build());
         break;
       case SingleColumnValueFilter:
         filter = new SingleColumnValueFilter(Base64.decode(family),
           qualifier != null ? Base64.decode(qualifier) : null,
-          CompareOp.valueOf(op), comparator.build());
+        CompareOperator.valueOf(op), comparator.build());
         if (ifMissing != null) {
           ((SingleColumnValueFilter)filter).setFilterIfMissing(ifMissing);
         }
@@ -443,7 +444,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
       case SingleColumnValueExcludeFilter:
         filter = new SingleColumnValueExcludeFilter(Base64.decode(family),
           qualifier != null ? Base64.decode(qualifier) : null,
-          CompareOp.valueOf(op), comparator.build());
+        CompareOperator.valueOf(op), comparator.build());
         if (ifMissing != null) {
           ((SingleColumnValueExcludeFilter)filter).setFilterIfMissing(ifMissing);
         }
@@ -458,7 +459,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
         filter = new TimestampsFilter(timestamps);
         break;
       case ValueFilter:
-        filter = new ValueFilter(CompareOp.valueOf(op), comparator.build());
+        filter = new ValueFilter(CompareOperator.valueOf(op), comparator.build());
         break;
       case WhileMatchFilter:
         filter = new WhileMatchFilter(filters.get(0).build());

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
index 6ed170e..476594e 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -1235,7 +1236,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
 
     protected Scan constructScan(byte[] valuePrefix) throws IOException {
       Filter filter = new SingleColumnValueFilter(
-          FAMILY_NAME, QUALIFIER_NAME, CompareFilter.CompareOp.EQUAL,
+          FAMILY_NAME, QUALIFIER_NAME, CompareOperator.EQUAL,
           new BinaryComparator(valuePrefix)
       );
       Scan scan = new Scan();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b8e0a839/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
index 6816e53..5e57e98 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
@@ -37,6 +37,7 @@ import javax.xml.bind.Unmarshaller;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -499,7 +500,7 @@ public class TestScannersWithFilters {
     // Match two keys (one from each family) in half the rows
     long expectedRows = numRows / 2;
     long expectedKeys = 2;
-    Filter f = new QualifierFilter(CompareOp.EQUAL,
+    Filter f = new QualifierFilter(CompareOperator.EQUAL,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     Scan s = new Scan();
     s.setFilter(f);
@@ -509,7 +510,7 @@ public class TestScannersWithFilters {
     // Expect only two keys (one from each family) in half the rows
     expectedRows = numRows / 2;
     expectedKeys = 2;
-    f = new QualifierFilter(CompareOp.LESS,
+    f = new QualifierFilter(CompareOperator.LESS,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -519,7 +520,7 @@ public class TestScannersWithFilters {
     // Expect four keys (two from each family) in half the rows
     expectedRows = numRows / 2;
     expectedKeys = 4;
-    f = new QualifierFilter(CompareOp.LESS_OR_EQUAL,
+    f = new QualifierFilter(CompareOperator.LESS_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -530,7 +531,7 @@ public class TestScannersWithFilters {
     // Only look in first group of rows
     expectedRows = numRows / 2;
     expectedKeys = 4;
-    f = new QualifierFilter(CompareOp.NOT_EQUAL,
+    f = new QualifierFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     s = new Scan(HConstants.EMPTY_START_ROW, Bytes.toBytes("testRowTwo"));
     s.setFilter(f);
@@ -541,7 +542,7 @@ public class TestScannersWithFilters {
     // Only look in first group of rows
     expectedRows = numRows / 2;
     expectedKeys = 4;
-    f = new QualifierFilter(CompareOp.GREATER_OR_EQUAL,
+    f = new QualifierFilter(CompareOperator.GREATER_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     s = new Scan(HConstants.EMPTY_START_ROW, Bytes.toBytes("testRowTwo"));
     s.setFilter(f);
@@ -552,7 +553,7 @@ public class TestScannersWithFilters {
     // Only look in first group of rows
     expectedRows = numRows / 2;
     expectedKeys = 2;
-    f = new QualifierFilter(CompareOp.GREATER,
+    f = new QualifierFilter(CompareOperator.GREATER,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2")));
     s = new Scan(HConstants.EMPTY_START_ROW, Bytes.toBytes("testRowTwo"));
     s.setFilter(f);
@@ -562,7 +563,7 @@ public class TestScannersWithFilters {
     // Look across rows and fully validate the keys and ordering
     // Expect varied numbers of keys, 4 per row in group one, 6 per row in
     // group two
-    f = new QualifierFilter(CompareOp.NOT_EQUAL,
+    f = new QualifierFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(QUALIFIERS_ONE[2]));
     s = new Scan();
     s.setFilter(f);
@@ -610,7 +611,7 @@ public class TestScannersWithFilters {
     // Test across rows and groups with a regex
     // Filter out "test*-2"
     // Expect 4 keys per row across both groups
-    f = new QualifierFilter(CompareOp.NOT_EQUAL,
+    f = new QualifierFilter(CompareOperator.NOT_EQUAL,
         new RegexStringComparator("test.+-2"));
     s = new Scan();
     s.setFilter(f);
@@ -655,7 +656,7 @@ public class TestScannersWithFilters {
     // Match a single row, all keys
     long expectedRows = 1;
     long expectedKeys = colsPerRow;
-    Filter f = new RowFilter(CompareOp.EQUAL,
+    Filter f = new RowFilter(CompareOperator.EQUAL,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     Scan s = new Scan();
     s.setFilter(f);
@@ -664,7 +665,7 @@ public class TestScannersWithFilters {
     // Match a two rows, one from each group, using regex
     expectedRows = 2;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.EQUAL,
+    f = new RowFilter(CompareOperator.EQUAL,
         new RegexStringComparator("testRow.+-2"));
     s = new Scan();
     s.setFilter(f);
@@ -674,7 +675,7 @@ public class TestScannersWithFilters {
     // Expect all keys in one row
     expectedRows = 1;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.LESS,
+    f = new RowFilter(CompareOperator.LESS,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -684,7 +685,7 @@ public class TestScannersWithFilters {
     // Expect all keys in two rows
     expectedRows = 2;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.LESS_OR_EQUAL,
+    f = new RowFilter(CompareOperator.LESS_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -694,7 +695,7 @@ public class TestScannersWithFilters {
     // Expect all keys in all but one row
     expectedRows = numRows - 1;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.NOT_EQUAL,
+    f = new RowFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -704,7 +705,7 @@ public class TestScannersWithFilters {
     // Expect all keys in all but one row
     expectedRows = numRows - 1;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.GREATER_OR_EQUAL,
+    f = new RowFilter(CompareOperator.GREATER_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -714,7 +715,7 @@ public class TestScannersWithFilters {
     // Expect all keys in all but two rows
     expectedRows = numRows - 2;
     expectedKeys = colsPerRow;
-    f = new RowFilter(CompareOp.GREATER,
+    f = new RowFilter(CompareOperator.GREATER,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -723,7 +724,7 @@ public class TestScannersWithFilters {
     // Match rows not equal to testRowTwo-2
     // Look across rows and fully validate the keys and ordering
     // Should see all keys in all rows but testRowTwo-2
-    f = new RowFilter(CompareOp.NOT_EQUAL,
+    f = new RowFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testRowOne-2")));
     s = new Scan();
     s.setFilter(f);
@@ -770,7 +771,7 @@ public class TestScannersWithFilters {
     // Test across rows and groups with a regex
     // Filter out everything that doesn't match "*-2"
     // Expect all keys in two rows
-    f = new RowFilter(CompareOp.EQUAL,
+    f = new RowFilter(CompareOperator.EQUAL,
         new RegexStringComparator(".+-2"));
     s = new Scan();
     s.setFilter(f);
@@ -799,7 +800,7 @@ public class TestScannersWithFilters {
     // Match group one rows
     long expectedRows = numRows / 2;
     long expectedKeys = colsPerRow;
-    Filter f = new ValueFilter(CompareOp.EQUAL,
+    Filter f = new ValueFilter(CompareOperator.EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     Scan s = new Scan();
     s.setFilter(f);
@@ -808,7 +809,7 @@ public class TestScannersWithFilters {
     // Match group two rows
     expectedRows = numRows / 2;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.EQUAL,
+    f = new ValueFilter(CompareOperator.EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueTwo")));
     s = new Scan();
     s.setFilter(f);
@@ -817,7 +818,7 @@ public class TestScannersWithFilters {
     // Match all values using regex
     expectedRows = numRows;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.EQUAL,
+    f = new ValueFilter(CompareOperator.EQUAL,
         new RegexStringComparator("testValue((One)|(Two))"));
     s = new Scan();
     s.setFilter(f);
@@ -827,7 +828,7 @@ public class TestScannersWithFilters {
     // Expect group one rows
     expectedRows = numRows / 2;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.LESS,
+    f = new ValueFilter(CompareOperator.LESS,
         new BinaryComparator(Bytes.toBytes("testValueTwo")));
     s = new Scan();
     s.setFilter(f);
@@ -837,7 +838,7 @@ public class TestScannersWithFilters {
     // Expect all rows
     expectedRows = numRows;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.LESS_OR_EQUAL,
+    f = new ValueFilter(CompareOperator.LESS_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueTwo")));
     s = new Scan();
     s.setFilter(f);
@@ -847,7 +848,7 @@ public class TestScannersWithFilters {
     // Expect group one rows
     expectedRows = numRows / 2;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.LESS_OR_EQUAL,
+    f = new ValueFilter(CompareOperator.LESS_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     s = new Scan();
     s.setFilter(f);
@@ -857,7 +858,7 @@ public class TestScannersWithFilters {
     // Expect half the rows
     expectedRows = numRows / 2;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.NOT_EQUAL,
+    f = new ValueFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     s = new Scan();
     s.setFilter(f);
@@ -867,7 +868,7 @@ public class TestScannersWithFilters {
     // Expect all rows
     expectedRows = numRows;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.GREATER_OR_EQUAL,
+    f = new ValueFilter(CompareOperator.GREATER_OR_EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     s = new Scan();
     s.setFilter(f);
@@ -877,7 +878,7 @@ public class TestScannersWithFilters {
     // Expect half rows
     expectedRows = numRows / 2;
     expectedKeys = colsPerRow;
-    f = new ValueFilter(CompareOp.GREATER,
+    f = new ValueFilter(CompareOperator.GREATER,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     s = new Scan();
     s.setFilter(f);
@@ -886,7 +887,7 @@ public class TestScannersWithFilters {
     // Match values not equal to testValueOne
     // Look across rows and fully validate the keys and ordering
     // Should see all keys in all group two rows
-    f = new ValueFilter(CompareOp.NOT_EQUAL,
+    f = new ValueFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testValueOne")));
     s = new Scan();
     s.setFilter(f);
@@ -921,7 +922,7 @@ public class TestScannersWithFilters {
   public void testSkipFilter() throws Exception {
     // Test for qualifier regex: "testQualifierOne-2"
     // Should only get rows from second group, and all keys
-    Filter f = new SkipFilter(new QualifierFilter(CompareOp.NOT_EQUAL,
+    Filter f = new SkipFilter(new QualifierFilter(CompareOperator.NOT_EQUAL,
         new BinaryComparator(Bytes.toBytes("testQualifierOne-2"))));
     Scan s = new Scan();
     s.setFilter(f);
@@ -958,11 +959,11 @@ public class TestScannersWithFilters {
     // regular expression and substring filters
     // Use must pass all
     List<Filter> filters = new ArrayList<>(3);
-    filters.add(new RowFilter(CompareOp.EQUAL,
+    filters.add(new RowFilter(CompareOperator.EQUAL,
       new RegexStringComparator(".+-2")));
-    filters.add(new QualifierFilter(CompareOp.EQUAL,
+    filters.add(new QualifierFilter(CompareOperator.EQUAL,
       new RegexStringComparator(".+-2")));
-    filters.add(new ValueFilter(CompareOp.EQUAL,
+    filters.add(new ValueFilter(CompareOperator.EQUAL,
       new SubstringComparator("One")));
     Filter f = new FilterList(Operator.MUST_PASS_ALL, filters);
     Scan s = new Scan();
@@ -976,11 +977,11 @@ public class TestScannersWithFilters {
     // Test getting everything with a MUST_PASS_ONE filter including row, qf,
     // val, regular expression and substring filters
     filters.clear();
-    filters.add(new RowFilter(CompareOp.EQUAL,
+    filters.add(new RowFilter(CompareOperator.EQUAL,
       new RegexStringComparator(".+Two.+")));
-    filters.add(new QualifierFilter(CompareOp.EQUAL,
+    filters.add(new QualifierFilter(CompareOperator.EQUAL,
       new RegexStringComparator(".+-2")));
-    filters.add(new ValueFilter(CompareOp.EQUAL,
+    filters.add(new ValueFilter(CompareOperator.EQUAL,
       new SubstringComparator("One")));
     f = new FilterList(Operator.MUST_PASS_ONE, filters);
     s = new Scan();
@@ -1003,6 +1004,4 @@ public class TestScannersWithFilters {
     };
     verifyScanFull(s, kvs);
   }
-
 }
-


Mime
View raw message