Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2CC11200C2F for ; Mon, 6 Mar 2017 20:53:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2B11E160B76; Mon, 6 Mar 2017 19:53:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4DF1F160B66 for ; Mon, 6 Mar 2017 20:53:25 +0100 (CET) Received: (qmail 58361 invoked by uid 500); 6 Mar 2017 19:53:24 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 58352 invoked by uid 99); 6 Mar 2017 19:53:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2017 19:53:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6C294DFBD9; Mon, 6 Mar 2017 19:53:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smohanty@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-20317. Update stack advisor logic for getting enable atlas hook flag value (Mugdha Varadkar via smohanty) Date: Mon, 6 Mar 2017 19:53:24 +0000 (UTC) archived-at: Mon, 06 Mar 2017 19:53:26 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.5 23bd4187c -> 1b8b91dc8 AMBARI-20317. Update stack advisor logic for getting enable atlas hook flag value (Mugdha Varadkar via smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1b8b91dc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1b8b91dc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1b8b91dc Branch: refs/heads/branch-2.5 Commit: 1b8b91dc87a0694cb7b3aa3a55829a90b202bb35 Parents: 23bd418 Author: Sumit Mohanty Authored: Mon Mar 6 11:30:05 2017 -0800 Committer: Sumit Mohanty Committed: Mon Mar 6 11:53:04 2017 -0800 ---------------------------------------------------------------------- .../1.4.4.2.0/configuration/sqoop-site.xml | 4 +++ .../stacks/HDP/2.3/services/stack_advisor.py | 31 ++++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1b8b91dc/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml index 5d87c4d..5c9804b 100644 --- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml +++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml @@ -40,6 +40,10 @@ sqoop-env sqoop.atlas.hook + + application-properties + atlas.rest.address + http://git-wip-us.apache.org/repos/asf/ambari/blob/1b8b91dc/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 f18bfe9..6d0ce38 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 @@ -257,7 +257,6 @@ class HDP23StackAdvisor(HDP22StackAdvisor): else: hooks_value = "" - hive_hooks = [x.strip() for x in hooks_value.split(",")] hive_hooks = [x for x in hive_hooks if x != ""] is_atlas_present_in_cluster = "ATLAS" in servicesList @@ -268,11 +267,10 @@ class HDP23StackAdvisor(HDP22StackAdvisor): else: putHiveEnvProperty("hive.atlas.hook", "false") - if ('hive-env' in services['configurations']) and ('hive.atlas.hook' in services['configurations']['hive-env']['properties']): - if 'hive-env' in configurations and 'hive.atlas.hook' in configurations['hive-env']['properties']: - enable_atlas_hook = configurations['hive-env']['properties']['hive.atlas.hook'] == "true" - elif 'hive-env' in services['configurations'] and 'hive.atlas.hook' in services['configurations']['hive-env']['properties']: - enable_atlas_hook = services['configurations']['hive-env']['properties']['hive.atlas.hook'] == "true" + if 'hive-env' in configurations and 'hive.atlas.hook' in configurations['hive-env']['properties']: + enable_atlas_hook = configurations['hive-env']['properties']['hive.atlas.hook'] == "true" + elif 'hive-env' in services['configurations'] and 'hive.atlas.hook' in services['configurations']['hive-env']['properties']: + enable_atlas_hook = services['configurations']['hive-env']['properties']['hive.atlas.hook'] == "true" if enable_atlas_hook: # Append atlas hook if not already present. @@ -852,14 +850,16 @@ class HDP23StackAdvisor(HDP22StackAdvisor): else: putSqoopEnvProperty("sqoop.atlas.hook", "false") - if ('sqoop-env' in services['configurations']) and ('sqoop.atlas.hook' in services['configurations']['sqoop-env']['properties']): - if 'sqoop-env' in configurations and 'sqoop.atlas.hook' in configurations['sqoop-env']['properties']: - enable_atlas_hook = configurations['sqoop-env']['properties']['sqoop.atlas.hook'] == "true" - elif 'sqoop-env' in services['configurations'] and 'sqoop.atlas.hook' in services['configurations']['sqoop-env']['properties']: - enable_atlas_hook = services['configurations']['sqoop-env']['properties']['sqoop.atlas.hook'] == "true" + if 'sqoop-env' in configurations and 'sqoop.atlas.hook' in configurations['sqoop-env']['properties']: + enable_atlas_hook = configurations['sqoop-env']['properties']['sqoop.atlas.hook'] == "true" + elif 'sqoop-env' in services['configurations'] and 'sqoop.atlas.hook' in services['configurations']['sqoop-env']['properties']: + enable_atlas_hook = services['configurations']['sqoop-env']['properties']['sqoop.atlas.hook'] == "true" if enable_atlas_hook: putSqoopSiteProperty('sqoop.job.data.publish.class', 'org.apache.atlas.sqoop.hook.SqoopHook') + else: + putSqoopSitePropertyAttribute = self.putPropertyAttribute(configurations, "sqoop-site") + putSqoopSitePropertyAttribute('sqoop.job.data.publish.class', 'delete', 'true') def recommendStormConfigurations(self, configurations, clusterData, services, hosts): super(HDP23StackAdvisor, self).recommendStormConfigurations(configurations, clusterData, services, hosts) @@ -887,11 +887,10 @@ class HDP23StackAdvisor(HDP22StackAdvisor): else: putStormEnvProperty("storm.atlas.hook", "false") - if ('storm-env' in services['configurations']) and ('storm.atlas.hook' in services['configurations']['storm-env']['properties']): - if 'storm-env' in configurations and 'storm.atlas.hook' in configurations['storm-env']['properties']: - enable_atlas_hook = configurations['storm-env']['properties']['storm.atlas.hook'] == "true" - elif 'storm-env' in services['configurations'] and 'storm.atlas.hook' in services['configurations']['storm-env']['properties']: - enable_atlas_hook = services['configurations']['storm-env']['properties']['storm.atlas.hook'] == "true" + if 'storm-env' in configurations and 'storm.atlas.hook' in configurations['storm-env']['properties']: + enable_atlas_hook = configurations['storm-env']['properties']['storm.atlas.hook'] == "true" + elif 'storm-env' in services['configurations'] and 'storm.atlas.hook' in services['configurations']['storm-env']['properties']: + enable_atlas_hook = services['configurations']['storm-env']['properties']['storm.atlas.hook'] == "true" if enable_atlas_hook and not atlas_hook_is_set: notifier_plugin_value = atlas_hook_class if notifier_plugin_value == " " else ",".join([notifier_plugin_value, atlas_hook_class])