ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-6142. Restarting Hive MetaStore clears Hive client's stale config indicator (aonishuk)
Date Fri, 05 Sep 2014 18:37:43 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c8ba5e970 -> 1ef1fe475


AMBARI-6142. Restarting Hive MetaStore clears Hive client's stale config indicator (aonishuk)


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

Branch: refs/heads/trunk
Commit: 1ef1fe47569c2fb3123db34760c2474da130ce43
Parents: c8ba5e9
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Sep 5 21:37:35 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Sep 5 21:37:35 2014 +0300

----------------------------------------------------------------------
 .../1.3.2/services/HIVE/package/scripts/hive.py | 31 +++++++++---
 .../2.0.6/services/HIVE/package/scripts/hive.py | 42 ++++++++++++----
 .../stacks/1.3.2/HIVE/test_hive_client.py       | 36 ++++++++++++++
 .../stacks/1.3.2/HIVE/test_hive_metastore.py    | 36 ++++++++++++++
 .../stacks/1.3.2/HIVE/test_hive_server.py       | 36 ++++++++++++++
 .../stacks/2.0.6/HIVE/test_hive_client.py       | 52 ++++++++++++++++++++
 .../stacks/2.0.6/HIVE/test_hive_metastore.py    | 52 ++++++++++++++++++++
 .../stacks/2.0.6/HIVE/test_hive_server.py       | 52 ++++++++++++++++++++
 .../stacks/2.1/HIVE/test_hive_metastore.py      | 52 ++++++++++++++++++++
 9 files changed, 373 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
index 163304d..3894ddc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
@@ -40,24 +40,35 @@ def hive(name=None):
     )
     params.HdfsDirectory(None, action="create")
   if name == 'metastore' or name == 'hiveserver2':
-    config_file_mode = 0600
     jdbc_connector()
-  else:
-    config_file_mode = 0644
 
