ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smn...@apache.org
Subject ambari git commit: AMBARI-16281: Config files for hive interactive should be in both conf and conf.server folder
Date Tue, 10 May 2016 01:03:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d3bac3a1d -> 05895dd43


AMBARI-16281: Config files for hive interactive should be in both conf and conf.server folder


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

Branch: refs/heads/trunk
Commit: 05895dd43f1f658ab536a009a91c7d1e39e75154
Parents: d3bac3a
Author: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Authored: Thu May 5 15:18:54 2016 -0700
Committer: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Committed: Mon May 9 17:17:58 2016 -0700

----------------------------------------------------------------------
 .../package/scripts/hive_interactive.py         | 126 ++++++++++---------
 .../stacks/2.5/HIVE/test_hive_server_int.py     | 107 ++++++++--------
 2 files changed, 116 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/05895dd4/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 da3b39d..901b276 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
@@ -98,70 +98,74 @@ def hive_interactive(name=None):
 
   # Anything TODO for attributes
 
-  XmlConfig("hive-site.xml",
-            conf_dir=params.hive_server_interactive_conf_dir,
-            configurations=merged_hive_interactive_site,
-            configuration_attributes=params.config['configuration_attributes']['hive-interactive-site'],
-            owner=params.hive_user,
-            group=params.user_group,
-            mode=0644)
-
-  XmlConfig("hive-site.xml",
-            conf_dir=os.path.dirname(params.hive_server_interactive_conf_dir),
-            configurations=merged_hive_interactive_site,
-            configuration_attributes=params.config['configuration_attributes']['hive-interactive-site'],
-            owner=params.hive_user,
-            group=params.user_group,
-            mode=0644)
-
   # Merge tez-interactive with tez-site
   XmlConfig("tez-site.xml",
-             conf_dir = params.tez_interactive_config_dir,
-             configurations = params.config['configurations']['tez-interactive-site'],
-             configuration_attributes=params.config['configuration_attributes']['tez-interactive-site'],
-             owner = params.tez_interactive_user,
-             group = params.user_group,
-             mode = 0664)
-
-  File(format("{hive_server_interactive_conf_dir}/hive-env.sh"),
-       owner=params.hive_user,
-       group=params.user_group,
-       content=InlineTemplate(params.hive_interactive_env_sh_template))
-
-  llap_daemon_log4j_filename = 'llap-daemon-log4j2.properties'
-  File(format("{hive_server_interactive_conf_dir}/{llap_daemon_log4j_filename}"),
-       mode=0644,
-       group=params.user_group,
-       owner=params.hive_user,
-       content=params.llap_daemon_log4j)
+            conf_dir = params.tez_interactive_config_dir,
+            configurations = params.config['configurations']['tez-interactive-site'],
+            configuration_attributes=params.config['configuration_attributes']['tez-interactive-site'],
+            owner = params.tez_interactive_user,
+            group = params.user_group,
+            mode = 0664)
+
+  # Create config files under /etc/hive2/conf and /etc/hive2/conf/conf.server:
+  #   hive-site.xml
+  #   hive-env.sh
+  #   llap-daemon-log4j2.properties
+  #   llap-cli-log4j2.properties
+  #   hive-log4j2.properties
+  #   hive-exec-log4j2.properties
+  #   beeline-log4j2.properties
 
-  llap_cli_log4j2_filename = 'llap-cli-log4j2.properties'
-  File(format("{hive_server_interactive_conf_dir}/{llap_cli_log4j2_filename}"),
-       mode=0644,
-       group=params.user_group,
-       owner=params.hive_user,
-       content=params.llap_cli_log4j2)
-
-  hive_log4j2_filename = 'hive-log4j2.properties'
-  File(format("{hive_server_interactive_conf_dir}/{hive_log4j2_filename}"),
-     mode=0644,
-     group=params.user_group,
-     owner=params.hive_user,
-     content=params.hive_log4j2)
-
-  hive_exec_log4j2_filename = 'hive-exec-log4j2.properties'
-  File(format("{hive_server_interactive_conf_dir}/{hive_exec_log4j2_filename}"),
-     mode=0644,
-     group=params.user_group,
-     owner=params.hive_user,
-     content=params.hive_exec_log4j2)
-
-  beeline_log4j2_filename = 'beeline-log4j2.properties'
-  File(format("{hive_server_interactive_conf_dir}/{beeline_log4j2_filename}"),
-     mode=0644,
-     group=params.user_group,
-     owner=params.hive_user,
-     content=params.beeline_log4j2)
+  for conf_dir in params.hive_conf_dirs_list:
+      XmlConfig("hive-site.xml",
+                conf_dir=conf_dir,
+                configurations=merged_hive_interactive_site,
+                configuration_attributes=params.config['configuration_attributes']['hive-interactive-site'],
+                owner=params.hive_user,
+                group=params.user_group,
+                mode=0644)
+
+      hive_server_interactive_conf_dir = conf_dir
+
+      File(format("{hive_server_interactive_conf_dir}/hive-env.sh"),
+           owner=params.hive_user,
+           group=params.user_group,
+           content=InlineTemplate(params.hive_interactive_env_sh_template))
+
+      llap_daemon_log4j_filename = 'llap-daemon-log4j2.properties'
+      File(format("{hive_server_interactive_conf_dir}/{llap_daemon_log4j_filename}"),
+           mode=0644,
+           group=params.user_group,
+           owner=params.hive_user,
+           content=params.llap_daemon_log4j)
+
+      llap_cli_log4j2_filename = 'llap-cli-log4j2.properties'
+      File(format("{hive_server_interactive_conf_dir}/{llap_cli_log4j2_filename}"),
+           mode=0644,
+           group=params.user_group,
+           owner=params.hive_user,
+           content=params.llap_cli_log4j2)
+
+      hive_log4j2_filename = 'hive-log4j2.properties'
+      File(format("{hive_server_interactive_conf_dir}/{hive_log4j2_filename}"),
+         mode=0644,
+         group=params.user_group,
+         owner=params.hive_user,
+         content=params.hive_log4j2)
+
+      hive_exec_log4j2_filename = 'hive-exec-log4j2.properties'
+      File(format("{hive_server_interactive_conf_dir}/{hive_exec_log4j2_filename}"),
+         mode=0644,
+         group=params.user_group,
+         owner=params.hive_user,
+         content=params.hive_exec_log4j2)
+
+      beeline_log4j2_filename = 'beeline-log4j2.properties'
+      File(format("{hive_server_interactive_conf_dir}/{beeline_log4j2_filename}"),
+         mode=0644,
+         group=params.user_group,
+         owner=params.hive_user,
+         content=params.beeline_log4j2)
 
   # On some OS this folder could be not exists, so we will create it before pushing there
