This is an automated email from the ASF dual-hosted git repository.
lokiore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new 81828f2ae0 PHOENIX-7495 :- ADDENDUM to fix ITs with HBase 2.4 build
involving RPC Registry (#2137)
81828f2ae0 is described below
commit 81828f2ae0d5fa379fc04180efff1c8f2b371444
Author: Lokesh Khurana <[email protected]>
AuthorDate: Thu May 1 17:47:59 2025 -0700
PHOENIX-7495 :- ADDENDUM to fix ITs with HBase 2.4 build involving RPC
Registry (#2137)
---
.../java/org/apache/phoenix/jdbc/FailoverPhoenixConnection2IT.java | 4 ++++
.../phoenix/jdbc/HAConnectionWithMasterAndRPCRegistryIT.java | 7 +++++++
.../org/apache/phoenix/jdbc/HighAvailabilityTestingUtilityIT.java | 6 ++++++
.../java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionIT.java | 4 ++++
.../apache/phoenix/jdbc/ParallelPhoenixConnectionWorkflowIT.java | 5 +++++
5 files changed, 26 insertions(+)
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/FailoverPhoenixConnection2IT.java
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/FailoverPhoenixConnection2IT.java
index 03411c888c..44b923fa16 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/FailoverPhoenixConnection2IT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/FailoverPhoenixConnection2IT.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.io.IOException;
import java.sql.Connection;
@@ -44,6 +45,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.junit.After;
import org.junit.AfterClass;
@@ -408,6 +410,8 @@ public class FailoverPhoenixConnection2IT {
connectionList.add(createFailoverConnection());
}
ClusterRoleRecord.RegistryType newRegistry =
ClusterRoleRecord.RegistryType.RPC;
+ //RPC Registry is only there in hbase version greater than 2.5.0
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
CLUSTERS.transitClusterRoleRecordRegistry(haGroup, newRegistry);
for (short i = 0; i < numberOfConnections; i++) {
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HAConnectionWithMasterAndRPCRegistryIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HAConnectionWithMasterAndRPCRegistryIT.java
index 4facc114ea..0f6b4ec09d 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HAConnectionWithMasterAndRPCRegistryIT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HAConnectionWithMasterAndRPCRegistryIT.java
@@ -18,6 +18,7 @@
package org.apache.phoenix.jdbc;
import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.jdbc.ClusterRoleRecord.RegistryType;
import org.apache.phoenix.query.ConnectionQueryServices;
@@ -51,6 +52,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -95,6 +97,9 @@ public class HAConnectionWithMasterAndRPCRegistryIT {
@Before
public void setup() throws Exception {
+ if (registryType == ClusterRoleRecord.RegistryType.RPC) {
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
+ }
parallelHAGroupName = testName.getMethodName() + "_" +
HighAvailabilityPolicy.PARALLEL.name();
failoverHAGroupName = testName.getMethodName() + "_" +
HighAvailabilityPolicy.FAILOVER.name();
parallelClientProperties =
HighAvailabilityTestingUtility.getHATestProperties();
@@ -489,6 +494,8 @@ public class HAConnectionWithMasterAndRPCRegistryIT {
ClusterRoleRecord.RegistryType newRegistry;
if (registryType == RegistryType.MASTER) {
newRegistry = RegistryType.RPC;
+ //RPC Registry is only there in hbase version greater than 2.5.0
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
} else {
newRegistry = RegistryType.ZK;
}
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HighAvailabilityTestingUtilityIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HighAvailabilityTestingUtilityIT.java
index 06ac323dae..19c2a7b500 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HighAvailabilityTestingUtilityIT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/HighAvailabilityTestingUtilityIT.java
@@ -26,6 +26,7 @@ import static
org.apache.phoenix.jdbc.HighAvailabilityTestingUtility.getHighAvai
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.sql.Connection;
import java.sql.DriverManager;
@@ -36,6 +37,7 @@ import java.util.Collection;
import java.util.Properties;
import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.query.ConnectionQueryServices;
import org.junit.AfterClass;
@@ -93,6 +95,10 @@ public class HighAvailabilityTestingUtilityIT {
@Before
public void setup() throws Exception {
+ //RPC Registry is only there in hbase version greater than 2.5.0
+ if (registryType == ClusterRoleRecord.RegistryType.RPC) {
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
+ }
haGroupName = testName.getMethodName();
clientProperties =
HighAvailabilityTestingUtility.getHATestProperties();
clientProperties.setProperty(PHOENIX_HA_GROUP_ATTR, haGroupName);
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionIT.java
index d1f97356fe..aa2bf52a9a 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionIT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionIT.java
@@ -39,6 +39,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.sql.Connection;
import java.sql.DriverManager;
@@ -51,6 +52,7 @@ import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.jdbc.ClusterRoleRecord.ClusterRole;
@@ -578,6 +580,8 @@ public class ParallelPhoenixConnectionIT {
connectionList.add(getParallelConnection());
}
ClusterRoleRecord.RegistryType newRegistry =
ClusterRoleRecord.RegistryType.RPC;
+ //RPC Registry is only there in hbase version greater than 2.5.0
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
CLUSTERS.transitClusterRoleRecordRegistry(haGroup, newRegistry);
for (short i = 0; i < numberOfConnections; i++) {
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionWorkflowIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionWorkflowIT.java
index 5950115d75..28c232cde4 100644
---
a/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionWorkflowIT.java
+++
b/phoenix-core/src/it/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionWorkflowIT.java
@@ -19,6 +19,7 @@ package org.apache.phoenix.jdbc;
import org.apache.commons.lang3.StringUtils;
import org.apache.curator.shaded.com.google.common.collect.Lists;
+import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import
org.apache.phoenix.jdbc.ParallelPhoenixResultSetFactory.ParallelPhoenixResultSetType;
import org.apache.phoenix.query.BaseTest;
@@ -54,6 +55,7 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
/**
* Use case basic tests basics for {@link ParallelPhoenixConnection}.
@@ -215,6 +217,9 @@ public class ParallelPhoenixConnectionWorkflowIT {
@Before
public void setup() throws Exception {
+ if (registryType == ClusterRoleRecord.RegistryType.RPC) {
+ assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(),
"2.5.0")>=0);
+ }
String haGroupName = testName.getMethodName();
clientProperties = new Properties(GLOBAL_PROPERTIES);
clientProperties.setProperty(PHOENIX_HA_GROUP_ATTR, haGroupName);