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

richardantal 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 efd7efc  PHOENIX-6351 PhoenixMRJobUtil getActiveResourceManagerAddress 
logic fails on pseudodistributed cluster
efd7efc is described below

commit efd7efc40a9c1c45f7c1de4e77d6ae7d759415a7
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 dc6a15a..1f15603 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
         ZKWatcher 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;
     }

Reply via email to