You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2022/12/03 19:33:19 UTC

[phoenix] branch 5.1 updated: PHOENIX-6692 Add HBase 2.5 support

This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new 43770cfc79 PHOENIX-6692 Add HBase 2.5 support
43770cfc79 is described below

commit 43770cfc792d11c5eaade8f223ee84404ff8e743
Author: Istvan Toth <st...@apache.org>
AuthorDate: Mon Nov 28 11:29:49 2022 +0100

    PHOENIX-6692 Add HBase 2.5 support
---
 Jenkinsfile                                        |   2 +-
 phoenix-core/pom.xml                               |  33 ++++
 .../end2end/index/MutableIndexExtendedIT.java      |  18 +-
 .../it/resources/compatible_client_versions.json   |   3 +-
 .../hadoop/hbase/ipc/PhoenixRpcScheduler.java      |   2 +-
 .../schema/tool/SchemaExtractionProcessor.java     |   9 +-
 .../phoenix/transaction/TransactionFactory.java    |  15 +-
 .../java/org/apache/phoenix/util/TestUtil.java     |  19 +-
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |   9 +
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |   9 +
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |  11 ++
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |   9 +
 .../compat/hbase/HbaseCompatCapabilities.java      |   2 +-
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |  10 ++
 .../apache/phoenix/compat/hbase/CompatUtil.java    |   5 +-
 .../compat/hbase/HbaseCompatCapabilities.java      |   2 +-
 phoenix-hbase-compat-2.5.0/pom.xml                 | 114 ++++++++++++
 .../phoenix/compat/hbase/CompatDelegateHTable.java |  28 ++-
 .../compat/hbase/CompatOmidTransactionTable.java   |  22 ++-
 .../phoenix/compat/hbase/CompatPermissionUtil.java |  59 ++++++
 .../compat/hbase/CompatPhoenixRpcScheduler.java    |  15 ++
 .../compat/hbase/CompatSteppingSplitPolicy.java    |  15 +-
 .../compat/hbase/CompatStoreFileReader.java        |  48 +++++
 .../apache/phoenix/compat/hbase/CompatUtil.java    |   5 +-
 .../compat/hbase/HbaseCompatCapabilities.java      |   2 +-
 .../apache/phoenix/compat/hbase/OffsetCell.java    | 136 ++++++++++++++
 .../CompatBaseScannerRegionObserver.java           | 197 +++++++++++++++++++++
 .../coprocessor/CompatIndexRegionObserver.java     |  28 +--
 .../phoenix/compat/hbase/test/DelegateCell.java    | 139 +++++++++++++++
 phoenix-pherf/pom.xml                              |  34 ++++
 phoenix-server/pom.xml                             |  20 +++
 pom.xml                                            |  75 +++++++-
 32 files changed, 1031 insertions(+), 64 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 7521e48c8a..898b0d4fb1 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -39,7 +39,7 @@ pipeline {
                 axes {
                     axis {
                         name 'HBASE_PROFILE'
-                        values '2.1', '2.2', '2.3', '2.4'
+                        values '2.1', '2.2', '2.3', '2.4', '2.5'
                     }
                 }
 
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index bb23d93f0c..ca93224d62 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -72,6 +72,9 @@
                     || ("${hbase.compat.version}".equals("2.4.1")
                       &amp;&amp; hbaseMinor == 4
                       &amp;&amp; hbasePatch &gt;=1)
+                    || ("${hbase.compat.version}".equals("2.5.0")
+                      &amp;&amp; hbaseMinor == 5
+                      &amp;&amp; hbasePatch &gt;=0)
                   )
                 </condition>
               </evaluateBeanshell>
@@ -683,6 +686,36 @@
       </dependency>
     </dependencies>
   </profile>
+  <profile>
+    <id>phoenix-hbase-compat-2.5.0</id>
+    <!-- keep dependency plugin happy -->
+    <activation>
+      <property>
+        <name>hbase.profile</name>
+        <value>2.5</value>
+      </property>
+    </activation>
+    <properties>
+      <hbase.profile>2.5</hbase.profile>
+    </properties>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.zookeeper</groupId>
+        <artifactId>zookeeper-jute</artifactId>
+      </dependency>
+      <!-- log4j2 for Hbase 2.5 minicluster -->
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-core</artifactId>
+        <scope>test</scope>
+      </dependency>
+    </dependencies>
+  </profile>
   <profile>
     <id>phoenix-hbase-compat-2.4.1-default</id>
     <!-- keep dependency plugin happy -->
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexExtendedIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexExtendedIT.java
index a5a690d911..a385cbec3b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexExtendedIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexExtendedIT.java
@@ -21,6 +21,9 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.*;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HStore;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionContext;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
+import org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController;
 import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
@@ -49,6 +52,7 @@ import java.sql.Connection;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
+import java.util.Optional;
 import java.util.Properties;
 
 import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
