ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject ambari git commit: AMBARI-16784. Remove 'org.apache.atlas.hive.hook.HiveHook' from Hive2/hive-site.xml config hive.exec.post.hooks as Atlas is not supported by Hive2.
Date Fri, 20 May 2016 18:50:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d818782d8 -> 2425189d7


AMBARI-16784. Remove 'org.apache.atlas.hive.hook.HiveHook' from Hive2/hive-site.xml config
hive.exec.post.hooks as Atlas is not supported by Hive2.


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

Branch: refs/heads/trunk
Commit: 2425189d76ffaf9f75faf596e1d86c3c84dc0e1e
Parents: d818782
Author: Swapan Shridhar <sshridhar@hortonworks.com>
Authored: Thu May 19 16:57:07 2016 -0700
Committer: Swapan Shridhar <sshridhar@hortonworks.com>
Committed: Fri May 20 11:18:25 2016 -0700

----------------------------------------------------------------------
 .../package/scripts/hive_interactive.py         | 25 ++++++++++++++++++++
 .../stacks/2.5/HIVE/test_hive_server_int.py     |  1 +
 .../python/stacks/2.5/configs/hsi_default.json  |  3 ++-
 3 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2425189d/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 8e49cf0..129dd80 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
@@ -95,6 +95,12 @@ def hive_interactive(name=None):
     if item in merged_hive_interactive_site.keys():
       del merged_hive_interactive_site[item]
 
+  '''
+  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)
+
   # Anything TODO for attributes
 
   # Merge tez-interactive with tez-site
@@ -217,3 +223,22 @@ def hive_interactive(name=None):
             owner=params.hive_user,
             group=params.user_group,
             mode=0755)
+
+"""
+Remove 'org.apache.atlas.hive.hook.HiveHook' value from Hive2/hive-site.xml config 'hive.exec.post.hooks',
if exists.
+"""
+def remove_atlas_hook_if_exists(merged_hive_interactive_site):
+  if 'hive.exec.post.hooks' in merged_hive_interactive_site.keys():
+    existing_hive_exec_post_hooks = merged_hive_interactive_site.get('hive.exec.post.hooks')
+    if existing_hive_exec_post_hooks:
+      hook_splits = existing_hive_exec_post_hooks.split(",")
+      updated_hook_splits = [hook for hook in hook_splits if not hook.strip() == 'org.apache.atlas.hive.hook.HiveHook']
+      updated_hooks_str = ",".join((str(hook)).strip() for hook in updated_hook_splits)
+      if updated_hooks_str != existing_hive_exec_post_hooks:
+        merged_hive_interactive_site['hive.exec.post.hooks'] = updated_hooks_str
+        Logger.info("Updated Hive2/hive-site.xml 'hive.exec.post.hooks' value from : '{0}'
to : '{1}'"
+                    .format(existing_hive_exec_post_hooks, updated_hooks_str))
+      else:
+        Logger.info("No change done to Hive2/hive-site.xml 'hive.exec.post.hooks' value.")
+  else:
+      Logger.debug("'hive.exec.post.hooks' doesn't exist in Hive2/hive-site.xml")

http://git-wip-us.apache.org/repos/asf/ambari/blob/2425189d/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index ee93f9e..348a17d 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -231,6 +231,7 @@ class TestHiveServerInteractive(RMFTestCase):
     hive_site_conf = {}
     hive_site_conf.update(self.getConfig()['configurations']['hive-site'])
     hive_site_conf.update(self.getConfig()['configurations']['hive-interactive-site'])
+    hive_site_conf['hive.exec.post.hooks'] = 'a,b,org.apache.hadoop.hive.ql.hooks.ATSHook'
     del hive_site_conf['hive.enforce.bucketing']
     del hive_site_conf['hive.enforce.sorting']
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2425189d/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 65ff8b3..5411c05 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
@@ -403,7 +403,8 @@
             "hive.server2.authentication": "NOSASL",
             "hive.server2.transport.mode": "binary",
             "hive.optimize.mapjoin.mapreduce": "true",
-            "hive.exec.scratchdir" : "/custompath/tmp/hive"
+            "hive.exec.scratchdir" : "/custompath/tmp/hive",
+            "hive.exec.post.hooks" : "a, org.apache.atlas.hive.hook.HiveHook,org.apache.atlas.hive.hook.HiveHook
, b , org.apache.atlas.hive.hook.HiveHook ,org.apache.hadoop.hive.ql.hooks.ATSHook"
         },
         "hive-interactive-env": {
           "content" : "con\ntent",


Mime
View raw message