Repository: ambari Updated Branches: refs/heads/trunk 159e5beeb -> cc302f7d3
AMBARI-19188. Provide Atlas Hook support for Hive2 (Vishal Suvagia via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cc302f7d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cc302f7d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cc302f7d Branch: refs/heads/trunk Commit: cc302f7d3c79d12fef8873acd76e962218aaac65 Parents: 159e5be Author: Alejandro Fernandez <afernan...@hortonworks.com> Authored: Thu Jan 12 14:57:31 2017 -0800 Committer: Alejandro Fernandez <afernan...@hortonworks.com> Committed: Thu Jan 12 14:57:31 2017 -0800 ---------------------------------------------------------------------- .../libraries/functions/constants.py | 1 + .../0.12.0.2.0/package/scripts/hive_interactive.py | 15 ++++++++++++++- .../HIVE/0.12.0.2.0/package/scripts/params_linux.py | 1 + .../stacks/HDP/2.0.6/properties/stack_features.json | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/cc302f7d/ambari-common/src/main/python/resource_management/libraries/functions/constants.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py index a633c13..f4837fb 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py @@ -107,3 +107,4 @@ class StackFeature: PHOENIX_CORE_HDFS_SITE_REQUIRED = "phoenix_core_hdfs_site_required" RANGER_TAGSYNC_SSL_XML_SUPPORT="ranger_tagsync_ssl_xml_support" RANGER_SOLR_CONFIG_SUPPORT='ranger_solr_config_support' + HIVE_INTERACTIVE_ATLAS_HOOK_REQUIRED="hive_interactive_atlas_hook_required" http://git-wip-us.apache.org/repos/asf/ambari/blob/cc302f7d/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py index b2a76af..335a850 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py @@ -41,6 +41,8 @@ from resource_management.core.shell import as_sudo from resource_management.core.shell import quote_bash_args from resource_management.core.logger import Logger from resource_management.core import utils +from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster, setup_atlas_hook +from ambari_commons.constants import SERVICE from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl from ambari_commons import OSConst @@ -122,7 +124,18 @@ def hive_interactive(name=None): Hive2 doesn't have support for Atlas, we need to remove the Hook 'org.apache.atlas.hive.hook.HiveHook', which would have come in config 'hive.exec.post.hooks' during the site merge logic, if Atlas is installed. ''' - remove_atlas_hook_if_exists(merged_hive_interactive_site) + # Generate atlas-application.properties.xml file + if params.enable_atlas_hook and params.stack_supports_atlas_hook_for_hive_interactive: + Logger.info("Setup for Atlas Hive2 Hook started.") + + atlas_hook_filepath = os.path.join(params.hive_server_interactive_conf_dir, params.atlas_hook_filename) + setup_atlas_hook(SERVICE.HIVE, params.hive_atlas_application_properties, atlas_hook_filepath, params.hive_user, params.user_group) + + Logger.info("Setup for Atlas Hive2 Hook done.") + else: + # Required for HDP 2.5 stacks + Logger.info("Skipping setup for Atlas Hook, as it is disabled/ not supported.") + remove_atlas_hook_if_exists(merged_hive_interactive_site) ''' As tez_hive2/tez-site.xml only contains the new + the changed props compared to tez/tez-site.xml, http://git-wip-us.apache.org/repos/asf/ambari/blob/cc302f7d/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 3f165cc..fc6bf1a 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 @@ -90,6 +90,7 @@ upgrade_direction = default("/commandParams/upgrade_direction", None) stack_supports_ranger_kerberos = check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, version_for_stack_feature_checks) stack_supports_ranger_audit_db = check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, version_for_stack_feature_checks) stack_supports_ranger_hive_jdbc_url_change = check_stack_feature(StackFeature.RANGER_HIVE_PLUGIN_JDBC_URL, version_for_stack_feature_checks) +stack_supports_atlas_hook_for_hive_interactive = check_stack_feature(StackFeature.HIVE_INTERACTIVE_ATLAS_HOOK_REQUIRED, version_for_stack_feature_checks) # component ROLE directory (like hive-metastore or hive-server2-hive2) component_directory = status_params.component_directory http://git-wip-us.apache.org/repos/asf/ambari/blob/cc302f7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json index ca4c9f5..c3044af 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json @@ -338,6 +338,11 @@ "name": "ranger_solr_config_support", "description": "Showing Ranger solrconfig.xml on UI", "min_version": "2.6.0.0" + }, + { + "name": "hive_interactive_atlas_hook_required", + "description": "Registering Atlas Hook for Hive Interactive.", + "min_version": "2.6.0.0" } ] }