This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x by this push: new 21bfbad PHOENIX-6351 PhoenixMRJobUtil getActiveResourceManagerAddress logic fails on pseudodistributed cluster 21bfbad is described below commit 21bfbad3577b8b0614e93d500ef3643f910014b1 Author: Richard Antal <antal97rich...@gmail.com> AuthorDate: Wed Apr 28 15:28:49 2021 +0200 PHOENIX-6351 PhoenixMRJobUtil getActiveResourceManagerAddress logic fails on pseudodistributed cluster Change-Id: Id6c2382a6bac888c65900e8f0327d07c8a9e6fd0 --- .../main/java/org/apache/phoenix/util/PhoenixMRJobUtil.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixMRJobUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixMRJobUtil.java index fa35e46..c699e29 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixMRJobUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixMRJobUtil.java @@ -91,13 +91,6 @@ public class PhoenixMRJobUtil { public static String getActiveResourceManagerAddress(Configuration config, String zkQuorum) throws IOException, InterruptedException, KeeperException, InvalidProtocolBufferException, ZooKeeperConnectionException { - // In case of yarn HA is NOT enabled - String resourceManager = PhoenixMRJobUtil.getRMWebAddress(config); - - LOGGER.info("ResourceManagerAddress from config = " + resourceManager); - if(!resourceManager.equals(YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS)){ - return resourceManager; - } // In case of yarn HA is enabled ZooKeeperWatcher zkw = null; ZooKeeper zk = null; @@ -130,6 +123,11 @@ public class PhoenixMRJobUtil { if (zkw != null) zkw.close(); if (zk != null) zk.close(); } + // In case of yarn HA is NOT enabled + if (activeRMHost == null) { + activeRMHost = PhoenixMRJobUtil.getRMWebAddress(config); + LOGGER.info("ResourceManagerAddress from config = " + activeRMHost); + } return activeRMHost; }