You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/11/26 14:16:10 UTC

[2/2] ambari git commit: AMBARI-14087. Spark Thrift Server shutdown after start with umask 027 (aonishuk)

AMBARI-14087. Spark Thrift Server shutdown after start with umask 027 (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: a5b90007ef80a7310549a232cef3744a5f8903c6
Parents: f4b86a5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Nov 26 15:16:05 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Nov 26 15:16:05 2015 +0200

----------------------------------------------------------------------
 .../common-services/SPARK/1.2.0.2.2/package/scripts/params.py  | 3 +++
 .../SPARK/1.2.0.2.2/package/scripts/setup_spark.py             | 5 ++---
 .../test/python/stacks/2.3/SPARK/test_spark_thrift_server.py   | 1 +
 .../src/test/python/stacks/2.3/configs/spark_default.json      | 6 ++++--
 4 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b90007/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
index 35f6e08..18a0052 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
@@ -122,6 +122,9 @@ kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executab
 spark_kerberos_keytab =  config['configurations']['spark-defaults']['spark.history.kerberos.keytab']
 spark_kerberos_principal =  config['configurations']['spark-defaults']['spark.history.kerberos.principal']
 
+spark_thriftserver_hosts = default("/clusterHostInfo/spark_thriftserver_hosts", [])
+has_spark_thriftserver = not len(spark_thriftserver_hosts) == 0
+
 # hive-site params
 spark_hive_properties = {
   'hive.metastore.uris': config['configurations']['hive-site']['hive.metastore.uris']

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b90007/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py
index 945bd63..b0ca499 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py
@@ -82,10 +82,9 @@ def setup_spark(env, type, action = None):
           group=params.spark_group,
           mode=0644)
 
-  # thrift server is not supported until HDP 2.3 or higher
-  if params.version and compare_versions(format_hdp_stack_version(params.version), '2.3.0.0') >= 0 \
-      and 'spark-thrift-sparkconf' in params.config['configurations']:
+  if params.has_spark_thriftserver:
     PropertiesFile(params.spark_thrift_server_conf_file,
       properties = params.config['configurations']['spark-thrift-sparkconf'],
+      owner = params.hive_user,
       key_value_delimiter = " ",
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b90007/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
index fc85f46..df1e382 100644
--- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
@@ -140,6 +140,7 @@ class TestSparkThriftServer(RMFTestCase):
     )
     self.assertResourceCalled('PropertiesFile', '/usr/hdp/current/spark-client/conf/spark-thrift-sparkconf.conf',
         key_value_delimiter = ' ',
+        owner = 'hive',
         properties = self.getConfig()['configurations']['spark-thrift-sparkconf']
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b90007/ambari-server/src/test/python/stacks/2.3/configs/spark_default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/configs/spark_default.json b/ambari-server/src/test/python/stacks/2.3/configs/spark_default.json
index 84cd31f..05e5ed8 100644
--- a/ambari-server/src/test/python/stacks/2.3/configs/spark_default.json
+++ b/ambari-server/src/test/python/stacks/2.3/configs/spark_default.json
@@ -485,7 +485,9 @@
       ],
        "zookeeper_hosts": [
          "c6401.ambari.apache.org"
-        ]
-
+      ],
+      "spark_thriftserver_hosts": [
+         "c6401.ambari.apache.org"
+      ]
 }
 }