Repository: ambari Updated Branches: refs/heads/branch-2.4 d6ec169e1 -> c91d18cac
AMBARI-17896. Fix Falcon atlas configuration for new atlas falcon hooks (Venkat Ranganathan via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c91d18ca Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c91d18ca Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c91d18ca Branch: refs/heads/branch-2.4 Commit: c91d18cac42bacab5d5a3c77466665a6339172e2 Parents: d6ec169 Author: Alejandro Fernandez <[email protected]> Authored: Wed Jul 27 11:39:54 2016 -0700 Committer: Alejandro Fernandez <[email protected]> Committed: Wed Jul 27 11:41:24 2016 -0700 ---------------------------------------------------------------------- .../FALCON/0.5.0.2.1/package/scripts/params_linux.py | 11 +++++++---- .../resources/stacks/HDP/2.3/services/stack_advisor.py | 7 ++++++- .../resources/stacks/HDP/2.5/services/stack_advisor.py | 6 ++++++ 3 files changed, 19 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c91d18ca/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py index ebe3634..089fdb0 100644 --- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params_linux.py @@ -155,10 +155,13 @@ if has_atlas_in_cluster(): atlas_hook_filename = default('/configurations/atlas-env/metadata_conf_file', 'atlas-application.properties') # Only append /etc/atlas/conf to classpath if on HDP 2.4.* and atlas server is running on this host. - if has_atlas_server_on_host and check_stack_feature(StackFeature.ATLAS_CONF_DIR_IN_PATH, stack_version_formatted): - atlas_conf_dir = os.environ['METADATA_CONF'] if 'METADATA_CONF' in os.environ else format('{stack_root}/current/atlas-server/conf') - atlas_home_dir = os.environ['METADATA_HOME_DIR'] if 'METADATA_HOME_DIR' in os.environ else format('{stack_root}/current/atlas-server') - atlas_hook_cp = atlas_conf_dir + os.pathsep + os.path.join(atlas_home_dir, "hook", "falcon", "*") + os.pathsep + if has_atlas_server_on_host: + if check_stack_feature(StackFeature.ATLAS_CONF_DIR_IN_PATH, stack_version_formatted): + atlas_conf_dir = os.environ['METADATA_CONF'] if 'METADATA_CONF' in os.environ else format('{stack_root}/current/atlas-server/conf') + atlas_home_dir = os.environ['METADATA_HOME_DIR'] if 'METADATA_HOME_DIR' in os.environ else format('{stack_root}/current/atlas-server') + atlas_hook_cp = atlas_conf_dir + os.pathsep + os.path.join(atlas_home_dir, "hook", "falcon", "*") + os.pathsep + elif check_stack_feature(StackFeature.ATLAS_UPGRADE_SUPPORT, stack_version_formatted): + atlas_hook_cp = format('{stack_root}/current/atlas-client/falcon/hook/*') #endregion hdfs_site = config['configurations']['hdfs-site'] http://git-wip-us.apache.org/repos/asf/ambari/blob/c91d18ca/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py index f82655d..c2c2ff6 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py @@ -747,6 +747,12 @@ class HDP23StackAdvisor(HDP22StackAdvisor): putStormStartupProperty(notifier_plugin_property, notifier_plugin_value) def recommendFalconConfigurations(self, configurations, clusterData, services, hosts): + # In 2.5, the classname changed. The 2.5 stack advisor method will + # call this with attribute set. 2.3 will use the old method name + if hasattr(self, "__atlasFalconHookClassName"): + atlas_application_class = self.__atlasFalconHookClassName + else: + atlas_application_class = "org.apache.falcon.atlas.service.AtlasService" putFalconStartupProperty = self.putProperty(configurations, "falcon-startup.properties", services) servicesList = [service["StackServices"]["service_name"] for service in services["services"]] @@ -758,7 +764,6 @@ class HDP23StackAdvisor(HDP22StackAdvisor): application_services_value = " " include_atlas = "ATLAS" in servicesList - atlas_application_class = "org.apache.falcon.atlas.service.AtlasService" if include_atlas and atlas_application_class not in application_services_value: if application_services_value == " ": application_services_value = atlas_application_class http://git-wip-us.apache.org/repos/asf/ambari/blob/c91d18ca/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py index c46a168..5cd1389 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py @@ -80,6 +80,12 @@ class HDP25StackAdvisor(HDP24StackAdvisor): putOozieEnvProperty("oozie_admin_users", newAdminUsers) + def recommendFalconConfigurations(self, configurations, clusterData, services, hosts): + # Set the classname for the Falcon hook to 2.5 classname = all other 2.3 + # stack advisor changes are needed. + self.__atlasFalconHookClassName = "org.apache.atlas.falcon.service.AtlasService" + super(HDP25StackAdvisor,self).recommendFalconConfigurations(configurations, clusterData, services, hosts) + def createComponentLayoutRecommendations(self, services, hosts): parentComponentLayoutRecommendations = super(HDP25StackAdvisor, self).createComponentLayoutRecommendations( services, hosts)