@@ -124,8 +128,13 @@ public class MutableIndexExtendedIT extends ParallelStatsDisabledIT {
             HRegion hRegion = regions.get(0);
             hRegion.flush(true);
             HStore store = hRegion.getStore(famBytes);
+            // Trigger major compaction
             store.triggerMajorCompaction();
-            store.compactRecentForTestingAssumingDefaultPolicy(1);
+            Optional<CompactionContext> requestCompaction =
+                store.requestCompaction(org.apache.hadoop.hbase.regionserver.Store.PRIORITY_USER,
+                    CompactionLifeCycleTracker.DUMMY, null);
+            store.compact(requestCompaction.get(), NoLimitThroughputController.INSTANCE, null);
+            assertEquals(1, store.getStorefiles().size());
 
             // we should be able to compact syscat itself as well
             regions =
@@ -134,8 +143,13 @@ public class MutableIndexExtendedIT extends ParallelStatsDisabledIT {
             hRegion = regions.get(0);
             hRegion.flush(true);
             store = hRegion.getStore(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
+            // Trigger major compaction
             store.triggerMajorCompaction();
-            store.compactRecentForTestingAssumingDefaultPolicy(1);
+            requestCompaction =
+                store.requestCompaction(org.apache.hadoop.hbase.regionserver.Store.PRIORITY_USER,
+                    CompactionLifeCycleTracker.DUMMY, null);
+            store.compact(requestCompaction.get(), NoLimitThroughputController.INSTANCE, null);
+            assertEquals(1, store.getStorefiles().size());
         }
     }
 
diff --git a/phoenix-core/src/it/resources/compatible_client_versions.json b/phoenix-core/src/it/resources/compatible_client_versions.json
index aa946421e9..bbadaef9d6 100644
--- a/phoenix-core/src/it/resources/compatible_client_versions.json
+++ b/phoenix-core/src/it/resources/compatible_client_versions.json
@@ -23,5 +23,6 @@
     "2.1": ["5.1.0"],
     "2.2": ["5.1.0"],
     "2.3": ["5.1.0"],
-    "2.4": ["5.1.0"]
+    "2.4": ["5.1.0"],
+    "2.5": []
 }
diff --git a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
index 7630eb2e0d..c7de5ec1de 100644
--- a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
+++ b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
@@ -80,7 +80,7 @@ public class PhoenixRpcScheduler extends CompatPhoenixRpcScheduler {
     }
 
     @Override