files
   Directory(params.limits_conf_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/05895dd4/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 e2bd0c2..4cc9c1f 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
@@ -203,27 +203,6 @@ class TestHiveServerInteractive(RMFTestCase):
     self.assertResourceCalled("File", "/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-env.sh.template",
                               owner=u"hive",
                               group=u"hadoop")
-
-    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
-                              group='hadoop',
-                              conf_dir='/usr/hdp/current/hive-server2-hive2/conf/conf.server',
-                              mode=0644,
-                              configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge':
u'true',
-                                                                   u'javax.jdo.option.ConnectionDriverName':
u'true',
-                                                                   u'javax.jdo.option.ConnectionPassword':
u'true'}},
-                              owner='hive',
-                              configurations=hive_site_conf,
-    )
-    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
-                              group='hadoop',
-                              conf_dir='/usr/hdp/current/hive-server2-hive2/conf',
-                              mode=0644,
-                              configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge':
u'true',
-                                                                   u'javax.jdo.option.ConnectionDriverName':
u'true',
-                                                                   u'javax.jdo.option.ConnectionPassword':
u'true'}},
-                              owner='hive',
-                              configurations=hive_site_conf,
-    )
     self.assertResourceCalled('XmlConfig', 'tez-site.xml',
                               group='hadoop',
                               conf_dir='/etc/tez_hive2/conf',
@@ -231,42 +210,58 @@ class TestHiveServerInteractive(RMFTestCase):
                               configuration_attributes=UnknownConfigurationMock(),
                               owner='tez',
                               configurations=self.getConfig()['configurations']['tez-interactive-site'],
-                              )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-env.sh',
-                              content=InlineTemplate(self.getConfig()['configurations']['hive-interactive-env']['content']),
-                              owner='hive',
-                              group='hadoop',
-    )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/llap-daemon-log4j2.properties',
-                              content='con\ntent',
-                              owner='hive',
-                              group='hadoop',
-                              mode=0644,
-    )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/llap-cli-log4j2.properties',
-                              content='con\ntent',
-                              owner='hive',
-                              group='hadoop',
-                              mode=0644,
-    )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-log4j2.properties',
-                              content='con\ntent',  # Test new line
-                              owner='hive',
-                              group='hadoop',
-                              mode=0644,
-    )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-exec-log4j2.properties',
-                              content='con\ntent',  # Test new line
-                              owner='hive',
-                              group='hadoop',
-                              mode=0644,
-    )
-    self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/conf.server/beeline-log4j2.properties',
-                              content='con\ntent',  # Test new line
-                              owner='hive',
-                              group='hadoop',
-                              mode=0644,
     )
+    # Verify that config files got created under /etc/hive2/conf and /etc/hive2/conf/conf.server
+    hive_conf_dirs_list = ['/usr/hdp/current/hive-server2-hive2/conf', '/usr/hdp/current/hive-server2-hive2/conf/conf.server']
+
+    for conf_dir in hive_conf_dirs_list:
+        self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                                  group='hadoop',
+                                  conf_dir=conf_dir,
+                                  mode=0644,
+                                  configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge':
u'true',
+                                                                       u'javax.jdo.option.ConnectionDriverName':
u'true',
+                                                                       u'javax.jdo.option.ConnectionPassword':
u'true'}},
+                                  owner='hive',
+                                  configurations=hive_site_conf,
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-env.sh'),
+                                  content=InlineTemplate(self.getConfig()['configurations']['hive-interactive-env']['content']),
+                                  owner='hive',
+                                  group='hadoop',
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-daemon-log4j2.properties'),
+                                  content='con\ntent',
+                                  owner='hive',
+                                  group='hadoop',
+                                  mode=0644,
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-cli-log4j2.properties'),
+                                  content='con\ntent',
+                                  owner='hive',
+                                  group='hadoop',
+                                  mode=0644,
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-log4j2.properties'),
+                                  content='con\ntent',  # Test new line
+                                  owner='hive',
+                                  group='hadoop',
+                                  mode=0644,
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
+                                  content='con\ntent',  # Test new line
+                                  owner='hive',
+                                  group='hadoop',
+                                  mode=0644,
+        )
+        self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
+                                  content='con\ntent',  # Test new line
+                                  owner='hive',
+                                  group='hadoop',
+                                  mode=0644,
+        )
+        pass
+
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner='root',
                               group='root',


Mime
View raw message