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 4812ee60f7 PHOENIX-7150 PHOENIX-6523 has broken HBase 2.1 and 2.2 support 4812ee60f7 is described below commit 4812ee60f7bb1513324563fa2f6978d8a80f92f3 Author: Istvan Toth <st...@apache.org> AuthorDate: Wed Dec 13 08:52:35 2023 +0100 PHOENIX-7150 PHOENIX-6523 has broken HBase 2.1 and 2.2 support --- .../src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java | 6 ++++++ .../src/main/java/org/apache/phoenix/jdbc/ZKConnectionInfo.java | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java index 1b566dd362..0347b1dfb4 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java @@ -57,22 +57,28 @@ public abstract class ConnectionInfo { protected static final boolean HAS_MASTER_REGISTRY; protected static final boolean HAS_RPC_REGISTRY; + // HBase 2.2 and older doesn't have the ZK registry class by the expected name + protected static final boolean DO_NOT_SET_REGISTRY; static { String version = VersionInfo.getVersion(); if (getMajorVersion(version) >= 3) { HAS_MASTER_REGISTRY = true; HAS_RPC_REGISTRY = true; + DO_NOT_SET_REGISTRY = false; } else { if (VersionInfo.compareVersion(VersionInfo.getVersion(), "2.3.0") < 0) { HAS_MASTER_REGISTRY = false; HAS_RPC_REGISTRY = false; + DO_NOT_SET_REGISTRY = true; } else if (VersionInfo.compareVersion(VersionInfo.getVersion(), "2.5.0") < 0) { HAS_MASTER_REGISTRY = true; HAS_RPC_REGISTRY = false; + DO_NOT_SET_REGISTRY = false; } else { HAS_MASTER_REGISTRY = true; HAS_RPC_REGISTRY = true; + DO_NOT_SET_REGISTRY = false; } } } diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ZKConnectionInfo.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ZKConnectionInfo.java index 841b0073ab..4460082f64 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ZKConnectionInfo.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/ZKConnectionInfo.java @@ -75,9 +75,10 @@ public class ZKConnectionInfo extends ConnectionInfo { } Map<String, String> connectionProps = getCommonProps(); - connectionProps.put(CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY, - ZK_REGISTRY_NAME); - + if (!DO_NOT_SET_REGISTRY) { + connectionProps.put(CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY, + ZK_REGISTRY_NAME); + } if (getZkHosts() != null) { //This has the highest priority connectionProps.put(HConstants.CLIENT_ZOOKEEPER_QUORUM, getZkHosts());