-    public boolean dispatch(CallRunner callTask) throws InterruptedException, IOException {
+    public boolean compatDispatch(CallRunner callTask) throws IOException, InterruptedException {
         RpcCall call = callTask.getRpcCall();
         int priority = call.getHeader().getPriority();
         if (indexPriority == priority) {
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java
index 722b7a1799..9ca517cd50 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java
@@ -46,7 +46,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.List;
 import java.util.ArrayList;
-
+import java.util.Arrays;
 
 import static org.apache.phoenix.util.MetaDataUtil.SYNCED_DATA_TABLE_AND_INDEX_COL_FAM_PROPERTIES;
 
@@ -57,6 +57,9 @@ public class SchemaExtractionProcessor implements SchemaProcessor {
     private static final String CREATE_TABLE = "CREATE TABLE %s";
     private static final String CREATE_INDEX = "CREATE %sINDEX %s ON %s";
     private static final String CREATE_VIEW = "CREATE VIEW %s%s AS SELECT * FROM %s%s";
+    private static final List<String> QUOTE_PROPERTIES =
+            //Copying here, because this only exists in Hbase 2.5+
+            Arrays.asList(new String[] {"hbase.store.file-tracker.impl"});
 
     private PTable table;
     private Configuration conf;
@@ -396,7 +399,9 @@ public class SchemaExtractionProcessor implements SchemaProcessor {
             String columnFamilyName = QueryConstants.DEFAULT_COLUMN_FAMILY;
 
             String[] colPropKey = key.split("\\.");
-            if (colPropKey.length > 1) {
+            if (QUOTE_PROPERTIES.contains(key)) {
+                key = "\"" + key + "\"";
+            } else if (colPropKey.length > 1) {
                 columnFamilyName = colPropKey[0];
                 key = colPropKey[1];
             }
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
index 7f6afcb252..e16d5f8b46 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
@@ -18,6 +18,8 @@
 package org.apache.phoenix.transaction;
 
 import java.io.IOException;
+
+import org.apache.hadoop.hbase.util.VersionInfo;
 import org.apache.phoenix.coprocessor.MetaDataProtocol;
 
 public class TransactionFactory {
@@ -26,10 +28,17 @@ public class TransactionFactory {
 
     static{
         boolean tephraEnabled = true;
-        try {
-            Class.forName("org.apache.tephra.TransactionFailureException");
-        } catch (Throwable e) {
+        //FIXME this may break with vendor version numbers
+        if(VersionInfo.compareVersion(VersionInfo.getVersion(), "2.4") > 0) {
+            //Tephra does not support Hbase 2.5 or later
             tephraEnabled = false;
+        } else {
+            try {
+                //Tephra not linked in
+                Class.forName("org.apache.tephra.TransactionFailureException");
+            } catch (Throwable e) {
+                tephraEnabled = false;
+            }
         }
         if (tephraEnabled) {
             tephraTransactionProvider = TephraTransactionProvider.getInstance();
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
index da443a186e..ea0568b587 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
@@ -811,14 +811,23 @@ public class TestUtil {
     public static void majorCompact(HBaseTestingUtility utility, TableName table)
         throws IOException, InterruptedException {
         long compactionRequestedSCN = EnvironmentEdgeManager.currentTimeMillis();
-        Admin admin = utility.getHBaseAdmin();
+        Admin admin = utility.getAdmin();
         admin.majorCompact(table);
         long lastCompactionTimestamp;
         CompactionState state = null;
-        while ((lastCompactionTimestamp = admin.getLastMajorCompactionTimestamp(table))
-            < compactionRequestedSCN
-            || (state = admin.getCompactionState(table)).equals(CompactionState.MAJOR)
-            || admin.getCompactionState(table).equals(CompactionState.MAJOR_AND_MINOR)){
+        CompactionState previousState = null;
+        while ((state = admin.getCompactionState(table)).equals(CompactionState.MAJOR)
+                || state.equals(CompactionState.MAJOR_AND_MINOR)
+                || (lastCompactionTimestamp =
+                        admin.getLastMajorCompactionTimestamp(table)) < compactionRequestedSCN) {
+            // In HBase 2.5 getLastMajorCompactionTimestamp doesn't seem to get updated when the
+            // clock is stopped, so check for the state going to NONE instead
+            if (state.equals(CompactionState.NONE) && (previousState != null
+                    && previousState.equals(CompactionState.MAJOR_AND_MINOR)
+                    || previousState.equals(CompactionState.MAJOR))) {
+                break;
+            }
+            previousState = state;
             Thread.sleep(100);
         }
     }
diff --git a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index 194c4c376c..96366271d1 100644
--- a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -31,4 +34,10 @@ public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
         return this.delegate.getMetaPriorityQueueLength();
     }
 
+    public boolean dispatch(CallRunner task) throws IOException, InterruptedException {
+        return compatDispatch(task);
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
 }
diff --git a/phoenix-hbase-compat-2.2.5/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.2.5/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index b749a253ef..efabb8aed8 100644
--- a/phoenix-hbase-compat-2.2.5/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.2.5/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -51,4 +54,10 @@ public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
         return this.delegate.getActiveReplicationRpcHandlerCount();
     }
 
+    public boolean dispatch(CallRunner task) throws IOException, InterruptedException {
+        return compatDispatch(task);
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
 }
diff --git a/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index b749a253ef..d2b8a7b44a 100644
--- a/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -26,6 +29,14 @@ import org.apache.hadoop.hbase.ipc.RpcScheduler;
 public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
     protected RpcScheduler delegate;
 
+    @Override
+    public boolean dispatch(CallRunner task) throws IOException, InterruptedException {
+        return compatDispatch(task);
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
+
     @Override
     public int getMetaPriorityQueueLength() {
         return this.delegate.getMetaPriorityQueueLength();
diff --git a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index b749a253ef..efabb8aed8 100644
--- a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -51,4 +54,10 @@ public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
         return this.delegate.getActiveReplicationRpcHandlerCount();
     }
 
+    public boolean dispatch(CallRunner task) throws IOException, InterruptedException {
+        return compatDispatch(task);
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
 }
diff --git a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java b/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
index 80aafe6d8c..2cb9cdfd61 100644
--- a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
+++ b/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
@@ -36,4 +36,4 @@ public class HbaseCompatCapabilities {
     //HBase 2.3+ has preWALAppend() on RegionObserver (HBASE-22623)
     public static boolean hasPreWALAppend() { return true; }
 
-}
\ No newline at end of file
+}
diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index b749a253ef..9c94a5c9e1 100644
--- a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -51,4 +54,11 @@ public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
         return this.delegate.getActiveReplicationRpcHandlerCount();
     }
 
+    public boolean dispatch(CallRunner task) throws IOException, InterruptedException {
+        return compatDispatch(task);
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
 }
+
diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
index 9310af5288..a86aa4020d 100644
--- a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
+++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
@@ -17,6 +17,8 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
@@ -33,7 +35,6 @@ import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
-import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.regionserver.StoreUtils;
 import org.apache.hadoop.hbase.security.access.Permission;
@@ -43,8 +44,6 @@ import org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-
 
 public class CompatUtil {
 
diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
index 80aafe6d8c..2cb9cdfd61 100644
--- a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
+++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
@@ -36,4 +36,4 @@ public class HbaseCompatCapabilities {
     //HBase 2.3+ has preWALAppend() on RegionObserver (HBASE-22623)
     public static boolean hasPreWALAppend() { return true; }
 
-}
\ No newline at end of file
+}
diff --git a/phoenix-hbase-compat-2.5.0/pom.xml b/phoenix-hbase-compat-2.5.0/pom.xml
new file mode 100644
index 0000000000..e074139c0b
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project
+  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation=
+    "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.phoenix</groupId>
+    <artifactId>phoenix</artifactId>
+    <version>5.1.3</version>
+  </parent>
+
+  <artifactId>phoenix-hbase-compat-2.5.0</artifactId>
+  <name>Phoenix Hbase 2.5.0 compatibility</name>
+  <description>Compatibility module for HBase 2.5.0+</description>
+
+  <properties>
+    <hbase25.compat.version>2.5.0</hbase25.compat.version>
+  </properties>
+
+  <dependencies>
+     <!-- HBase dependencies -->
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-client</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-common</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-server</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- Override parent dependencyManagement for transitive HBase dependencies -->
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-hadoop-compat</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-hadoop2-compat</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+        <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-protocol</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-protocol-shaded</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-zookeeper</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-metrics</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-metrics-api</artifactId>
+      <version>${hbase25.compat.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- Build with -Dwithout.tephra fails without this -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateHTable.java
similarity index 57%
copy from phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateHTable.java
index 194c4c376c..a255732eff 100644
--- a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateHTable.java
@@ -17,18 +17,28 @@
  */
 package org.apache.phoenix.compat.hbase;
 
-import org.apache.hadoop.hbase.ipc.RpcScheduler;
+import java.io.IOException;
 
-/**
- * {@link RpcScheduler} that first checks to see if this is an index or metadata update before
- * passing off the call to the delegate {@link RpcScheduler}.
- */
-public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
-    protected RpcScheduler delegate;
+import org.apache.hadoop.hbase.client.RegionLocator;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.RowMutations;
+import org.apache.hadoop.hbase.client.Table;
+
+public abstract class CompatDelegateHTable implements Table {
+
+    protected final Table delegate;
+
+    public CompatDelegateHTable(Table delegate) {
+        this.delegate = delegate;
+    }
 
     @Override
-    public int getMetaPriorityQueueLength() {
-        return this.delegate.getMetaPriorityQueueLength();
+    public RegionLocator getRegionLocator() throws IOException {
+        return delegate.getRegionLocator();
     }
 
+    @Override
+    public Result mutateRow(RowMutations rm) throws IOException {
+        return delegate.mutateRow(rm);
+    }
 }
diff --git a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatOmidTransactionTable.java
similarity index 61%
copy from phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatOmidTransactionTable.java
index 194c4c376c..ae7992fb34 100644
--- a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatOmidTransactionTable.java
@@ -17,18 +17,22 @@
  */
 package org.apache.phoenix.compat.hbase;
 
-import org.apache.hadoop.hbase.ipc.RpcScheduler;
+import java.io.IOException;
 
-/**
- * {@link RpcScheduler} that first checks to see if this is an index or metadata update before
- * passing off the call to the delegate {@link RpcScheduler}.
- */
-public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
-    protected RpcScheduler delegate;
+import org.apache.hadoop.hbase.client.RegionLocator;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.RowMutations;
+import org.apache.hadoop.hbase.client.Table;
+
+public abstract class CompatOmidTransactionTable implements Table {
 
     @Override
-    public int getMetaPriorityQueueLength() {
-        return this.delegate.getMetaPriorityQueueLength();
+    public RegionLocator getRegionLocator() throws IOException {
+        throw new UnsupportedOperationException();
     }
 
+    @Override
+    public Result mutateRow(RowMutations rm) throws IOException {
+        throw new UnsupportedOperationException();
+    }
 }
diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPermissionUtil.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPermissionUtil.java
new file mode 100644
index 0000000000..80a99b3a3d
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPermissionUtil.java
@@ -0,0 +1,59 @@
+/*
+ * 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.compat.hbase;
+
+import java.io.IOException;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.security.User;
+import org.apache.hadoop.hbase.security.access.AccessChecker;
+import org.apache.hadoop.hbase.security.access.Permission;
+import org.apache.hadoop.hbase.security.access.UserPermission;
+import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
+
+public class CompatPermissionUtil {
+
+    private CompatPermissionUtil() {
+        //Not to be instantiated
+    }
+
+    public static AccessChecker newAccessChecker(final Configuration conf, ZKWatcher zk) {
+        //Ignore ZK parameter
+        return new AccessChecker(conf);
+    }
+
+    public static void stopAccessChecker(AccessChecker accessChecker) throws IOException {
+        //NOOP
+    }
+
+    public static String getUserFromUP(UserPermission userPermission) {
+        return userPermission.getUser();
+    }
+
+    public static Permission getPermissionFromUP(UserPermission userPermission) {
+        return userPermission.getPermission();
+    }
+
+    public static boolean authorizeUserTable(AccessChecker accessChecker, User user,
+            TableName table, Permission.Action action) {
+        // This also checks for group access
+        return accessChecker.getAuthManager().authorizeUserTable(user, table, action);
+    }
+
+}
diff --git a/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
similarity index 80%
copy from phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
index b749a253ef..63265789c7 100644
--- a/phoenix-hbase-compat-2.3.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
@@ -17,6 +17,9 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.ipc.CallRunner;
 import org.apache.hadoop.hbase.ipc.RpcScheduler;
 
 /**
@@ -51,4 +54,16 @@ public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
         return this.delegate.getActiveReplicationRpcHandlerCount();
     }
 
+    @Override
+    public boolean dispatch(CallRunner task) {
+        try {
+            return compatDispatch(task);
+        } catch (Exception e) {
+            //This never happens with Hbase 2.5
+            throw new RuntimeException(e);
+        }
+    }
+
+    public abstract boolean compatDispatch(CallRunner task)
+            throws IOException, InterruptedException;
 }
diff --git a/phoenix-core/src/it/resources/compatible_client_versions.json b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy.java
similarity index 66%
copy from phoenix-core/src/it/resources/compatible_client_versions.json
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy.java
index aa946421e9..f185153996 100644
--- a/phoenix-core/src/it/resources/compatible_client_versions.json
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy.java
@@ -15,13 +15,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-{
-    "_comment": "Lists all phoenix compatible client versions against the current branch version for a given hbase profile If hbase profile is 1.3, phoenix client versions 4.14.3 and 4.15.0 are tested against current branch version",
-    "1.3": ["4.14.3", "4.15.0"],
-    "1.4": ["4.14.3", "4.15.0"],
-    "1.5": ["4.15.0"],
-    "2.1": ["5.1.0"],
-    "2.2": ["5.1.0"],
-    "2.3": ["5.1.0"],
-    "2.4": ["5.1.0"]
+package org.apache.phoenix.compat.hbase;
+
+import org.apache.hadoop.hbase.regionserver.SteppingSplitPolicy;
+
+public class CompatSteppingSplitPolicy extends SteppingSplitPolicy {
+
 }
diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatStoreFileReader.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatStoreFileReader.java
new file mode 100644
index 0000000000..03aa257233
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatStoreFileReader.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compat.hbase;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.fs.HFileSystem;
+import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
+import org.apache.hadoop.hbase.io.hfile.CacheConfig;
+import org.apache.hadoop.hbase.io.hfile.HFileInfo;
+import org.apache.hadoop.hbase.io.hfile.ReaderContext;
+import org.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderType;
+import org.apache.hadoop.hbase.regionserver.StoreFileReader;
+
+public class CompatStoreFileReader extends StoreFileReader {
+
+    public CompatStoreFileReader(final FileSystem fs, final Path p,
+            final FSDataInputStreamWrapper in, long size, final CacheConfig cacheConf,
+            boolean primaryReplicaStoreFile, AtomicInteger refCount, final Configuration conf)
+            throws IOException {
+        super(new ReaderContext(p, in, size, new HFileSystem(fs), primaryReplicaStoreFile,
+                ReaderType.STREAM),
+                new HFileInfo(new ReaderContext(p, in, size, new HFileSystem(fs),
+                        primaryReplicaStoreFile, ReaderType.STREAM), conf),
+                cacheConf, refCount, conf);
+        getHFileReader().getHFileInfo().initMetaAndIndex(getHFileReader());
+    }
+
+}
\ No newline at end of file
diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
similarity index 99%
copy from phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
index 9310af5288..a86aa4020d 100644
--- a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatUtil.java
@@ -17,6 +17,8 @@
  */
 package org.apache.phoenix.compat.hbase;
 
+import java.io.IOException;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
@@ -33,7 +35,6 @@ import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
-import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.regionserver.StoreUtils;
 import org.apache.hadoop.hbase.security.access.Permission;
@@ -43,8 +44,6 @@ import org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-
 
 public class CompatUtil {
 
diff --git a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
similarity index 99%
copy from phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
index 80aafe6d8c..2cb9cdfd61 100644
--- a/phoenix-hbase-compat-2.4.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/HbaseCompatCapabilities.java
@@ -36,4 +36,4 @@ public class HbaseCompatCapabilities {
     //HBase 2.3+ has preWALAppend() on RegionObserver (HBASE-22623)
     public static boolean hasPreWALAppend() { return true; }
 
-}
\ No newline at end of file
+}
diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/OffsetCell.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/OffsetCell.java
new file mode 100644
index 0000000000..c5485a5e9b
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/OffsetCell.java
@@ -0,0 +1,136 @@
+/*
+ * 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.compat.hbase;
+
+import org.apache.hadoop.hbase.Cell;
+
+public class OffsetCell implements Cell {
+
+    private Cell cell;
+    private int offset;
+
+    public OffsetCell(Cell cell, int offset) {
+        this.cell = cell;
+        this.offset = offset;
+    }
+
+    @Override
+    public byte[] getRowArray() {
+        return cell.getRowArray();
+    }
+
+    @Override
+    public int getRowOffset() {
+        return cell.getRowOffset() + offset;
+    }
+
+    @Override
+    public short getRowLength() {
+        return (short) (cell.getRowLength() - offset);
+    }
+
+    @Override
+    public byte[] getFamilyArray() {
+        return cell.getFamilyArray();
+    }
+
+    @Override
+    public int getFamilyOffset() {
+        return cell.getFamilyOffset();
+    }
+
+    @Override
+    public byte getFamilyLength() {
+        return cell.getFamilyLength();
+    }
+
+    @Override
+    public byte[] getQualifierArray() {
+        return cell.getQualifierArray();
+    }
+
+    @Override
+    public int getQualifierOffset() {
+        return cell.getQualifierOffset();
+    }
+
+    @Override
+    public int getQualifierLength() {
+        return cell.getQualifierLength();
+    }
+
+    @Override
+    public long getTimestamp() {
+        return cell.getTimestamp();
+    }
+
+    @Override
+    public byte getTypeByte() {
+        return cell.getTypeByte();
+    }
+
+    @Override public long getSequenceId() {
+        return cell.getSequenceId();
+    }
+
+    @Override
+    public byte[] getValueArray() {
+        return cell.getValueArray();
+    }
+
+    @Override
+    public int getValueOffset() {
+        return cell.getValueOffset();
+    }
+
+    @Override
+    public int getValueLength() {
+        return cell.getValueLength();
+    }
+
+    @Override
+    public byte[] getTagsArray() {
+        return cell.getTagsArray();
+    }
+
+    @Override
+    public int getTagsOffset() {
+        return cell.getTagsOffset();
+    }
+
+    @Override
+    public int getTagsLength() {
+        return cell.getTagsLength();
+    }
+
+    @Override
+    public Type getType() {
+        return cell.getType();
+    }
+
+    @Override
+    public long heapSize() {
+        return cell.heapSize();
+    }
+
+    @Override
+    public int getSerializedSize() {
+        return cell.getSerializedSize() - offset;
+    }
+
+}
diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatBaseScannerRegionObserver.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatBaseScannerRegionObserver.java
new file mode 100644
index 0000000000..cd1a7f5636
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatBaseScannerRegionObserver.java
@@ -0,0 +1,197 @@
+/*
+ * 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.compat.hbase.coprocessor;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.KeepDeletedCells;
+import org.apache.hadoop.hbase.MemoryCompactionPolicy;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
+import org.apache.hadoop.hbase.coprocessor.RegionObserver;
+import org.apache.hadoop.hbase.regionserver.FlushLifeCycleTracker;
+import org.apache.hadoop.hbase.regionserver.ScanOptions;
+import org.apache.hadoop.hbase.regionserver.ScanType;
+import org.apache.hadoop.hbase.regionserver.Store;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
+import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
+
+import java.io.IOException;
+
+public class CompatBaseScannerRegionObserver implements RegionObserver {
+
+    public static final String PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY =
+        "phoenix.max.lookback.age.seconds";
+    public static final int DEFAULT_PHOENIX_MAX_LOOKBACK_AGE = 0;
+
+    public void preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
+                                             ScanType scanType, ScanOptions options, CompactionLifeCycleTracker tracker,
+                                             CompactionRequest request) throws IOException {
+        Configuration conf = c.getEnvironment().getConfiguration();
+        if (isMaxLookbackTimeEnabled(conf)) {
+            setScanOptionsForFlushesAndCompactions(conf, options, store, scanType);
+        }
+    }
+
+    public void preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
+                                                ScanOptions options, FlushLifeCycleTracker tracker) throws IOException {
+        Configuration conf = c.getEnvironment().getConfiguration();
+        if (isMaxLookbackTimeEnabled(conf)) {
+            setScanOptionsForFlushesAndCompactions(conf, options, store, ScanType.COMPACT_RETAIN_DELETES);
+        }
+    }
+
+    public void preMemStoreCompactionCompactScannerOpen(
+        ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanOptions options)
+        throws IOException {
+        Configuration conf = c.getEnvironment().getConfiguration();
+        if (isMaxLookbackTimeEnabled(conf)) {
+            MemoryCompactionPolicy inMemPolicy =
+                store.getColumnFamilyDescriptor().getInMemoryCompaction();
+            ScanType scanType;
+            //the eager and adaptive in-memory compaction policies can purge versions; the others
+            // can't. (Eager always does; adaptive sometimes does)
+            if (inMemPolicy.equals(MemoryCompactionPolicy.EAGER) ||
+                inMemPolicy.equals(MemoryCompactionPolicy.ADAPTIVE)) {
+                scanType = ScanType.COMPACT_DROP_DELETES;
+            } else {
+                scanType = ScanType.COMPACT_RETAIN_DELETES;
+            }
+            setScanOptionsForFlushesAndCompactions(conf, options, store, scanType);
+        }
+    }
+
+    public void preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> ctx, Store store,
+                                           ScanOptions options) throws IOException {
+
+        if (!storeFileScanDoesntNeedAlteration(options)) {
+            //PHOENIX-4277 -- When doing a point-in-time (SCN) Scan, HBase by default will hide
+            // mutations that happen before a delete marker. This overrides that behavior.
+            options.setMinVersions(options.getMinVersions());
+            KeepDeletedCells keepDeletedCells = KeepDeletedCells.TRUE;
+            if (store.getColumnFamilyDescriptor().getTimeToLive() != HConstants.FOREVER) {
+                keepDeletedCells = KeepDeletedCells.TTL;
+            }
+            options.setKeepDeletedCells(keepDeletedCells);
+        }
+    }
+
+    private boolean storeFileScanDoesntNeedAlteration(ScanOptions options) {
+        Scan scan = options.getScan();
+        boolean isRaw = scan.isRaw();
+        //true if keep deleted cells is either TRUE or TTL
+        boolean keepDeletedCells = options.getKeepDeletedCells().equals(KeepDeletedCells.TRUE) ||
+            options.getKeepDeletedCells().equals(KeepDeletedCells.TTL);
+        boolean timeRangeIsLatest = scan.getTimeRange().getMax() == HConstants.LATEST_TIMESTAMP;
+        boolean timestampIsTransactional =
+            isTransactionalTimestamp(scan.getTimeRange().getMax());
+        return isRaw
+            || keepDeletedCells
+            || timeRangeIsLatest
+            || timestampIsTransactional;
+    }
+
+    private boolean isTransactionalTimestamp(long ts) {
+        //have to use the HBase edge manager because the Phoenix one is in phoenix-core
+        return ts > (long) (EnvironmentEdgeManager.currentTime() * 1.1);
+    }
+
+    /*
+     * If KeepDeletedCells.FALSE, KeepDeletedCells.TTL ,
+     * let delete markers age once lookback age is done.
+     */
+    public KeepDeletedCells getKeepDeletedCells(ScanOptions options, ScanType scanType) {
+        //if we're doing a minor compaction or flush, always set keep deleted cells
+        //to true. Otherwise, if keep deleted cells is false or TTL, use KeepDeletedCells TTL,
+        //where the value of the ttl might be overriden to the max lookback age elsewhere
+        return (options.getKeepDeletedCells() == KeepDeletedCells.TRUE
+                || scanType.equals(ScanType.COMPACT_RETAIN_DELETES)) ?
+                KeepDeletedCells.TRUE : KeepDeletedCells.TTL;
+    }
+
+    /*
+     * if the user set a TTL we should leave MIN_VERSIONS at the default (0 in most of the cases).
+     * Otherwise the data (1st version) will not be removed after the TTL. If no TTL, we want
+     * Math.max(maxVersions, minVersions, 1)
+     */
+    public int getMinVersions(ScanOptions options, ColumnFamilyDescriptor cfDescriptor) {
+        return cfDescriptor.getTimeToLive() != HConstants.FOREVER ? options.getMinVersions()
+            : Math.max(Math.max(options.getMinVersions(),
+            cfDescriptor.getMaxVersions()),1);
+    }
+
+    /**
+     *
+     * @param conf HBase Configuration
+     * @param columnDescriptor ColumnFamilyDescriptor for the store being compacted
+     * @param options ScanOptions of overrides to the compaction scan
+     * @return Time to live in milliseconds, based on both HBase TTL and Phoenix max lookback age
+     */
+    public long getTimeToLiveForCompactions(Configuration conf,
+                                                   ColumnFamilyDescriptor columnDescriptor,
+                                                   ScanOptions options) {
+        long ttlConfigured = columnDescriptor.getTimeToLive();
+        long ttlInMillis = ttlConfigured * 1000;
+        long maxLookbackTtl = getMaxLookbackInMillis(conf);
+        if (isMaxLookbackTimeEnabled(maxLookbackTtl)) {
+            if (ttlConfigured == HConstants.FOREVER
+                && columnDescriptor.getKeepDeletedCells() != KeepDeletedCells.TRUE) {
+                // If user configured default TTL(FOREVER) and keep deleted cells to false or
+                // TTL then to remove unwanted delete markers we should change ttl to max lookback age
+                ttlInMillis = maxLookbackTtl;
+            } else {
+                //if there is a TTL, use TTL instead of max lookback age.
+                // Max lookback age should be more recent or equal to TTL
+                ttlInMillis = Math.max(ttlInMillis, maxLookbackTtl);
+            }
+        }
+
+        return ttlInMillis;
+    }
+
+    public void setScanOptionsForFlushesAndCompactions(Configuration conf,
+                                                               ScanOptions options,
+                                                               final Store store,
+                                                               ScanType type) {
+        ColumnFamilyDescriptor cfDescriptor = store.getColumnFamilyDescriptor();
+        options.setTTL(getTimeToLiveForCompactions(conf, cfDescriptor,
+            options));
+        options.setKeepDeletedCells(getKeepDeletedCells(options, type));
+        options.setMaxVersions(Integer.MAX_VALUE);
+        options.setMinVersions(getMinVersions(options, cfDescriptor));
+    }
+
+    public static long getMaxLookbackInMillis(Configuration conf){
+        //config param is in seconds, switch to millis
+        return conf.getLong(PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+            DEFAULT_PHOENIX_MAX_LOOKBACK_AGE) * 1000;
+    }
+
+    public static boolean isMaxLookbackTimeEnabled(Configuration conf){
+        return isMaxLookbackTimeEnabled(conf.getLong(PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+            DEFAULT_PHOENIX_MAX_LOOKBACK_AGE));
+    }
+
+    public static boolean isMaxLookbackTimeEnabled(long maxLookbackTime){
+        return maxLookbackTime > 0L;
+    }
+
+}
diff --git a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatIndexRegionObserver.java
similarity index 53%
copy from phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
copy to phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatIndexRegionObserver.java
index 194c4c376c..f887ed3492 100644
--- a/phoenix-hbase-compat-2.1.6/src/main/java/org/apache/phoenix/compat/hbase/CompatPhoenixRpcScheduler.java
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/coprocessor/CompatIndexRegionObserver.java
@@ -15,20 +15,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.phoenix.compat.hbase;
+package org.apache.phoenix.compat.hbase.coprocessor;
 
-import org.apache.hadoop.hbase.ipc.RpcScheduler;
+import org.apache.hadoop.hbase.coprocessor.RegionObserver;
+import org.apache.hadoop.hbase.wal.WALKey;
 
-/**
- * {@link RpcScheduler} that first checks to see if this is an index or metadata update before
- * passing off the call to the delegate {@link RpcScheduler}.
- */
-public abstract class CompatPhoenixRpcScheduler extends RpcScheduler {
-    protected RpcScheduler delegate;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CompatIndexRegionObserver implements RegionObserver {
+
+    public static void appendToWALKey(WALKey key, String attrKey, byte[] attrValue) {
+        key.addExtendedAttribute(attrKey, attrValue);
+    }
+
+    public static byte[] getAttributeValueFromWALKey(WALKey key, String attrKey) {
+        return key.getExtendedAttribute(attrKey);
+    }
 
-    @Override
-    public int getMetaPriorityQueueLength() {
-        return this.delegate.getMetaPriorityQueueLength();
+    public static Map<String, byte[]> getAttributeValuesFromWALKey(WALKey key) {
+        return new HashMap<String, byte[]>(key.getExtendedAttributes());
     }
 
 }
diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/test/DelegateCell.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/test/DelegateCell.java
new file mode 100644
index 0000000000..0c7dfd8f5c
--- /dev/null
+++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/test/DelegateCell.java
@@ -0,0 +1,139 @@
+/*
+ * 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.compat.hbase.test;
+
+import org.apache.hadoop.hbase.Cell;
+
+public class DelegateCell implements Cell {
+    private final Cell delegate;
+    private final String name;
+    public DelegateCell(Cell delegate, String name) {
+        this.delegate = delegate;
+        this.name = name;
+    }
+
+    @Override
+    public int getValueOffset() {
+        return delegate.getValueOffset();
+    }
+
+    @Override
+    public int getValueLength() {
+        return delegate.getValueLength();
+    }
+
+    @Override
+    public byte[] getValueArray() {
+        return delegate.getValueArray();
+    }
+
+    @Override
+    public byte getTypeByte() {
+        return delegate.getTypeByte();
+    }
+
+    @Override
+    public long getTimestamp() {
+        return delegate.getTimestamp();
+    }
+
+    @Override
+    public int getTagsOffset() {
+        return delegate.getTagsOffset();
+    }
+
+    @Override
+    public byte[] getTagsArray() {
+        return delegate.getTagsArray();
+    }
+
+    @Override
+    public int getRowOffset() {
+        return delegate.getRowOffset();
+    }
+
+    @Override
+    public short getRowLength() {
+        return delegate.getRowLength();
+    }
+
+    @Override
+    public byte[] getRowArray() {
+        return delegate.getRowArray();
+    }
+
+    @Override
+    public int getQualifierOffset() {
+        return delegate.getQualifierOffset();
+    }
+
+    @Override
+    public int getQualifierLength() {
+        return delegate.getQualifierLength();
+    }
+
+    @Override
+    public byte[] getQualifierArray() {
+        return delegate.getQualifierArray();
+    }
+
+    @Override
+    public int getFamilyOffset() {
+        return delegate.getFamilyOffset();
+    }
+
+    @Override
+    public byte getFamilyLength() {
+        return delegate.getFamilyLength();
+    }
+
+    @Override
+    public byte[] getFamilyArray() {
+        return delegate.getFamilyArray();
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    @Override
+    public long getSequenceId() {
+        return delegate.getSequenceId();
+    }
+
+    @Override
+    public int getTagsLength() {
+        return delegate.getTagsLength();
+    }
+
+    @Override
+    public Type getType() {
+        return delegate.getType();
+    }
+
+    @Override
+    public long heapSize() {
+        return delegate.heapSize();
+    }
+
+    @Override
+    public int getSerializedSize() {
+        return delegate.getSerializedSize();
+    }
+}
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 99150d60cb..292ad7f9ed 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -290,6 +290,12 @@
             <ignoredUnusedDeclaredDependency>
               org.apache.hbase:hbase-testing-util
             </ignoredUnusedDeclaredDependency>
+            <ignoredUnusedDeclaredDependency>
+              org.apache.logging.log4j:log4j-api
+            </ignoredUnusedDeclaredDependency>
+            <ignoredUnusedDeclaredDependency>
+               org.apache.logging.log4j:log4j-core
+            </ignoredUnusedDeclaredDependency>
           </ignoredUnusedDeclaredDependencies>
           <ignoredUsedUndeclaredDependencies>
             <ignoredUsedUndeclaredDependency>
@@ -382,4 +388,32 @@
       </plugin>
     </plugins>
   </build>
+  <profiles>
+    <profile>
+        <id>phoenix-hbase-compat-2.5.0</id>
+        <!-- keep dependency plugin happy -->
+        <activation>
+            <property>
+                <name>hbase.profile</name>
+                <value>2.5</value>
+            </property>
+        </activation>
+        <properties>
+            <hbase.profile>2.5</hbase.profile>
+        </properties>
+        <dependencies>
+            <!-- log4j2 for Hbase 2.5 minicluster -->
+            <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
+                <scope>test</scope>
+            </dependency>
+        </dependencies>
+    </profile>
+  </profiles>
 </project>
diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml
index 5fc90bf346..a0b9f131d6 100644
--- a/phoenix-server/pom.xml
+++ b/phoenix-server/pom.xml
@@ -474,6 +474,26 @@
           </dependency>
         </dependencies>
       </profile>
+      <profile>
+        <id>phoenix-hbase-compat-2.5.0</id>
+        <!-- keep dependency plugin happy -->
+        <activation>
+          <property>
+            <name>hbase.profile</name>
+            <value>2.5</value>
+          </property>
+        </activation>
+        <properties>
+          <hbase.profile>2.5.0</hbase.profile>
+        </properties>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper-jute</artifactId>
+            <scope>provided</scope>
+          </dependency>
+        </dependencies>
+      </profile>
     <profile>
       <id>phoenix-hbase-compat-2.4.1-default</id>
       <!-- keep dependency plugin happy -->
diff --git a/pom.xml b/pom.xml
index 80077ec6f9..115e6b782c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,7 @@
   </organization>
 
   <modules>
+    <module>phoenix-hbase-compat-2.5.0</module>
     <module>phoenix-hbase-compat-2.4.1</module>
     <module>phoenix-hbase-compat-2.4.0</module>
     <module>phoenix-hbase-compat-2.3.0</module>
@@ -82,13 +83,14 @@
     <hbase.suffix>hbase-${hbase.profile}</hbase.suffix>
 
     <!-- This is used by the release script only -->
-    <hbase.profile.list>2.1 2.2 2.3 2.4.0 2.4</hbase.profile.list>
+    <hbase.profile.list>2.1 2.2 2.3 2.4.0 2.4 2.5</hbase.profile.list>
     <!-- The default hbase versions to build with (override with hbase.version) -->
     <hbase-2.1.runtime.version>2.1.10</hbase-2.1.runtime.version>
     <hbase-2.2.runtime.version>2.2.7</hbase-2.2.runtime.version>
     <hbase-2.3.runtime.version>2.3.7</hbase-2.3.runtime.version>
     <hbase-2.4.0.runtime.version>2.4.0</hbase-2.4.0.runtime.version>
     <hbase-2.4.runtime.version>2.4.15</hbase-2.4.runtime.version>
+    <hbase-2.5.runtime.version>2.5.0</hbase-2.5.runtime.version>
 
     <!-- General Properties -->
     <antlr-input.dir>src/main/antlr3</antlr-input.dir>
@@ -99,7 +101,9 @@
     <!-- Dependency versions -->
     <jackson-bom.version>2.12.6.20220326</jackson-bom.version>
     <antlr.version>3.5.2</antlr.version>
-    <reload4j.version>1.2.22</reload4j.version>
+    <reload4j.version>1.2.24</reload4j.version>
+    <!-- Only for Hbase 2.5 minicluster -->
+    <log4j2.version>2.17.2</log4j2.version>
     <disruptor.version>3.3.6</disruptor.version>
     <slf4j.version>1.7.36</slf4j.version>
     <!-- com.google repo will be used except on Aarch64 platform. -->
@@ -373,6 +377,24 @@
                 <ignoredUnusedDeclaredDependency>
                   org.apache.hbase:hbase-testing-util
                 </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-api
+                </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-core
+                </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-slf4j-impl
+                </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-1.2-api
+                </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-api
+                </ignoredUnusedDeclaredDependency>
+                <ignoredUnusedDeclaredDependency>
+                  org.apache.logging.log4j:log4j-core
+                </ignoredUnusedDeclaredDependency>
               </ignoredUnusedDeclaredDependencies>
               <ignoredUsedUndeclaredDependencies>
                 <ignoredUsedUndeclaredDependency>
@@ -644,6 +666,11 @@
         <artifactId>phoenix-client-hbase-2.4</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-client-hbase-2.5</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.phoenix</groupId>
         <artifactId>phoenix-client-embedded-hbase-2.1</artifactId>
@@ -669,6 +696,11 @@
         <artifactId>phoenix-client-embedded-hbase-2.4</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-client-embedded-hbase-2.5</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.phoenix</groupId>
         <artifactId>phoenix-server-hbase-2.1</artifactId>
@@ -694,6 +726,11 @@
         <artifactId>phoenix-server-hbase-2.4</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-server-hbase-2.5</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.phoenix</groupId>
         <artifactId>phoenix-pherf</artifactId>
@@ -734,6 +771,11 @@
         <artifactId>phoenix-hbase-compat-2.4.1</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-hbase-compat-2.5.0</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <!-- Intra-project test dependencies -->
       <dependency>
         <groupId>org.apache.phoenix</groupId>
@@ -1494,6 +1536,16 @@
         <version>${hamcrest.version}</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>${log4j2.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-core</artifactId>
+        <version>${log4j2.version}</version>
+      </dependency>
 
        <!-- Runtime dependencies -->
       <dependency>
@@ -1703,6 +1755,25 @@
         <tephra.hbase.compat.version>2.4</tephra.hbase.compat.version>
       </properties>
     </profile>
+    <profile>
+      <!-- PHOENIX-5993 This won't work with the public HBase artifacts -->
+      <id>phoenix-hbase-compat-2.5.0</id>
+      <activation>
+        <property>
+          <name>hbase.profile</name>
+          <value>2.5</value>
+        </property>
+      </activation>
+      <properties>
+        <hbase.profile>2.5</hbase.profile>
+        <hbase.compat.version>2.5.0</hbase.compat.version>
+        <hadoop.version>3.2.3</hadoop.version>
+        <hbase.version>${hbase-2.5.runtime.version}</hbase.version>
+        <hbase.thirdparty.version>4.1.1</hbase.thirdparty.version>
+        <zookeeper.version>3.5.7</zookeeper.version>
+        <tephra.hbase.compat.version>2.4</tephra.hbase.compat.version>
+      </properties>
+    </profile>
     <profile>
       <id>owasp-dependency-check</id>
       <activation>