Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d43f4c1bd -> cae9ee29d


AMBARI-19719. Update rpc port for LLAP to 0 for HDP stack (Siddharth Seth via 
smohanty)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cae9ee29
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cae9ee29
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cae9ee29

Branch: refs/heads/branch-2.5
Commit: cae9ee29dd42c94c06569fb03643e23950752622
Parents: d43f4c1
Author: Sumit Mohanty <[email protected]>
Authored: Mon Jan 30 11:13:56 2017 -0800
Committer: Sumit Mohanty <[email protected]>
Committed: Mon Jan 30 11:13:56 2017 -0800

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog250.java       | 30 ++++++++++++++------
 .../configuration/hive-interactive-site.xml     |  2 +-
 2 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cae9ee29/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 624e5a2..a8a5d17 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -332,7 +332,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
           Set<String> installedServices = cluster.getServices().keySet();
 
           if (installedServices.contains("HIVE")) {
-            Config hiveSite = 
cluster.getDesiredConfigByType("hive-interactive-site");
+            Config hiveSite = 
cluster.getDesiredConfigByType(HIVE_INTERACTIVE_SITE);
             if (hiveSite != null) {
               Map<String, String> hiveSiteProperties = 
hiveSite.getProperties();
               String schedulerDelay = 
hiveSiteProperties.get("hive.llap.task.scheduler.locality.delay");
@@ -343,19 +343,19 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
                     int schedulerDelayInt = Integer.parseInt(schedulerDelay);
                     if (schedulerDelayInt == -1) {
                       // Old default. Set to new default.
-                      updateConfigurationProperties("hive-interactive-site", 
Collections
+                      updateConfigurationProperties(HIVE_INTERACTIVE_SITE, 
Collections
                               
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
                           false);
                     }
                   } catch (NumberFormatException e) {
                     // Invalid existing value. Set to new default.
-                    updateConfigurationProperties("hive-interactive-site", 
Collections
+                    updateConfigurationProperties(HIVE_INTERACTIVE_SITE, 
Collections
                             
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
                         false);
                   }
                 }
               }
-              updateConfigurationProperties("hive-interactive-site",
+              updateConfigurationProperties(HIVE_INTERACTIVE_SITE,
                   
Collections.singletonMap("hive.mapjoin.hybridgrace.hashtable", "true"), true,
                   false);
               updateConfigurationProperties("tez-interactive-site",
@@ -607,6 +607,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
    *
    * @throws AmbariException
    */
+  private static final String HIVE_INTERACTIVE_SITE = "hive-interactive-site";
   protected void updateHIVEInteractiveConfigs() throws AmbariException {
     AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
     Clusters clusters = ambariManagementController.getClusters();
@@ -615,16 +616,29 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 
       if (clusterMap != null && !clusterMap.isEmpty()) {
         for (final Cluster cluster : clusterMap.values()) {
-          Config hiveInteractiveSite = 
cluster.getDesiredConfigByType("hive-interactive-site");
+          Config hiveInteractiveSite = 
cluster.getDesiredConfigByType(HIVE_INTERACTIVE_SITE);
           if (hiveInteractiveSite != null) {
-            updateConfigurationProperties("hive-interactive-site", 
Collections.singletonMap("hive.tez.container.size",
+            updateConfigurationProperties(HIVE_INTERACTIVE_SITE, 
Collections.singletonMap("hive.tez.container.size",
                 "SET_ON_FIRST_INVOCATION"), true, true);
 
-            updateConfigurationProperties("hive-interactive-site", 
Collections.singletonMap("hive.auto.convert.join.noconditionaltask.size",
+            updateConfigurationProperties(HIVE_INTERACTIVE_SITE, 
Collections.singletonMap("hive.auto.convert.join.noconditionaltask.size",
                 "1000000000"), true, true);
-            updateConfigurationProperties("hive-interactive-site",
+            updateConfigurationProperties(HIVE_INTERACTIVE_SITE,
                 Collections.singletonMap("hive.llap.execution.mode", "only"),
                 true, true);
+            String llapRpcPortString = 
hiveInteractiveSite.getProperties().get("hive.llap.daemon.rpc.port");
+            if (StringUtils.isNotBlank(llapRpcPortString)) {
+              try {
+                int llapRpcPort = Integer.parseInt(llapRpcPortString);
+                if (llapRpcPort == 15001) {
+                  updateConfigurationProperties(HIVE_INTERACTIVE_SITE,
+                      Collections.singletonMap("hive.llap.daemon.rpc.port", 
"only"),
+                      true, true);
+                }
+              } catch (NumberFormatException e) {
+                LOG.warn("Unable to parse llap.rpc.port as integer: " + 
llapRpcPortString);
+              }
+            }
           }
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cae9ee29/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-site.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-site.xml
index 640f30f..93e2020 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-site.xml
@@ -537,7 +537,7 @@ limitations under the License.
   </property>
   <property>
     <name>hive.llap.daemon.rpc.port</name>
-    <value>15001</value>
+    <value>0</value>
     <description>The LLAP daemon RPC port.</description>
     <on-ambari-upgrade add="true"/>
   </property>

Reply via email to