Repository: ambari
Updated Branches:
  refs/heads/trunk bbacefd44 -> ac907ced8


AMBARI-19639. Remove the hardcoding for LLAP app name and read it from config 
'llap_app_name'.


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

Branch: refs/heads/trunk
Commit: ac907ced86bbec35f3cf068b4764c23789cf3a17
Parents: bbacefd
Author: Swapan Shridhar <sshrid...@hortonworks.com>
Authored: Thu Jan 19 17:11:06 2017 -0800
Committer: Swapan Shridhar <sshrid...@hortonworks.com>
Committed: Thu Jan 19 17:11:06 2017 -0800

----------------------------------------------------------------------
 .../package/scripts/hive_server_interactive.py  | 27 +++++++++-----------
 .../0.12.0.2.0/package/scripts/params_linux.py  |  1 +
 .../python/stacks/2.5/configs/hsi_default.json  |  3 ++-
 .../test/python/stacks/2.5/configs/hsi_ha.json  |  3 ++-
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac907ced/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index 8035be7..d58f93a 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -227,20 +227,19 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
     def _llap_stop(self, env):
       import params
       Logger.info("Stopping LLAP")
-      SLIDER_APP_NAME = "llap0"
 
-      stop_cmd = ["slider", "stop", SLIDER_APP_NAME]
+      stop_cmd = ["slider", "stop", params.llap_app_name]
 
       code, output, error = shell.call(stop_cmd, user=params.hive_user, 
stderr=subprocess.PIPE, logoutput=True)
       if code == 0:
-        Logger.info(format("Stopped {SLIDER_APP_NAME} application on Slider 
successfully"))
+        Logger.info(format("Stopped {params.llap_app_name} application on 
Slider successfully"))
       elif code == 69 and output is not None and "Unknown application 
instance" in output:
-        Logger.info(format("Application {SLIDER_APP_NAME} was already stopped 
on Slider"))
+        Logger.info(format("Application {params.llap_app_name} was already 
stopped on Slider"))
       else:
-        raise Fail(format("Could not stop application {SLIDER_APP_NAME} on 
Slider. {error}\n{output}"))
+        raise Fail(format("Could not stop application {params.llap_app_name} 
on Slider. {error}\n{output}"))
 
       # Will exit with code 4 if need to run with "--force" to delete 
directories and registries.
-      Execute(('slider', 'destroy', SLIDER_APP_NAME, "--force"),
+      Execute(('slider', 'destroy', params.llap_app_name, "--force"),
               user=params.hive_user,
               timeout=30,
               ignore_failures=True,
@@ -253,19 +252,17 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
       import params
       env.set_params(params)
 
-      LLAP_APP_NAME = 'llap0'
-
       if params.hive_server_interactive_ha:
         """
         Check llap app state
         """
         Logger.info("HSI HA is enabled. Checking if LLAP is already running 
...")
-        status = self.check_llap_app_status(LLAP_APP_NAME, 2, 
params.hive_server_interactive_ha)
+        status = self.check_llap_app_status(params.llap_app_name, 2, 
params.hive_server_interactive_ha)
         if status:
-          Logger.info("LLAP app '{0}' is already 
running.".format(LLAP_APP_NAME))
+          Logger.info("LLAP app '{0}' is already 
running.".format(params.llap_app_name))
           return True
         else:
-          Logger.info("LLAP app '{0}' is not running. llap will be 
started.".format(LLAP_APP_NAME))
+          Logger.info("LLAP app '{0}' is not running. llap will be 
started.".format(params.llap_app_name))
         pass
 
       # Call for cleaning up the earlier run(s) LLAP package folders.
@@ -334,16 +331,16 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
 
         Logger.info(format("Run file path: {run_file_path}"))
         Execute(run_file_path, user=params.hive_user, logoutput=True)
-        Logger.info("Submitted LLAP app name : {0}".format(LLAP_APP_NAME))
+        Logger.info("Submitted LLAP app name : 
{0}".format(params.llap_app_name))
 
         # We need to check the status of LLAP app to figure out it got
         # launched properly and is in running state. Then go ahead with Hive 
Interactive Server start.
-        status = self.check_llap_app_status(LLAP_APP_NAME, 
params.num_retries_for_checking_llap_status)
+        status = self.check_llap_app_status(params.llap_app_name, 
params.num_retries_for_checking_llap_status)
         if status:
-          Logger.info("LLAP app '{0}' deployed 
successfully.".format(LLAP_APP_NAME))
+          Logger.info("LLAP app '{0}' deployed 
successfully.".format(params.llap_app_name))
           return True
         else:
-          Logger.error("LLAP app '{0}' deployment 
unsuccessful.".format(LLAP_APP_NAME))
+          Logger.error("LLAP app '{0}' deployment 
unsuccessful.".format(params.llap_app_name))
           return False
       except:
         # Attempt to clean up the packaged application, or potentially rename 
it with a .bak

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac907ced/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 9185f78..d0d8d1c 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -610,6 +610,7 @@ if has_hive_interactive:
   hive_interactive_enabled = 
default('/configurations/hive-interactive-env/enable_hive_interactive', False)
   llap_app_java_opts = 
default('/configurations/hive-interactive-env/llap_java_opts', 
'-XX:+AlwaysPreTouch {% if java_version > 7 %}-XX:+UseG1GC -XX:TLABSize=8m 
-XX:+ResizeTLAB -XX:+UseNUMA -XX:+AggressiveOpts -XX:MetaspaceSize=1024m 
-XX:InitiatingHeapOccupancyPercent=80 -XX:MaxGCPauseMillis=200{% else 
%}-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA 
-XX:+UseParallelGC{% endif %}')
   hive_interactive_heapsize = hive_heapsize
+  llap_app_name = 
config['configurations']['hive-interactive-env']['llap_app_name']
   # Ambari upgrade may not add this config as it will force restart of HSI 
(stack upgrade should)
   if 'hive_heapsize' in config['configurations']['hive-interactive-env']:
     hive_interactive_heapsize = 
config['configurations']['hive-interactive-env']['hive_heapsize']

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac907ced/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json 
b/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
index 6531750..9dcb451 100644
--- a/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
+++ b/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
@@ -421,7 +421,8 @@
             "num_llap_nodes" : "1",
             "num_retries_for_checking_llap_status" : 2,
             "llap_heap_size":"280",
-            "llap_log_level":"INFO"
+            "llap_log_level":"INFO",
+            "llap_app_name":"llap0"
         },
         "hive-interactive-site": {
             "hive.enforce.sorting": "true",

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac907ced/ambari-server/src/test/python/stacks/2.5/configs/hsi_ha.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/configs/hsi_ha.json 
b/ambari-server/src/test/python/stacks/2.5/configs/hsi_ha.json
index 10d1d99..3fd9f72 100644
--- a/ambari-server/src/test/python/stacks/2.5/configs/hsi_ha.json
+++ b/ambari-server/src/test/python/stacks/2.5/configs/hsi_ha.json
@@ -420,7 +420,8 @@
             "num_llap_nodes" : "1",
             "num_retries_for_checking_llap_status" : 2,
             "llap_heap_size":"280",
-            "llap_log_level":"INFO"
+            "llap_log_level":"INFO",
+            "llap_app_name":"llap0"
         },
         "hive-interactive-site": {
             "hive.enforce.sorting": "true",

Reply via email to