You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/08/29 11:55:30 UTC

ambari git commit: AMBARI-12913. Hive metastore or server will fail, if there is some time delay between their start.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 504b00b83 -> 8afe0fc5d


AMBARI-12913. Hive metastore or server will fail, if there is some time delay between their start.(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: 8afe0fc5d0ee96b8454c4e3c2f3925b13756146d
Parents: 504b00b
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Sat Aug 29 12:50:36 2015 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Sat Aug 29 12:50:36 2015 +0300

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive.py     |  2 +-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py    | 35 ++++++++++----------
 .../stacks/2.0.6/HIVE/test_hive_server.py       |  2 +-
 3 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8afe0fc5/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 3bb8f4d..f10cca1 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -246,7 +246,7 @@ def hive(name=None):
        content=Template("hive.conf.j2")
        )
 
-  if name == 'metastore' or name == 'hiveserver2':
+  if (name == 'metastore' or name == 'hiveserver2') and not os.path.exists(params.target):
     jdbc_connector()
 
   File(format("/usr/lib/ambari-agent/{check_db_connection_jar_name}"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/8afe0fc5/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 5fd531a..3e90eb5 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -310,27 +310,28 @@ def download_database_library_if_needed(target_directory = None):
     # create the full path using the supplied target directory and the JDBC JAR
     target_jar_with_directory = target_directory + os.path.sep + params.jdbc_driver_jar
 
-  File(params.downloaded_custom_connector,
-    content = DownloadSource(params.driver_curl_source))
+  if not os.path.exists(target_jar_with_directory):
+    File(params.downloaded_custom_connector,
+      content = DownloadSource(params.driver_curl_source))
 
-  if params.sqla_db_used:
-    untar_sqla_type2_driver = ('tar', '-xvf', params.downloaded_custom_connector, '-C', params.tmp_dir)
+    if params.sqla_db_used:
+      untar_sqla_type2_driver = ('tar', '-xvf', params.downloaded_custom_connector, '-C', params.tmp_dir)
 
-    Execute(untar_sqla_type2_driver, sudo = True)
+      Execute(untar_sqla_type2_driver, sudo = True)
 
-    Execute(as_sudo(['yes', '|', 'cp', params.jars_path_in_archive, params.oozie_libext_dir], auto_escape=False),
-            path=["/bin", "/usr/bin/"])
+      Execute(as_sudo(['yes', '|', 'cp', params.jars_path_in_archive, params.oozie_libext_dir], auto_escape=False),
+              path=["/bin", "/usr/bin/"])
 
-    Directory(params.jdbc_libs_dir,
-              recursive=True)
+      Directory(params.jdbc_libs_dir,
+                recursive=True)
 
-    Execute(as_sudo(['yes', '|', 'cp', params.libs_path_in_archive, params.jdbc_libs_dir], auto_escape=False),
-            path=["/bin", "/usr/bin/"])
+      Execute(as_sudo(['yes', '|', 'cp', params.libs_path_in_archive, params.jdbc_libs_dir], auto_escape=False),
+              path=["/bin", "/usr/bin/"])
 
-  else:
-    Execute(('cp', '--remove-destination', params.downloaded_custom_connector, target_jar_with_directory),
-      path=["/bin", "/usr/bin/"],
-      sudo = True)
+    else:
+      Execute(('cp', '--remove-destination', params.downloaded_custom_connector, target_jar_with_directory),
+        path=["/bin", "/usr/bin/"],
+        sudo = True)
 
-  File(target_jar_with_directory, owner = params.oozie_user,
-    group = params.user_group)
+    File(target_jar_with_directory, owner = params.oozie_user,
+      group = params.user_group)

http://git-wip-us.apache.org/repos/asf/ambari/blob/8afe0fc5/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 7ca3d78..42477dd 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
@@ -694,7 +694,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b"""
     )
 
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,)
-    self.assertResourceCalledByIndex(33, 'Execute', 'hive --config /usr/hdp/current/hive-server2/conf/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434',
+    self.assertResourceCalledByIndex(31, 'Execute', 'hive --config /usr/hdp/current/hive-server2/conf/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434',
       path=['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/hadoop-client/bin'],
       tries=1, user='hive')