ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)
Date Thu, 25 Feb 2016 17:17:10 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4d8bc0f63 -> 4c9c3c575
  refs/heads/trunk c82f1337e -> 0817b4d22


AMBARI-15157. Cannot change hive.metastore.warehouse.dir to S3 (aonishuk)


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

Branch: refs/heads/trunk
Commit: 0817b4d22b17f8b797fb509827ca3e93d190621c
Parents: c82f133
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Thu Feb 25 19:13:47 2016 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Thu Feb 25 19:13:47 2016 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive.py     | 20 ++++++++++++--------
 .../0.12.0.2.0/package/scripts/params_linux.py  |  3 +++
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0817b4d2/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 a141185..92e4ad7 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
@@ -177,14 +177,18 @@ def hive(name=None):
                      host_sys_prepped=params.host_sys_prepped)
     # ******* End Copy Tarballs *******
     # *********************************
-
-    # Create Hive Metastore Warehouse Dir
-    params.HdfsResource(params.hive_apps_whs_dir,
-                         type="directory",
-                          action="create_on_execute",
-                          owner=params.hive_user,
-                          mode=0777
-    )
+    
+    # if warehouse directory is in DFS
+    if not params.whs_dir_protocol or params.whs_dir_protocol == urlparse(params.default_fs).scheme:
+      # Create Hive Metastore Warehouse Dir
+      params.HdfsResource(params.hive_apps_whs_dir,
+                           type="directory",
+                            action="create_on_execute",
+                            owner=params.hive_user,
+                            mode=0777
+      )
+    else:
+      Logger.info(format("Not creating warehouse directory '{hive_apps_whs_dir}', as the
location is not in DFS."))
 
     # Create Hive User Dir
     params.HdfsResource(params.hive_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/0817b4d2/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index e9500d9..caaa9f3 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -22,6 +22,8 @@ import status_params
 import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json
module and has the same functions set.
 import os
 
+from urlparse import urlparse
+
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 from ambari_commons.os_check import OSCheck
 
@@ -357,6 +359,7 @@ hive_env_sh_template = config['configurations']['hive-env']['content']
 hive_hdfs_user_dir = format("/user/{hive_user}")
 hive_hdfs_user_mode = 0755
 hive_apps_whs_dir = config['configurations']['hive-site']["hive.metastore.warehouse.dir"]
+whs_dir_protocol = urlparse(hive_apps_whs_dir).scheme
 hive_exec_scratchdir = config['configurations']['hive-site']["hive.exec.scratchdir"]
 #for create_hdfs_directory
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']


Mime
View raw message