kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qhz...@apache.org
Subject incubator-kylin git commit: KYLIN-1067 Kylin get MapReduce Job status with "yarn.resourcemanager.webapp.address" need suport ResourceManager HA config
Date Mon, 02 Nov 2015 02:42:56 GMT
Repository: incubator-kylin
Updated Branches:
  refs/heads/2.x-staging 3e0929354 -> 743af601d


KYLIN-1067 Kylin get MapReduce Job status with "yarn.resourcemanager.webapp.address" need
suport ResourceManager HA config


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/743af601
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/743af601
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/743af601

Branch: refs/heads/2.x-staging
Commit: 743af601d0080c01eaf30103d3877739bafbf1c8
Parents: 3e09293
Author: wangxiaoyu8 <wangxiaoyu1@jd.com>
Authored: Mon Oct 12 11:34:47 2015 +0800
Committer: qianhao.zhou <qianzhou@ebay.com>
Committed: Mon Nov 2 10:42:03 2015 +0800

----------------------------------------------------------------------
 .../kylin/engine/mr/common/MapReduceExecutable.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/743af601/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/MapReduceExecutable.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/MapReduceExecutable.java
b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/MapReduceExecutable.java
index c1aa42e..4fb3eed 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/MapReduceExecutable.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/MapReduceExecutable.java
@@ -32,6 +32,9 @@ import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.JobID;
 import org.apache.hadoop.mapreduce.JobStatus;
 import org.apache.hadoop.util.ToolRunner;
+import org.apache.hadoop.yarn.conf.HAUtil;
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.util.RMHAUtils;
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.ClassUtil;
 import org.apache.kylin.job.constant.ExecutableConstants;
@@ -198,7 +201,12 @@ public class MapReduceExecutable extends AbstractExecutable {
         } else {
             logger.info(KylinConfig.KYLIN_JOB_YARN_APP_REST_CHECK_URL + " is not set, read
from job configuration");
         }
-        String rmWebHost = job.getConfiguration().get("yarn.resourcemanager.webapp.address");
+        String rmWebHost = HAUtil.getConfValueForRMInstance(YarnConfiguration.RM_WEBAPP_ADDRESS,
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS, job.getConfiguration());
+        if(HAUtil.isHAEnabled(job.getConfiguration())) {
+            YarnConfiguration conf = new YarnConfiguration(job.getConfiguration());
+            String active = RMHAUtils.findActiveRMHAId(conf);
+            rmWebHost = HAUtil.getConfValueForRMInstance(HAUtil.addSuffix(YarnConfiguration.RM_WEBAPP_ADDRESS,
active), YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS, conf);
+        }
         if (StringUtils.isEmpty(rmWebHost)) {
             return null;
         }


Mime
View raw message