-  Directory(params.hive_config_dir,
+  Directory(params.hive_conf_dir,
             owner=params.hive_user,
             group=params.user_group,
             recursive=True
   )
+  Directory(params.hive_server_conf_dir,
+            owner=params.hive_user,
+            group=params.user_group,
+            recursive=True
+  )
+
+  XmlConfig("hive-site.xml",
+            conf_dir=params.hive_conf_dir,
+            configurations=params.config['configurations']['hive-site'],
+            configuration_attributes=params.config['configuration_attributes']['hive-site'],
+            owner=params.hive_user,
+            group=params.user_group,
+            mode=0644
+  )
 
   XmlConfig("hive-site.xml",
-            conf_dir=params.hive_config_dir,
+            conf_dir=params.hive_server_conf_dir,
             configurations=params.config['configurations']['hive-site'],
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=config_file_mode
+            mode=0600
   )
 
   environment = {
@@ -90,7 +101,13 @@ def hive(name=None):
     crt_directory(params.hive_log_dir)
     crt_directory(params.hive_var_lib)
 
-  File(format("{hive_config_dir}/hive-env.sh"),
+  File(format("{hive_conf_dir}/hive-env.sh"),
+       owner=params.hive_user,
+       group=params.user_group,
+       content=InlineTemplate(params.hive_env_sh_template)
+  )
+
+  File(format("{hive_server_conf_dir}/hive-env.sh"),
        owner=params.hive_user,
        group=params.user_group,
        content=InlineTemplate(params.hive_env_sh_template)

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
index b0dc1f0..690aa76 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
@@ -40,32 +40,50 @@ def hive(name=None):
     )
     params.HdfsDirectory(None, action="create")
   if name == 'metastore' or name == 'hiveserver2':
-    config_file_mode = 0600
     jdbc_connector()
-  else:
-    config_file_mode = 0644
 
-  Directory(params.hive_config_dir,
+  Directory(params.hive_conf_dir,
+            owner=params.hive_user,
+            group=params.user_group,
+            recursive=True
+  )
+  Directory(params.hive_server_conf_dir,
             owner=params.hive_user,
             group=params.user_group,
             recursive=True
   )
 
   XmlConfig("mapred-site.xml",
-            conf_dir=params.hive_config_dir,
+            conf_dir=params.hive_conf_dir,
             configurations=params.config['configurations']['mapred-site'],
             configuration_attributes=params.config['configuration_attributes']['mapred-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=config_file_mode)
+            mode=0644)
 
   XmlConfig("hive-site.xml",
-            conf_dir=params.hive_config_dir,
+            conf_dir=params.hive_conf_dir,
             configurations=params.config['configurations']['hive-site'],
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=config_file_mode)
+            mode=0644)
+
+  XmlConfig("mapred-site.xml",
+            conf_dir=params.hive_server_conf_dir,
+            configurations=params.config['configurations']['mapred-site'],
+            configuration_attributes=params.config['configuration_attributes']['mapred-site'],
+            owner=params.hive_user,
+            group=params.user_group,
+            mode=0600)
+
+  XmlConfig("hive-site.xml",
+            conf_dir=params.hive_server_conf_dir,
+            configurations=params.config['configurations']['hive-site'],
+            configuration_attributes=params.config['configuration_attributes']['hive-site'],
+            owner=params.hive_user,
+            group=params.user_group,
+            mode=0600)
 
   environment = {
     "no_proxy": format("{ambari_server_hostname}")
@@ -80,7 +98,13 @@ def hive(name=None):
           not_if=format("[ -f {check_db_connection_jar_name}]"),
           environment = environment)
 
-  File(format("{hive_config_dir}/hive-env.sh"),
+  File(format("{hive_conf_dir}/hive-env.sh"),
+       owner=params.hive_user,
+       group=params.user_group,
+       content=InlineTemplate(params.hive_env_sh_template)
+  )
+
+  File(format("{hive_server_conf_dir}/hive-env.sh"),
        owner=params.hive_user,
        group=params.user_group,
        content=InlineTemplate(params.hive_env_sh_template)

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py
index e6736e4..13b6772 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py
@@ -33,6 +33,11 @@ class TestHiveClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf.server',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
@@ -41,6 +46,14 @@ class TestHiveClient(RMFTestCase):
       configurations = self.getConfig()['configurations']['hive-site'],
       configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
     )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
     self.assertResourceCalled('Execute', "/bin/sh -c 'cd /usr/lib/ambari-agent/ &&
curl -kf -x \"\" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar
-o DBConnectionVerification.jar'",
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
@@ -50,6 +63,11 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
+    self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-default.xml.template',
       owner = 'hive',
       group = 'hadoop',
@@ -87,6 +105,11 @@ class TestHiveClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf.server',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
@@ -95,6 +118,14 @@ class TestHiveClient(RMFTestCase):
       configurations = self.getConfig()['configurations']['hive-site'],
       configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
     )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
     self.assertResourceCalled('Execute', "/bin/sh -c 'cd /usr/lib/ambari-agent/ &&
curl -kf -x \"\" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar
-o DBConnectionVerification.jar'",
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
@@ -104,6 +135,11 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
+    self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-default.xml.template',
       owner = 'hive',
       group = 'hadoop',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
index d5fd8aa..125aa9e 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
@@ -164,6 +164,11 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
@@ -172,6 +177,14 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
+      mode = 0644,
+      conf_dir = '/etc/hive/conf',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
       mode = 0600,
       conf_dir = '/etc/hive/conf.server',
       configurations = self.getConfig()['configurations']['hive-site'],
@@ -203,6 +216,11 @@ class TestHiveMetastore(RMFTestCase):
       mode = 0755,
       recursive = True,
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
@@ -223,6 +241,11 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
@@ -231,6 +254,14 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
+      mode = 0644,
+      conf_dir = '/etc/hive/conf',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
       mode = 0600,
       conf_dir = '/etc/hive/conf.server',
       configurations = self.getConfig()['configurations']['hive-site'],
@@ -262,6 +293,11 @@ class TestHiveMetastore(RMFTestCase):
       mode = 0755,
       recursive = True,
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
index 0388cc6..ee00bf9 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
@@ -210,12 +210,25 @@ class TestHiveServer(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -249,6 +262,11 @@ class TestHiveServer(RMFTestCase):
       mode = 0755,
       recursive = True,
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
@@ -297,12 +315,25 @@ class TestHiveServer(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -336,6 +367,11 @@ class TestHiveServer(RMFTestCase):
       mode = 0755,
       recursive = True,
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
index 091e049..3ad5d86 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
@@ -34,6 +34,11 @@ class TestHiveClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf.server',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
@@ -50,6 +55,22 @@ class TestHiveClient(RMFTestCase):
       configurations = self.getConfig()['configurations']['hive-site'],
       configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
     )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['mapred-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
     self.assertResourceCalled('Execute', "/bin/sh -c 'cd /usr/lib/ambari-agent/ &&
curl -kf -x \"\" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar
-o DBConnectionVerification.jar'",
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
@@ -59,6 +80,11 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
+    self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-default.xml.template',
       owner = 'hive',
       group = 'hadoop',
@@ -97,6 +123,11 @@ class TestHiveClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf.server',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
@@ -113,6 +144,22 @@ class TestHiveClient(RMFTestCase):
       configurations = self.getConfig()['configurations']['hive-site'],
       configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
     )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['mapred-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0600,
+      conf_dir = '/etc/hive/conf.server',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
     self.assertResourceCalled('Execute', "/bin/sh -c 'cd /usr/lib/ambari-agent/ &&
curl -kf -x \"\" --retry 5 http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar
-o DBConnectionVerification.jar'",
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
@@ -122,6 +169,11 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
+    self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-default.xml.template',
       owner = 'hive',
       group = 'hadoop',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index 742a3e2..dc76e57 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -149,12 +149,33 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['mapred-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -174,6 +195,11 @@ class TestHiveMetastore(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
@@ -216,12 +242,33 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['mapred-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -241,6 +288,11 @@ class TestHiveMetastore(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index 53f744d..214d902 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -262,12 +262,33 @@ class TestHiveServer(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['mapred-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -287,6 +308,11 @@ class TestHiveServer(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
@@ -358,12 +384,33 @@ class TestHiveServer(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              recursive = True,
+                              )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['mapred-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              mode = 0644,
+                              conf_dir = '/etc/hive/conf',
+                              configurations = self.getConfig()['configurations']['hive-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -383,6 +430,11 @@ class TestHiveServer(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+                              owner = 'hive',
+                              group = 'hadoop',
+                              )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef1fe47/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
index 9bcf7df..dff7c32 100644
--- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
@@ -109,12 +109,33 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
       recursive = True,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+      owner='hive',
+      group='hadoop',
+      mode=0644,
+      conf_dir='/etc/hive/conf',
+      configurations=self.getConfig()['configurations']['mapred-site'],
+      configuration_attributes=self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0644,
+      conf_dir = '/etc/hive/conf',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
       mode = 0600,
@@ -134,6 +155,11 @@ class TestHiveMetastore(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'},
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
@@ -179,6 +205,11 @@ class TestHiveMetastore(RMFTestCase):
       path = ['/bin', '/usr/bin/'],
       not_if = 'test -f /usr/lib/hive/lib//mysql-connector-java.jar',
     )
+    self.assertResourceCalled('Directory', '/etc/hive/conf',
+      owner = 'hive',
+      group = 'hadoop',
+      recursive = True,
+    )
     self.assertResourceCalled('Directory', '/etc/hive/conf.server',
       owner = 'hive',
       group = 'hadoop',
@@ -187,6 +218,22 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
       owner = 'hive',
       group = 'hadoop',
+      mode = 0644,
+      conf_dir = '/etc/hive/conf',
+      configurations = self.getConfig()['configurations']['mapred-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['mapred-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'hive-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
+      mode = 0644,
+      conf_dir = '/etc/hive/conf',
+      configurations = self.getConfig()['configurations']['hive-site'],
+      configuration_attributes = self.getConfig()['configuration_attributes']['hive-site']
+    )
+    self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
+      owner = 'hive',
+      group = 'hadoop',
       mode = 0600,
       conf_dir = '/etc/hive/conf.server',
       configurations = self.getConfig()['configurations']['mapred-site'],
@@ -204,6 +251,11 @@ class TestHiveMetastore(RMFTestCase):
       not_if = '[ -f DBConnectionVerification.jar]',
       environment = {'no_proxy': 'c6401.ambari.apache.org'},
     )
+    self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
+      owner = 'hive',
+      group = 'hadoop',
+    )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
       content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',


Mime
View raw message