You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/10/29 19:26:30 UTC

ambari git commit: AMBARI-13596. Stop-and-Start Upgrade: Handle Falcon in all upgrade and downgrade paths (Swapan Shridhar via alejandro)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 657ccbee6 -> 73fb0a016


AMBARI-13596. Stop-and-Start Upgrade: Handle Falcon in all upgrade and downgrade paths (Swapan Shridhar via alejandro)


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

Branch: refs/heads/branch-2.1
Commit: 73fb0a016d9d4f9d1b6fbd04a1a8cafffdfdbc72
Parents: 657ccbe
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Oct 29 11:25:24 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu Oct 29 11:25:24 2015 -0700

----------------------------------------------------------------------
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py  |  4 ++--
 .../0.5.0.2.1/package/scripts/falcon_client.py  |  3 ++-
 .../0.5.0.2.1/package/scripts/falcon_server.py  | 21 ++++++++++----------
 .../stacks/2.1/FALCON/test_falcon_client.py     |  4 ++--
 .../stacks/2.1/FALCON/test_falcon_server.py     |  4 ++--
 5 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/73fb0a01/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
index e4edcff..aacb988 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
@@ -35,7 +35,7 @@ from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 
 @OsFamilyFuncImpl(os_family = OsFamilyImpl.DEFAULT)
-def falcon(type, action = None):
+def falcon(type, action = None, upgrade_type=None):
   import params
 
   if action == 'config':
@@ -180,7 +180,7 @@ def falcon(type, action = None):
 
 
 @OsFamilyFuncImpl(os_family = OSConst.WINSRV_FAMILY)
-def falcon(type, action = None):
+def falcon(type, action = None, upgrade_type=None):
   import params
 
   if action == 'config':

http://git-wip-us.apache.org/repos/asf/ambari/blob/73fb0a01/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
index dc970c8..35e3cd4 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_client.py
@@ -42,7 +42,8 @@ class FalconClientLinux(FalconClient):
     self.install_packages(env)
     self.configure(env)
 
-  def pre_rolling_restart(self, env):
+  def pre_upgrade_restart(self, env, upgrade_type=None):
+    Logger.info("Executing Stack Upgrade pre-restart")
     import params
     env.set_params(params)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/73fb0a01/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
index 3436e5b..b9d37a6 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon_server.py
@@ -35,24 +35,24 @@ from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 
 class FalconServer(Script):
-  def configure(self, env):
+  def configure(self, env, upgrade_type=None):
     import params
     env.set_params(params)
-    falcon('server', action='config')
+    falcon('server', action='config', upgrade_type=upgrade_type)
 
-  def start(self, env, rolling_restart=False):
+  def start(self, env, upgrade_type=None):
     import params
     env.set_params(params)
-    self.configure(env)
-    falcon('server', action='start')
+    self.configure(env, upgrade_type=upgrade_type)
+    falcon('server', action='start', upgrade_type=upgrade_type)
 
-  def stop(self, env, rolling_restart=False):
+  def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
-    falcon('server', action='stop')
+    falcon('server', action='stop', upgrade_type=upgrade_type)
 
-    # if performing an upgrade, backup some directories after stopping falcon
-    if rolling_restart:
+    # if performing an upgrade (ROLLING / NON_ROLLING), backup some directories after stopping falcon
+    if upgrade_type is not None:
       falcon_server_upgrade.post_stop_backup()
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
@@ -70,7 +70,8 @@ class FalconServerLinux(FalconServer):
     env.set_params(status_params)
     check_process_status(status_params.server_pid_file)
 
-  def pre_rolling_restart(self, env):
+  def pre_upgrade_restart(self, env, upgrade_type=None):
+    Logger.info("Executing Stack Upgrade pre-restart")
     import params
     env.set_params(params)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/73fb0a01/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
index 9b08a90..ebe8cc9 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
@@ -113,7 +113,7 @@ class TestFalconClient(RMFTestCase):
     json_content['commandParams']['version'] = version
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_client.py",
                        classname = "FalconClient",
-                       command = "pre_rolling_restart",
+                       command = "pre_upgrade_restart",
                        config_dict = json_content,
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
@@ -132,7 +132,7 @@ class TestFalconClient(RMFTestCase):
     mocks_dict = {}
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_client.py",
                        classname = "FalconClient",
-                       command = "pre_rolling_restart",
+                       command = "pre_upgrade_restart",
                        config_dict = json_content,
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,

http://git-wip-us.apache.org/repos/asf/ambari/blob/73fb0a01/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 793e8dc..c46eb69 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -493,7 +493,7 @@ class TestFalconServer(RMFTestCase):
     json_content['commandParams']['version'] = version
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py",
                        classname = "FalconServer",
-                       command = "pre_rolling_restart",
+                       command = "pre_upgrade_restart",
                        config_dict = json_content,
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
@@ -517,7 +517,7 @@ class TestFalconServer(RMFTestCase):
     mocks_dict = {}
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py",
                        classname = "FalconServer",
-                       command = "pre_rolling_restart",
+                       command = "pre_upgrade_restart",
                        config_dict = json_content,
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,