You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by an...@apache.org on 2018/07/30 20:52:33 UTC

phoenix git commit: PHOENIX-4826 Changes to support HBase 2.0.1

Repository: phoenix
Updated Branches:
  refs/heads/master e26e0f29b -> a4f93eb45


PHOENIX-4826 Changes to support HBase 2.0.1


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

Branch: refs/heads/master
Commit: a4f93eb458c516206cc3ed25978fb025d752a2a7
Parents: e26e0f2
Author: Ankit Singhal <an...@gmail.com>
Authored: Mon Jul 30 13:52:21 2018 -0700
Committer: Ankit Singhal <an...@gmail.com>
Committed: Mon Jul 30 13:52:21 2018 -0700

----------------------------------------------------------------------
 .../index/covered/data/DelegateComparator.java  | 83 ++++++++++++++++++++
 .../hbase/index/covered/data/IndexMemStore.java |  6 +-
 .../index/covered/data/TestIndexMemStore.java   |  6 +-
 pom.xml                                         |  2 +-
 4 files changed, 90 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4f93eb4/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/DelegateComparator.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/DelegateComparator.java b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/DelegateComparator.java
new file mode 100644
index 0000000..478d98b
--- /dev/null
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/DelegateComparator.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.hbase.index.covered.data;
+
+import java.util.Comparator;
+
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellComparator;
+
+public class DelegateComparator implements CellComparator {
+    
+    private CellComparator delegate;
+
+    public DelegateComparator(CellComparator delegate) {
+        this.delegate=delegate;
+    }
+
+    @Override
+    public int compare(Cell leftCell, Cell rightCell) {
+        return delegate.compare(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareRows(Cell leftCell, Cell rightCell) {
+        return delegate.compareRows(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareRows(Cell cell, byte[] bytes, int offset, int length) {
+        return delegate.compareRows(cell, bytes, offset, length);
+    }
+
+    @Override
+    public int compareWithoutRow(Cell leftCell, Cell rightCell) {
+        return delegate.compareWithoutRow(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareFamilies(Cell leftCell, Cell rightCell) {
+        return delegate.compareFamilies(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareQualifiers(Cell leftCell, Cell rightCell) {
+        return delegate.compareQualifiers(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareTimestamps(Cell leftCell, Cell rightCell) {
+        return delegate.compareTimestamps(leftCell, rightCell);
+    }
+
+    @Override
+    public int compareTimestamps(long leftCellts, long rightCellts) {
+        return delegate.compareTimestamps(leftCellts, rightCellts);
+    }
+
+    @Override
+    public int compare(Cell leftCell, Cell rightCell, boolean ignoreSequenceid) {
+        return delegate.compare(leftCell, rightCell, ignoreSequenceid);
+    }
+
+    @Override
+    public Comparator getSimpleComparator() {
+        return delegate.getSimpleComparator();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4f93eb4/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
index 8247496..301d825 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/IndexMemStore.java
@@ -79,10 +79,10 @@ public class IndexMemStore implements KeyValueStore {
   private CellComparator comparator;
 
   public IndexMemStore() {
-    this(new CellComparatorImpl(){
+    this(new DelegateComparator(new CellComparatorImpl()){
         @Override
-        public int compare(Cell a, Cell b) {
-            return super.compare(a, b, true);
+        public int compare(Cell leftCell, Cell rightCell) {
+            return super.compare(leftCell, rightCell, true);
         }
     });
   }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4f93eb4/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/covered/data/TestIndexMemStore.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/covered/data/TestIndexMemStore.java b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/covered/data/TestIndexMemStore.java
index 0f5f995..e40cdd7 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/covered/data/TestIndexMemStore.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/covered/data/TestIndexMemStore.java
@@ -39,10 +39,10 @@ public class TestIndexMemStore {
 
   @Test
   public void testCorrectOverwritting() throws Exception {
-    IndexMemStore store = new IndexMemStore(new CellComparatorImpl(){
+    IndexMemStore store = new IndexMemStore(new DelegateComparator(new CellComparatorImpl()){
         @Override
-        public int compare(Cell a, Cell b) {
-            return super.compare(a, b, true);
+        public int compare(Cell leftCell, Cell rightCell) {
+            return super.compare(leftCell, rightCell, true);
         }
     });
     long ts = 10;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4f93eb4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8515d71..7fe1b39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
     <top.dir>${project.basedir}</top.dir>
 
     <!-- Hadoop Versions -->
-    <hbase.version>2.0.0</hbase.version>
+    <hbase.version>2.0.1</hbase.version>
     <hadoop.version>3.0.0</hadoop.version>
 
     <!-- Dependency versions -->