You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2016/02/19 14:26:18 UTC

[01/21] ambari git commit: AMBARI-15087. Add log level for check database logs.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade 418745d12 -> 4b5a250e7


AMBARI-15087. Add log level for check database logs.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b57749da6dc77e7d1c6340d515ea08a6a4ea4722
Parents: a35b3c6
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Tue Feb 16 14:15:47 2016 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Tue Feb 16 14:15:47 2016 +0200

----------------------------------------------------------------------
 ambari-server/conf/unix/log4j.properties     | 2 +-
 ambari-server/conf/windows/log4j.properties  | 2 +-
 ambari-server/src/main/conf/log4j.properties | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b57749da/ambari-server/conf/unix/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/log4j.properties b/ambari-server/conf/unix/log4j.properties
index 18ec33e..0ccab22 100644
--- a/ambari-server/conf/unix/log4j.properties
+++ b/ambari-server/conf/unix/log4j.properties
@@ -57,7 +57,7 @@ log4j.additivity.org.apache.ambari.server.checks.CheckDatabaseHelper=false
 log4j.appender.dbcheck=org.apache.log4j.FileAppender
 log4j.appender.dbcheck.File=${ambari.log.dir}/${ambari.dbcheck.file}
 log4j.appender.dbcheck.layout=org.apache.log4j.PatternLayout
-log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %m%n
+log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %5p - %m%n
 
 # EclipsLink -> slf4j bridge
 log4j.logger.eclipselink=TRACE,eclipselink

http://git-wip-us.apache.org/repos/asf/ambari/blob/b57749da/ambari-server/conf/windows/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/windows/log4j.properties b/ambari-server/conf/windows/log4j.properties
index 09505cf..cc40f74 100644
--- a/ambari-server/conf/windows/log4j.properties
+++ b/ambari-server/conf/windows/log4j.properties
@@ -83,7 +83,7 @@ log4j.additivity.org.apache.ambari.server.checks.CheckDatabaseHelper=false
 log4j.appender.dbcheck=org.apache.log4j.FileAppender
 log4j.appender.dbcheck.File=${ambari.log.dir}/${ambari.dbcheck.file}
 log4j.appender.dbcheck.layout=org.apache.log4j.PatternLayout
-log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %m%n
+log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %5p - %m%n
 
 # EclipsLink -> slf4j bridge
 log4j.logger.eclipselink=TRACE,eclipselink

http://git-wip-us.apache.org/repos/asf/ambari/blob/b57749da/ambari-server/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/conf/log4j.properties b/ambari-server/src/main/conf/log4j.properties
index 1211fe3..8e6652d 100644
--- a/ambari-server/src/main/conf/log4j.properties
+++ b/ambari-server/src/main/conf/log4j.properties
@@ -83,7 +83,7 @@ log4j.additivity.org.apache.ambari.server.checks.CheckDatabaseHelper=false
 log4j.appender.dbcheck=org.apache.log4j.FileAppender
 log4j.appender.dbcheck.File=${ambari.log.dir}/${ambari.dbcheck.file}
 log4j.appender.dbcheck.layout=org.apache.log4j.PatternLayout
-log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %m%n
+log4j.appender.dbcheck.layout.ConversionPattern=%d{ISO8601} %5p - %m%n
 
 # EclipsLink -> slf4j bridge
 log4j.logger.eclipselink=TRACE,eclipselink


[09/21] ambari git commit: AMBARI-15082: HAWQ fails to install (mithmatt via jaoki)

Posted by dm...@apache.org.
AMBARI-15082: HAWQ fails to install (mithmatt via jaoki)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7da4706a33a03ce38739b5d5f0c11c4b2fc4bb94
Parents: 1d7af0e
Author: Jun Aoki <ja...@apache.org>
Authored: Thu Feb 18 10:55:42 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Thu Feb 18 10:55:42 2016 -0800

----------------------------------------------------------------------
 .../common-services/HAWQ/2.0.0/package/scripts/common.py    | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7da4706a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
index b5353e8..00349d8 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
@@ -67,18 +67,15 @@ def setup_common_configurations():
   """
   import params
 
-  # Write hdfs-client.xml on the local filesystem. If hdfs HA is enabled, append related parameters
-  params.XmlConfig(filename="hdfs-client.xml",
+  params.XmlConfig("hdfs-client.xml",
                    configurations=params.hdfs_client,
                    configuration_attributes=params.config_attrs['hdfs-client'])
 
-  # Write yarn-client.xml on the local filesystem. If yarn HA is enabled, append related parameters
-  params.XmlConfig(filename="yarn-client.xml",
+  params.XmlConfig("yarn-client.xml",
                    configurations=params.yarn_client,
                    configuration_attributes=params.config_attrs['yarn-client'])
 
-  # Write hawq-site.xml on the local filesystem.
-  params.XmlConfig(filename="hawq-site.xml",
+  params.XmlConfig("hawq-site.xml",
                    configurations=params.hawq_site,
                    configuration_attributes=params.config_attrs['hawq-site'])
   __set_osparams()


[06/21] ambari git commit: AMBARI-14921 - Atlas Integration : Support Atlas / Sqoop integration

Posted by dm...@apache.org.
AMBARI-14921 - Atlas Integration : Support Atlas / Sqoop integration


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 260419bb848ce962bbc238379221096eb2a31a58
Parents: 0a9101e
Author: tbeerbower <tb...@hortonworks.com>
Authored: Thu Feb 18 11:22:03 2016 -0500
Committer: tbeerbower <tb...@hortonworks.com>
Committed: Thu Feb 18 12:15:55 2016 -0500

----------------------------------------------------------------------
 .../1.4.4.2.0/configuration/sqoop-site.xml      | 43 ++++++++++++++++++++
 .../SQOOP/1.4.4.2.0/metainfo.xml                |  6 +++
 .../1.4.4.2.0/package/scripts/params_linux.py   | 20 ++++++++-
 .../SQOOP/1.4.4.2.0/package/scripts/sqoop.py    | 26 ++++++++++++
 .../python/stacks/2.0.6/SQOOP/test_sqoop.py     | 12 ++++++
 .../python/stacks/2.0.6/configs/default.json    |  5 +++
 .../python/stacks/2.0.6/configs/secured.json    |  5 +++
 .../test/python/stacks/2.3/configs/default.json |  5 +++
 8 files changed, 121 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml
new file mode 100644
index 0000000..dd299fe
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/configuration/sqoop-site.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+  <property>
+    <name>atlas.cluster.name</name>
+    <value>{{cluster_name}}</value>
+    <depends-on>
+      <property>
+        <type>application-properties</type>
+        <name>atlas.cluster.name</name>
+      </property>
+    </depends-on>
+  </property>
+  <property>
+    <name>sqoop.job.data.publish.class</name>
+    <value>{{job_data_publish_class}}</value>
+    <depends-on>
+      <property>
+        <type>application-properties</type>
+        <name>atlas.cluster.name</name>
+      </property>
+    </depends-on>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
index b5db91b..2c9d881 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
@@ -55,6 +55,11 @@
           </commandScript>
           <configFiles>
             <configFile>
+              <type>xml</type>
+              <fileName>squoop-site.xml</fileName>
+              <dictionaryName>squoop-site</dictionaryName>
+            </configFile>
+            <configFile>
               <type>env</type>
               <fileName>sqoop-env.sh</fileName>
               <dictionaryName>sqoop-env</dictionaryName>
@@ -89,6 +94,7 @@
       
       <configuration-dependencies>
         <config-type>sqoop-env</config-type>
+        <config-type>sqoop-site</config-type>
       </configuration-dependencies>
     </service>
   </services>

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
index 3a3f93e..0006078 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py
@@ -21,6 +21,7 @@ from resource_management.libraries.functions.version import format_hdp_stack_ver
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.get_kinit_path import get_kinit_path
 from resource_management.libraries.script import Script
+import os
 
 # a map of the Ambari role to the component name
 # for use with /usr/hdp/current/<component>
@@ -31,6 +32,9 @@ SERVER_ROLE_DIRECTORY_MAP = {
 component_directory = Script.get_component_from_role(SERVER_ROLE_DIRECTORY_MAP, "SQOOP")
 
 config = Script.get_config()
+
+cluster_name = config['clusterName']
+
 ambari_server_hostname = config['clusterHostInfo']['ambari_server_host'][0]
 
 stack_name = default("/hostLevelParams/stack_name", None)
@@ -103,4 +107,18 @@ if "jdbc_drivers" in config['configurations']['sqoop-env']:
       continue
     sqoop_jdbc_drivers_dict[jdbc_jar_name] = jdbc_symlink_name
     sqoop_jdbc_drivers_name_dict[jdbc_jar_name] = jdbc_driver_name
-jdk_location = config['hostLevelParams']['jdk_location']
\ No newline at end of file
+jdk_location = config['hostLevelParams']['jdk_location']
+
+job_data_publish_class = ''
+
+########################################################
+############# Atlas related params #####################
+########################################################
+
+atlas_hosts = default('/clusterHostInfo/atlas_server_hosts', [])
+has_atlas = len(atlas_hosts) > 0
+
+if has_atlas:
+  atlas_home_dir = os.environ['METADATA_HOME_DIR'] if 'METADATA_HOME_DIR' in os.environ else '/usr/hdp/current/atlas-server'
+  atlas_conf_dir = os.environ['METADATA_CONF'] if 'METADATA_CONF' in os.environ else '/etc/atlas/conf'
+  job_data_publish_class = 'org.apache.atlas.sqoop.hook.SqoopHook'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop.py
index 66a5ee4..392bff7 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop.py
@@ -19,6 +19,7 @@ limitations under the License.
 
 from resource_management.core.source import InlineTemplate, DownloadSource
 from resource_management.libraries.functions import format
+from resource_management.libraries.resources.xml_config import XmlConfig
 from resource_management.core.resources.system import File, Link, Directory
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons import OSConst
@@ -46,6 +47,31 @@ def sqoop(type=None):
             group = params.user_group,
             create_parents = True
   )
+
+  configs = {}
+  configs.update(params.config['configurations']['sqoop-site'])
+
+  XmlConfig("sqoop-site.xml",
+            conf_dir = params.sqoop_conf_dir,
+            configurations = configs,
+            configuration_attributes=params.config['configuration_attributes']['sqoop-site'],
+            owner = params.sqoop_user,
+            group = params.user_group
+            )
+
+  if params.has_atlas:
+    Link(params.sqoop_conf_dir + "/application.properties",
+         to = params.atlas_conf_dir + "/application.properties"
+         )
+
+    atlas_sqoop_hook_dir = params.atlas_home_dir + "/hook/sqoop"
+    src_files = os.listdir(atlas_sqoop_hook_dir)
+    for file_name in src_files:
+      atlas_sqoop_hook_file_name = os.path.join(atlas_sqoop_hook_dir, file_name)
+      sqoop_lib_file_name = os.path.join(params.sqoop_lib, file_name)
+      if (os.path.isfile(atlas_sqoop_hook_file_name)):
+        Link(sqoop_lib_file_name, to = atlas_sqoop_hook_file_name)
+
   File(format("{sqoop_conf_dir}/sqoop-env.sh"),
     owner=params.sqoop_user,
     group = params.user_group,

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
index 5a10305..e12db4d 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
@@ -39,6 +39,12 @@ class TestSqoop(RMFTestCase):
                               create_parents = True,
                               owner = 'sqoop',
                               group = 'hadoop',)
+    self.assertResourceCalled('XmlConfig', 'sqoop-site.xml',
+                              owner = 'sqoop',
+                              group = 'hadoop',
+                              conf_dir = '/usr/lib/sqoop/conf',
+                              configurations = self.getConfig()['configurations']['sqoop-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['sqoop-site'])
     self.assertResourceCalled('File', '/usr/lib/sqoop/conf/sqoop-env.sh',
                               owner = 'sqoop',
                               group = 'hadoop',
@@ -89,6 +95,12 @@ class TestSqoop(RMFTestCase):
                               group = 'hadoop',
                               create_parents = True,
                               )
+    self.assertResourceCalled('XmlConfig', 'sqoop-site.xml',
+                              owner = 'sqoop',
+                              group = 'hadoop',
+                              conf_dir = '/usr/lib/sqoop/conf',
+                              configurations = self.getConfig()['configurations']['sqoop-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['sqoop-site'])
     self.assertResourceCalled('File', '/usr/lib/sqoop/conf/sqoop-env.sh',
                               content = InlineTemplate(self.getConfig()['configurations']['sqoop-env']['content']),
                               owner = 'sqoop',

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index 3d3987b..adf12ad 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -40,6 +40,10 @@
     "taskId": 152,
     "public_hostname": "c6401.ambari.apache.org",
     "configurations": {
+        "sqoop-site": {
+            "atlas.cluster.name": "c1",
+            "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+        },
         "mapred-site": {
             "mapreduce.jobhistory.address": "c6402.ambari.apache.org:10020",
             "mapreduce.cluster.administrators": " hadoop",
@@ -877,6 +881,7 @@
         "ams-hbase-log4j": {},
         "ams-site": {},
         "ams-ssl-server": {},
+        "sqoop-site": {},
         "yarn-site": {
         "final": {
           "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
index d673973..e17559d 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
@@ -37,6 +37,10 @@
     "taskId": 186, 
     "public_hostname": "c6401.ambari.apache.org", 
     "configurations": {
+        "sqoop-site": {
+            "atlas.cluster.name": "c1",
+            "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+        },
         "mapred-site": {
             "mapreduce.jobhistory.address": "c6402.ambari.apache.org:10020", 
             "mapreduce.jobhistory.webapp.spnego-keytab-file": "/etc/security/keytabs/spnego.service.keytab", 
@@ -765,6 +769,7 @@
         }
     },
     "configuration_attributes": {
+      "sqoop-site": {},
       "yarn-site": {
         "final": {
           "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",

http://git-wip-us.apache.org/repos/asf/ambari/blob/260419bb/ambari-server/src/test/python/stacks/2.3/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/configs/default.json b/ambari-server/src/test/python/stacks/2.3/configs/default.json
index a36455c..4a72f08 100644
--- a/ambari-server/src/test/python/stacks/2.3/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.3/configs/default.json
@@ -33,6 +33,10 @@
         "slider-client": {
             "slider.yarn.queue": "default"
         },
+        "sqoop-site": {
+          "atlas.cluster.name": "c1",
+          "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+        },
         "mahout-env": {
              "mahout_user": "mahout"
         },
@@ -214,6 +218,7 @@
       }
     },
     "configuration_attributes": {
+        "sqoop-site": {},
         "yarn-site": {
             "final": {
                 "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",


[20/21] ambari git commit: AMBARI-15109 Add HDP 2.6 stack for Ambari trunk (dsen)

Posted by dm...@apache.org.
AMBARI-15109 Add HDP 2.6 stack for Ambari trunk (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d48fb9b6dda40873da3ef46a1d8738678fe8b62f
Parents: 9c9b4ab
Author: Dmytro Sen <ds...@apache.org>
Authored: Fri Feb 19 13:44:50 2016 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Fri Feb 19 13:44:50 2016 +0200

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/2.6/metainfo.xml  | 25 ++++++
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 92 ++++++++++++++++++++
 .../HDP/2.6/services/ACCUMULO/metainfo.xml      | 26 ++++++
 .../stacks/HDP/2.6/services/ATLAS/metainfo.xml  | 26 ++++++
 .../stacks/HDP/2.6/services/FALCON/metainfo.xml | 26 ++++++
 .../stacks/HDP/2.6/services/FLUME/metainfo.xml  | 26 ++++++
 .../stacks/HDP/2.6/services/HBASE/metainfo.xml  | 26 ++++++
 .../stacks/HDP/2.6/services/HDFS/metainfo.xml   | 26 ++++++
 .../stacks/HDP/2.6/services/HIVE/metainfo.xml   | 26 ++++++
 .../stacks/HDP/2.6/services/KAFKA/metainfo.xml  | 26 ++++++
 .../HDP/2.6/services/KERBEROS/metainfo.xml      | 25 ++++++
 .../stacks/HDP/2.6/services/KNOX/metainfo.xml   | 26 ++++++
 .../stacks/HDP/2.6/services/MAHOUT/metainfo.xml | 26 ++++++
 .../stacks/HDP/2.6/services/OOZIE/metainfo.xml  | 26 ++++++
 .../stacks/HDP/2.6/services/PIG/metainfo.xml    | 26 ++++++
 .../stacks/HDP/2.6/services/RANGER/metainfo.xml | 29 ++++++
 .../HDP/2.6/services/RANGER_KMS/metainfo.xml    | 29 ++++++
 .../stacks/HDP/2.6/services/SLIDER/metainfo.xml | 26 ++++++
 .../stacks/HDP/2.6/services/SPARK/metainfo.xml  | 29 ++++++
 .../stacks/HDP/2.6/services/SQOOP/metainfo.xml  | 26 ++++++
 .../stacks/HDP/2.6/services/STORM/metainfo.xml  | 27 ++++++
 .../stacks/HDP/2.6/services/TEZ/metainfo.xml    | 26 ++++++
 .../stacks/HDP/2.6/services/YARN/metainfo.xml   | 27 ++++++
 .../HDP/2.6/services/ZOOKEEPER/metainfo.xml     | 26 ++++++
 .../stacks/HDP/2.6/services/stack_advisor.py    | 22 +++++
 25 files changed, 721 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/metainfo.xml
new file mode 100644
index 0000000..e1ce7ba
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/metainfo.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <versions>
+    <active>true</active>
+  </versions>
+  <extends>2.5</extends>
+  <minJdk>1.7</minJdk>
+  <maxJdk>1.8</maxJdk>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
new file mode 100644
index 0000000..96a2b95
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<reposinfo>
+  <latest>http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json</latest>
+  <os family="redhat6">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+  <os family="redhat7">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+  <os family="suse11">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/suse11sp3</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+  <os family="ubuntu12">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu12</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+  <os family="debian7">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/debian6</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+  <os family="ubuntu14">
+    <repo>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0</baseurl>
+      <repoid>HDP-2.6</repoid>
+      <reponame>HDP</reponame>
+    </repo>
+    <repo>
+      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu12</baseurl>
+      <repoid>HDP-UTILS-1.1.0.20</repoid>
+      <reponame>HDP-UTILS</reponame>
+    </repo>
+  </os>
+</reposinfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
new file mode 100644
index 0000000..3f619af
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>ACCUMULO</name>
+      <version>1.7.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml
new file mode 100644
index 0000000..9514576
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>ATLAS</name>
+      <version>0.5.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
new file mode 100644
index 0000000..496719d
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>FALCON</name>
+      <version>0.6.1.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
new file mode 100644
index 0000000..0d7cd1f
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>FLUME</name>
+      <version>1.5.2.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
new file mode 100644
index 0000000..9bc3ee2
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>HBASE</name>
+      <version>1.1.2.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml
new file mode 100644
index 0000000..d377476
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>HDFS</name>
+      <version>2.7.1.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml
new file mode 100644
index 0000000..54c92d8
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>HIVE</name>
+      <version>1.2.1.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml
new file mode 100644
index 0000000..9e95b92
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>KAFKA</name>
+      <version>0.9.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/KERBEROS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KERBEROS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KERBEROS/metainfo.xml
new file mode 100644
index 0000000..1a931a3
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KERBEROS/metainfo.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>KERBEROS</name>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml
new file mode 100644
index 0000000..e9b6b98
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>KNOX</name>
+      <version>0.6.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml
new file mode 100644
index 0000000..3fe4d57
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>MAHOUT</name>
+      <version>0.9.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
new file mode 100644
index 0000000..6392ed4
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>OOZIE</name>
+      <version>4.2.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml
new file mode 100644
index 0000000..26f6069
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>PIG</name>
+      <version>0.15.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml
new file mode 100644
index 0000000..18c3333
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>RANGER</name>
+      <version>0.5.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml
new file mode 100644
index 0000000..a490803
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>RANGER_KMS</name>
+      <version>0.5.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml
new file mode 100644
index 0000000..0b0c2bb
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SLIDER</name>
+      <version>0.80.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml
new file mode 100644
index 0000000..71a50ff
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SPARK</name>
+      <version>1.6.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml
new file mode 100644
index 0000000..2d1fe85
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>SQOOP</name>
+      <version>1.4.6.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
new file mode 100644
index 0000000..698b3a6
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>STORM</name>
+      <version>0.10.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml
new file mode 100644
index 0000000..457342a
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>TEZ</name>
+      <version>0.7.0.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml
new file mode 100644
index 0000000..c3b3b30
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>YARN</name>
+      <version>2.7.1.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml
new file mode 100644
index 0000000..e5f33f9
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>ZOOKEEPER</name>
+      <version>3.4.6.2.6</version>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d48fb9b6/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
new file mode 100644
index 0000000..af269de
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+
+class HDP26StackAdvisor(HDP25StackAdvisor):
+  pass


[04/21] ambari git commit: AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)

Posted by dm...@apache.org.
AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0bd63c80b337e0818a5cb55781998c174e4cf6fa
Parents: 0c568cc
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 18 17:56:22 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 18 17:56:22 2016 +0200

----------------------------------------------------------------------
 .../src/main/repo/install_ambari_tarball.py     |   2 +-
 ambari-server/conf/unix/ambari-env.sh           |   6 +-
 ambari-server/conf/unix/ambari.properties       |  30 +++---
 ambari-server/conf/unix/install-helper.sh       |   7 +-
 ambari-server/pom.xml                           |   1 +
 ambari-server/sbin/ambari-server                |  57 +++++-----
 .../src/main/package/deb/control/preinst        |   2 +-
 ambari-server/src/main/python/ambari-server.py  |  17 +--
 .../main/python/ambari_server/BackupRestore.py  |  11 +-
 .../src/main/python/ambari_server/ambariPath.py |  39 +++++++
 .../ambari_server/dbConfiguration_linux.py      |  29 +++---
 .../python/ambari_server/serverConfiguration.py | 103 ++++++++++---------
 .../main/python/ambari_server/serverSetup.py    |   6 +-
 .../src/test/python/TestAmbariServer.py         |   2 +-
 14 files changed, 185 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-common/src/main/repo/install_ambari_tarball.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/repo/install_ambari_tarball.py b/ambari-common/src/main/repo/install_ambari_tarball.py
index 5c65b60..e6578b0 100644
--- a/ambari-common/src/main/repo/install_ambari_tarball.py
+++ b/ambari-common/src/main/repo/install_ambari_tarball.py
@@ -200,7 +200,7 @@ class Installer:
     if self.verbose:
       bash_args.append("-x")
       
-    Utils.os_call(["bash"] + bash_args + [script_name] + args, env={ROOT_FOLDER_ENV_VARIABLE: self.root_folder})
+    Utils.os_call(["bash"] + bash_args + [script_name] + args, env={ROOT_FOLDER_ENV_VARIABLE: self.root_folder}, logoutput=True)
     
 
 class TargzInstaller(Installer):

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/ambari-env.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari-env.sh b/ambari-server/conf/unix/ambari-env.sh
index bf7ae56..e9fdcdd 100644
--- a/ambari-server/conf/unix/ambari-env.sh
+++ b/ambari-server/conf/unix/ambari-env.sh
@@ -15,9 +15,9 @@
 
 
 AMBARI_PASSHPHRASE="DEV"
-export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -Djava.security.auth.login.config=/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false'
-export PATH=$PATH:/var/lib/ambari-server
-export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages
+export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false'
+export PATH=$PATH:$ROOT/var/lib/ambari-server
+export PYTHONPATH=$PYTHONPATH:$ROOT/usr/lib/python2.6/site-packages
 
 # customize python binary for ambari
 # export PYTHON=/usr/bin/python2

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index 23f3187..81ef446 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -16,12 +16,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-security.server.keys_dir = /var/lib/ambari-server/keys
+security.server.keys_dir = $ROOT/var/lib/ambari-server/keys
 #security.server.disabled.ciphers=SSL_RSA_WITH_DES_CBC_SHA|SSL_RSA_EXPORT_WITH_RC4_40_MD5|SSL_DHE_RSA_WITH_DES_CBC_SHA|SSL_DHE_DSS_WITH_DES_CBC_SHA|SSL_RSA_EXPORT_WITH_DES40_CBC_SHA|SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA|SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA|SSL_RSA_WITH_3DES_EDE_CBC_SHA|SSL_DHE_RSA_WITH_DES_CBC_SHA
 #security.server.disabled.protocols=SSL|SSLv2|SSLv3
-resources.dir = /var/lib/ambari-server/resources
-shared.resources.dir = /usr/lib/ambari-server/lib/ambari_commons/resources
-custom.action.definitions = /var/lib/ambari-server/resources/custom_action_definitions
+resources.dir = $ROOT/var/lib/ambari-server/resources
+shared.resources.dir = $ROOT/usr/lib/ambari-server/lib/ambari_commons/resources
+custom.action.definitions = $ROOT/var/lib/ambari-server/resources/custom_action_definitions
 
 java.releases=jdk1.8,jdk1.7
 jdk1.7.desc=Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
@@ -41,16 +41,16 @@ jdk1.8.re=(jdk.*)/jre
 jdk.download.supported=true
 jce.download.supported=true
 
-metadata.path=/var/lib/ambari-server/resources/stacks
-common.services.path=/var/lib/ambari-server/resources/common-services
-server.version.file=/var/lib/ambari-server/resources/version
-webapp.dir=/usr/lib/ambari-server/web
-bootstrap.dir=/var/run/ambari-server/bootstrap
-bootstrap.script=/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py
-bootstrap.setup_agent.script=/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
-recommendations.dir=/var/run/ambari-server/stack-recommendations
-stackadvisor.script=/var/lib/ambari-server/resources/scripts/stack_advisor.py
-server.tmp.dir=/var/lib/ambari-server/data/tmp
+metadata.path=$ROOT/var/lib/ambari-server/resources/stacks
+common.services.path=$ROOT/var/lib/ambari-server/resources/common-services
+server.version.file=$ROOT/var/lib/ambari-server/resources/version
+webapp.dir=$ROOT/usr/lib/ambari-server/web
+bootstrap.dir=$ROOT/var/run/ambari-server/bootstrap
+bootstrap.script=$ROOT/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py
+bootstrap.setup_agent.script=$ROOT/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
+recommendations.dir=$ROOT/var/run/ambari-server/stack-recommendations
+stackadvisor.script=$ROOT/var/lib/ambari-server/resources/scripts/stack_advisor.py
+server.tmp.dir=$ROOT/var/lib/ambari-server/data/tmp
 ambari.python.wrap=ambari-python-wrap
 ambari-server.user=root
 
@@ -69,7 +69,7 @@ server.execution.scheduler.maxDbConnections=5
 server.execution.scheduler.misfire.toleration.minutes=480
 
 # Kerberos settings
-kerberos.keytab.cache.dir = /var/lib/ambari-server/data/cache
+kerberos.keytab.cache.dir = $ROOT/var/lib/ambari-server/data/cache
 
 # Default timeout in seconds before task is killed
 agent.task.timeout=900

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh
index e2e22ab..0ccfc63 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -30,8 +30,10 @@ COMMON_DIR_SERVER="${ROOT}/usr/lib/ambari-server/lib/ambari_commons"
 RESOURCE_MANAGEMENT_DIR_SERVER="${ROOT}/usr/lib/ambari-server/lib/resource_management"
 JINJA_SERVER_DIR="${ROOT}/usr/lib/ambari-server/lib/ambari_jinja2"
 SIMPLEJSON_SERVER_DIR="${ROOT}/usr/lib/ambari-server/lib/ambari_simplejson"
+AMBARI_PROPERTIES="${ROOT}/etc/ambari-server/conf/ambari.properties"
 
-PYTHON_WRAPER_TARGET="${ROOT}/usr/bin/ambari-python-wrap"
+PYTHON_WRAPER_DIR="${ROOT}/usr/bin/"
+PYTHON_WRAPER_TARGET="${PYTHON_WRAPER_DIR}/ambari-python-wrap"
 
 AMBARI_SERVER_EXECUTABLE_LINK="${ROOT}/usr/sbin/ambari-server"
 AMBARI_SERVER_EXECUTABLE="${ROOT}/etc/init.d/ambari-server"
@@ -80,6 +82,7 @@ do_install(){
   if [ -z "$AMBARI_PYTHON" ] ; then
     >&2 echo "Cannot detect python for ambari to use. Please manually set $PYTHON_WRAPER link to point to correct python binary"
   else
+	mkdir -p "$PYTHON_WRAPER_DIR"
     ln -s "$AMBARI_PYTHON" "$PYTHON_WRAPER_TARGET"
   fi
 
@@ -90,7 +93,7 @@ do_install(){
   which update-rc.d > /dev/null 2>&1
   if [ "$?" -eq 0 ] ; then
     update-rc.d ambari-server defaults
-  fi
+  fi 
 }
 
 do_remove(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index b0794c9..0fa0101 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -46,6 +46,7 @@
     <skipPythonTests>false</skipPythonTests>
     <hadoop.version>2.7.1</hadoop.version>
     <jetty.version>9.2.11.v20150529</jetty.version>
+    <empty.dir>src/main/package</empty.dir> <!-- any directory in project with not very big amount of files (not to waste-load them) -->
   </properties>
   <build>
     <plugins>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/sbin/ambari-server
----------------------------------------------------------------------
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index cdda673..5b31d73 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -35,16 +35,23 @@ case "$1" in
         ;;
 esac
 
-export PATH=/usr/lib/ambari-server/*:$PATH:/sbin/:/usr/sbin
-export AMBARI_CONF_DIR=/etc/ambari-server/conf
-PYTHON_WRAP=/usr/bin/ambari-python-wrap
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export ROOT=`dirname $(dirname $SCRIPT_DIR)`
+
+export PATH=$ROOT/usr/lib/ambari-server/*:$PATH:/sbin/:/usr/sbin
+export AMBARI_CONF_DIR=$ROOT/etc/ambari-server/conf
+
+PYTHON_WRAP="$ROOT/usr/bin/ambari-python-wrap"
+AMBARI_ENV="$ROOT/var/lib/ambari-server/ambari-env.sh"
+AMBARI_PYTHON_EXECUTABLE="$ROOT/usr/sbin/ambari-server.py"
+AMBARI_EXECUTABLE="$ROOT/usr/sbin/ambari-server"
 
 if [ -z "$PYTHON" ] ; then
   export PYTHON=`readlink $PYTHON_WRAP`
 fi
 
-if [ -a /var/lib/ambari-server/ambari-env.sh ]; then
-  . /var/lib/ambari-server/ambari-env.sh
+if [ -a "$AMBARI_ENV" ]; then
+  . "$AMBARI_ENV"
 fi
 
 if [ -z "$AMBARI_PASSPHRASE" ]; then
@@ -71,15 +78,15 @@ ret=0
 case "$1" in
   start)
         echo -e "Starting ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   stop)
         echo -e "Stopping ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   reset)
         echo -e "Resetting ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   restart)
         echo -e "Restarting ambari-server"
@@ -88,72 +95,72 @@ case "$1" in
         ;;
   upgrade)
         echo -e "Upgrading ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   status)
         echo -e "Ambari-server status"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   upgradestack)
         echo -e "Upgrading stack of ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup)
         echo -e "Setup ambari-server"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-jce)
         echo -e "Updating jce policy"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-ldap)
         echo -e "Setting up LDAP properties..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   sync-ldap)
         echo -e "Syncing with LDAP..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   set-current)
         echo -e "Setting current version..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-security)
         echo -e "Security setup options..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   refresh-stack-hash)
         echo -e "Refreshing stack hashes..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   backup)
         echo -e "Backing up Ambari File System state... *this will not backup the server database*"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   restore)
         echo -e "Restoring Ambari File System state"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   update-host-names)
         echo -e "Updating host names"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   check-database)
         echo -e "Checking database"
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   enable-stack)
         echo -e "Enabling stack(s)..."
-        $PYTHON /usr/sbin/ambari-server.py $@
+        $PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
         ;;
   setup-sso)
         echo -e "Setting up SSO authentication properties..."
                 $PYTHON /usr/sbin/ambari-server.py $@
                 ;;
   *)
-        echo "Usage: /usr/sbin/ambari-server
+        echo "Usage: $AMBARI_PYTHON_EXECUTABLE
         {start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database} [options]
-        Use usr/sbin/ambari-server <action> --help to get details on options available.
+        Use $AMBARI_PYTHON_EXECUTABLE <action> --help to get details on options available.
         Or, simply invoke ambari-server.py --help to print the options."
         exit 1
 esac

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/deb/control/preinst b/ambari-server/src/main/package/deb/control/preinst
index db66d92..9dcd8bf 100644
--- a/ambari-server/src/main/package/deb/control/preinst
+++ b/ambari-server/src/main/package/deb/control/preinst
@@ -37,7 +37,7 @@ SERVER_CONF_SAVE_BACKUP="${AMBARI_ROOT_FOLDER}/etc/ambari-server/conf_$(date '+%
 
 if [ -d "$SERVER_CONF_SAVE" ]
 then
-    mv "$SERVER_CONF_SAVE" "SERVER_CONF_SAVE_BACKUP"
+    mv "$SERVER_CONF_SAVE" "$SERVER_CONF_SAVE_BACKUP"
 fi
 
 if [ -f "$AMBARI_PROPERTIES" ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py
index 935be21..cb7a6cf 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -50,6 +50,7 @@ from ambari_server.setupSecurity import setup_ldap, sync_ldap, setup_master_key,
 from ambari_server.userInput import get_validated_string_input
 
 from ambari_server_main import server_process_main
+from ambari_server.ambariPath import AmbariPath
 
 
 class UserActionPossibleArgs(object):
@@ -326,20 +327,20 @@ def init_parser_options(parser):
 @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)
 def init_parser_options(parser):
   parser.add_option('-f', '--init-script-file',
-                    default='/var/lib/ambari-server/'
-                            'resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql',
+                    default=AmbariPath.get('/var/lib/ambari-server/'
+                            'resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql'),
                     help="File with setup script")
-  parser.add_option('-r', '--drop-script-file', default="/var/lib/"
+  parser.add_option('-r', '--drop-script-file', default=AmbariPath.get("/var/lib/"
                                                         "ambari-server/resources/"
-                                                        "Ambari-DDL-Postgres-EMBEDDED-DROP.sql",
+                                                        "Ambari-DDL-Postgres-EMBEDDED-DROP.sql"),
                     help="File with drop script")
-  parser.add_option('-u', '--upgrade-script-file', default="/var/lib/"
+  parser.add_option('-u', '--upgrade-script-file', default=AmbariPath.get("/var/lib/"
                                                            "ambari-server/resources/upgrade/ddl/"
-                                                           "Ambari-DDL-Postgres-UPGRADE-1.3.0.sql",
+                                                           "Ambari-DDL-Postgres-UPGRADE-1.3.0.sql"),
                     help="File with upgrade script")
-  parser.add_option('-t', '--upgrade-stack-script-file', default="/var/lib/"
+  parser.add_option('-t', '--upgrade-stack-script-file', default=AmbariPath.get("/var/lib/"
                                                                  "ambari-server/resources/upgrade/dml/"
-                                                                 "Ambari-DML-Postgres-UPGRADE_STACK.sql",
+                                                                 "Ambari-DML-Postgres-UPGRADE_STACK.sql"),
                     help="File with stack upgrade script")
   parser.add_option('-j', '--java-home', default=None,
                     help="Use specified java_home.  Must be valid on all hosts")

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/BackupRestore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/BackupRestore.py b/ambari-server/src/main/python/ambari_server/BackupRestore.py
index 6c6afd2..2c00be9 100644
--- a/ambari-server/src/main/python/ambari_server/BackupRestore.py
+++ b/ambari-server/src/main/python/ambari_server/BackupRestore.py
@@ -21,6 +21,7 @@ limitations under the License.
 import sys
 import zipfile
 import os
+from ambari_server.ambariPath import AmbariPath
 
 # Default values are hardcoded here
 BACKUP_PROCESS = 'backup'
@@ -28,13 +29,13 @@ RESTORE_PROCESS = 'restore'
 SUPPORTED_PROCESSES = [BACKUP_PROCESS, RESTORE_PROCESS]
 
 # The list of files where the ambari server state is kept on the filesystem
-AMBARI_FILESYSTEM_STATE = ["/etc/ambari-server/conf",
-                           "/var/lib/ambari-server/resources",
-                           "/var/run/ambari-server/bootstrap/",
-                           "/var/run/ambari-server/stack-recommendations"]
+AMBARI_FILESYSTEM_STATE = [AmbariPath.get("/etc/ambari-server/conf"),
+                           AmbariPath.get("/var/lib/ambari-server/resources"),
+                           AmbariPath.get("/var/run/ambari-server/bootstrap/"),
+                           AmbariPath.get("/var/run/ambari-server/stack-recommendations")]
 
 # What to use when no path/archive is specified
-DEFAULT_ARCHIVE = "/var/lib/ambari-server/Ambari_State_Backup.zip"
+DEFAULT_ARCHIVE = AmbariPath.get("/var/lib/ambari-server/Ambari_State_Backup.zip")
 
 # Responsible for managing the Backup/Restore process
 class BackupRestore:

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/ambariPath.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/ambariPath.py b/ambari-server/src/main/python/ambari_server/ambariPath.py
new file mode 100644
index 0000000..9d68206
--- /dev/null
+++ b/ambari-server/src/main/python/ambari_server/ambariPath.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+"""
+
+import os
+
+AMBARI_SERVER_ROOT_ENV_VARIABLE = "ROOT"
+
+class AmbariPath():
+  root_directory = os.environ[AMBARI_SERVER_ROOT_ENV_VARIABLE]
+
+  @staticmethod
+  def get(path):
+    """
+    Any paths which to ambari-server files, should be wrapped with this function call.
+    Which is needed for the situations when ambari-server installed not in / but in other folder like /opt.
+    Not ambari paths like /var/run/postgresql SHOULD NOT wrapped by this call though.
+    """
+    return os.path.realpath(AmbariPath.root_directory + os.sep + path)
+    
+  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index 4d68300..3ebebae 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -49,6 +49,7 @@ from ambari_server.serverConfiguration import encrypt_password, store_password_f
 
 from ambari_server.userInput import get_YN_input, get_validated_string_input, read_password
 from ambari_server.utils import get_postgre_hba_dir, get_postgre_running_status
+from ambari_server.ambariPath import AmbariPath
 
 ORACLE_DB_ID_TYPES = ["Service Name", "SID"]
 ORACLE_SNAME_PATTERN = "jdbc:oracle:thin:@.+:.+:.+"
@@ -317,7 +318,7 @@ class PGConfig(LinuxDBMSConfig):
                        '--command=psql -f {0} -v stack_name="\'{1}\'"  -v stack_version="\'{2}\'" -v dbname="{3}"']
 
   CHANGE_OWNER_COMMAND = ['su', '-', 'postgres',
-                          '--command=/var/lib/ambari-server/resources/scripts/change_owner.sh -d {0} -s {1} -o {2}']
+                          '--command=' + AmbariPath.get("/var/lib/ambari-server/resources/scripts/change_owner.sh") + ' -d {0} -s {1} -o {2}']
 
   PG_ERROR_BLOCKED = "is being accessed by other users"
   PG_STATUS_RUNNING = None
@@ -339,11 +340,11 @@ class PGConfig(LinuxDBMSConfig):
   PG_HBA_CONF_FILE_BACKUP = None
   POSTGRESQL_CONF_FILE = None
 
-  POSTGRES_EMBEDDED_INIT_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql"
-  POSTGRES_EMBEDDED_DROP_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-DROP.sql"
+  POSTGRES_EMBEDDED_INIT_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql")
+  POSTGRES_EMBEDDED_DROP_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-DROP.sql")
 
-  POSTGRES_INIT_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-CREATE.sql"
-  POSTGRES_DROP_FILE = "/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql"
+  POSTGRES_INIT_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-CREATE.sql")
+  POSTGRES_DROP_FILE = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql")
 
   def __init__(self, options, properties, storage_type):
     super(PGConfig, self).__init__(options, properties, storage_type)
@@ -783,8 +784,8 @@ class OracleConfig(LinuxDBMSConfig):
                                    'you must copy the {0} JDBC driver JAR file to {1}.'.format(
         self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql'"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-Oracle-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql'")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-Oracle-DROP.sql")
     self.client_tool_usage_pattern = 'sqlplus {1}/{2} < {0}'
 
     self.jdbc_extra_params = [
@@ -894,8 +895,8 @@ class MySQLConfig(LinuxDBMSConfig):
                                      'you must copy the {0} JDBC driver JAR file to {1}.'.format(
     self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-MySQL-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-MySQL-DROP.sql")
     self.client_tool_usage_pattern = 'mysql --user={1} --password={2} {3}<{0}'
 
   #
@@ -914,7 +915,7 @@ class MySQLConfig(LinuxDBMSConfig):
     return True
 
   def _get_remote_script_line(self, scriptFile):
-    MYSQL_INIT_SCRIPT = '/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql'
+    MYSQL_INIT_SCRIPT = AmbariPath.get('/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql')
     MYSQL_EXEC_ARGS_WITH_USER_VARS = "mysql --host={0} --port={1} --user={2} --password={3} {4} " \
                                      "-e\"set @schema=\'{4}\'; set @username=\'{2}\'; source {5};\""
     MYSQL_EXEC_ARGS_WO_USER_VARS = "mysql --force --host={0} --port={1} --user={2} --password={3} --database={4} < {5} 2> /dev/null"
@@ -972,8 +973,8 @@ class MSSQLConfig(LinuxDBMSConfig):
                                    'you must copy the {0} JDBC driver JAR file to {1}.'.format(
       self.dbms_full_name, configDefaults.JAVA_SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLServer-DROP.sql")
     self.client_tool_usage_pattern = ''
 
   #
@@ -1029,8 +1030,8 @@ class SQLAConfig(LinuxDBMSConfig):
                                    'you must copy the {0} jdbc client tarball to {1}.'.format(
       self.dbms_full_name, configDefaults.SHARE_PATH)
 
-    self.init_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-CREATE.sql"
-    self.drop_tables_script_file = "/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-DROP.sql"
+    self.init_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-CREATE.sql")
+    self.drop_tables_script_file = AmbariPath.get("/var/lib/ambari-server/resources/Ambari-DDL-SQLAnywhere-DROP.sql")
     self.client_tool_usage_pattern = 'stub string'
 
   #

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/serverConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index dfb1791..3df1663 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -38,6 +38,7 @@ from ambari_commons.logging_utils import get_debug_mode, print_info_msg, print_w
 from ambari_server.properties import Properties
 from ambari_server.userInput import get_validated_string_input
 from ambari_server.utils import compare_versions, locate_file
+from ambari_server.ambariPath import AmbariPath
 
 
 OS_VERSION = OSCheck().get_os_major_version()
@@ -281,7 +282,7 @@ class ServerConfigDefaults(object):
   def __init__(self):
     self.JAVA_SHARE_PATH = "/usr/share/java"
     self.SHARE_PATH = "/usr/share"
-    self.OUT_DIR = os.sep + os.path.join("var", "log", "ambari-server")
+    self.OUT_DIR = AmbariPath.get(os.sep + os.path.join("var", "log", "ambari-server"))
     self.SERVER_OUT_FILE = os.path.join(self.OUT_DIR, "ambari-server.out")
     self.SERVER_LOG_FILE = os.path.join(self.OUT_DIR, "ambari-server.log")
     self.ROOT_FS_PATH = os.sep
@@ -294,7 +295,7 @@ class ServerConfigDefaults(object):
 
     # Configuration defaults
     self.DEFAULT_CONF_DIR = ""
-    self.PID_DIR = os.sep + os.path.join("var", "run", "ambari-server")
+    self.PID_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server"))
     self.DEFAULT_LIBS_DIR = ""
     self.DEFAULT_VLIBS_DIR = ""
 
@@ -395,9 +396,9 @@ class ServerConfigDefaultsLinux(ServerConfigDefaults):
     self.JAVA_EXE_SUBPATH = "bin/java"
 
     # Configuration defaults
-    self.DEFAULT_CONF_DIR = "/etc/ambari-server/conf"
-    self.DEFAULT_LIBS_DIR = "/usr/lib/ambari-server"
-    self.DEFAULT_VLIBS_DIR = "/var/lib/ambari-server"
+    self.DEFAULT_CONF_DIR = AmbariPath.get("/etc/ambari-server/conf")
+    self.DEFAULT_LIBS_DIR = AmbariPath.get("/usr/lib/ambari-server")
+    self.DEFAULT_VLIBS_DIR = AmbariPath.get("/var/lib/ambari-server")
 
     self.AMBARI_PROPERTIES_BACKUP_FILE = "ambari.properties.rpmsave"
     self.AMBARI_ENV_BACKUP_FILE = "ambari-env.sh.rpmsave"
@@ -407,55 +408,55 @@ class ServerConfigDefaultsLinux(ServerConfigDefaults):
     # Rules are executed in the same order as they are listed
     # {0} in user/group will be replaced by customized ambari-server username
     self.NR_ADJUST_OWNERSHIP_LIST = [
-      ("/var/log/ambari-server/", "644", "{0}", True),
-      ("/var/log/ambari-server/", "755", "{0}", False),
-      ("/var/run/ambari-server/", "644", "{0}", True),
-      ("/var/run/ambari-server/", "755", "{0}", False),
-      ("/var/run/ambari-server/bootstrap", "755", "{0}", False),
-      ("/var/lib/ambari-server/ambari-env.sh", "700", "{0}", False),
-      ("/var/lib/ambari-server/ambari-sudo.sh", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/", "600", "{0}", True),
-      ("/var/lib/ambari-server/keys/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/db/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/db/newcerts/", "700", "{0}", False),
-      ("/var/lib/ambari-server/keys/.ssh", "700", "{0}", False),
-      ("/var/lib/ambari-server/resources/common-services/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/stacks/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/custom_actions/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/host_scripts/", "755", "{0}", True),
-      ("/var/lib/ambari-server/resources/views/", "644", "{0}", True),
-      ("/var/lib/ambari-server/resources/views/", "755", "{0}", False),
-      ("/var/lib/ambari-server/resources/views/work/", "755", "{0}", True),
-      ("/etc/ambari-server/conf/", "644", "{0}", True),
-      ("/etc/ambari-server/conf/", "755", "{0}", False),
-      ("/etc/ambari-server/conf/password.dat", "640", "{0}", False),
-      ("/var/lib/ambari-server/keys/pass.txt", "600", "{0}", False),
-      ("/etc/ambari-server/conf/ldap-password.dat", "640", "{0}", False),
-      ("/var/run/ambari-server/stack-recommendations/", "744", "{0}", True),
-      ("/var/run/ambari-server/stack-recommendations/", "755", "{0}", False),
-      ("/var/lib/ambari-server/resources/data/", "644", "{0}", False),
-      ("/var/lib/ambari-server/resources/data/", "755", "{0}", False),
-      ("/var/lib/ambari-server/data/tmp/", "644", "{0}", True),
-      ("/var/lib/ambari-server/data/tmp/", "755", "{0}", False),
-      ("/var/lib/ambari-server/data/cache/", "600", "{0}", True),
-      ("/var/lib/ambari-server/data/cache/", "700", "{0}", False),
+      (AmbariPath.get("/var/log/ambari-server/"), "644", "{0}", True),
+      (AmbariPath.get("/var/log/ambari-server/"), "755", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/"), "644", "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server/"), "755", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/bootstrap"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/ambari-env.sh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/ambari-sudo.sh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/"), "600", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/keys/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/db/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/db/newcerts/"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/.ssh"), "700", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/common-services/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/stacks/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/custom_actions/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/host_scripts/"), "755", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/"), "644", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/views/work/"), "755", "{0}", True),
+      (AmbariPath.get("/etc/ambari-server/conf/"), "644", "{0}", True),
+      (AmbariPath.get("/etc/ambari-server/conf/"), "755", "{0}", False),
+      (AmbariPath.get("/etc/ambari-server/conf/password.dat"), "640", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/keys/pass.txt"), "600", "{0}", False),
+      (AmbariPath.get("/etc/ambari-server/conf/ldap-password.dat"), "640", "{0}", False),
+      (AmbariPath.get("/var/run/ambari-server/stack-recommendations/"), "744", "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server/stack-recommendations/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/data/"), "644", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/resources/data/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/data/tmp/"), "644", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/data/tmp/"), "755", "{0}", False),
+      (AmbariPath.get("/var/lib/ambari-server/data/cache/"), "600", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server/data/cache/"), "700", "{0}", False),
       # Also, /etc/ambari-server/conf/password.dat
       # is generated later at store_password_file
     ]
     self.NR_CHANGE_OWNERSHIP_LIST = [
-      ("/var/lib/ambari-server", "{0}", True),
-      ("/usr/lib/ambari-server", "{0}", True),
-      ("/var/log/ambari-server", "{0}", True),
-      ("/var/run/ambari-server", "{0}", True),
-      ("/etc/ambari-server", "{0}", True),
+      (AmbariPath.get("/var/lib/ambari-server"), "{0}", True),
+      (AmbariPath.get("/usr/lib/ambari-server"), "{0}", True),
+      (AmbariPath.get("/var/log/ambari-server"), "{0}", True),
+      (AmbariPath.get("/var/run/ambari-server"), "{0}", True),
+      (AmbariPath.get("/etc/ambari-server"), "{0}", True),
     ]
     self.NR_USERADD_CMD = 'useradd -M --comment "{1}" ' \
-                 '--shell %s -d /var/lib/ambari-server/keys/ {0}' % locate_file('nologin', '/sbin')
+                 '--shell %s ' % locate_file('nologin', '/sbin') + ' -d ' + AmbariPath.get('/var/lib/ambari-server/keys/') + ' {0}'
 
-    self.SERVER_RESOURCES_DIR = "/var/lib/ambari-server/resources"
-    self.STACK_LOCATION_DEFAULT = "/var/lib/ambari-server/resources/stacks"
+    self.SERVER_RESOURCES_DIR = AmbariPath.get("/var/lib/ambari-server/resources")
+    self.STACK_LOCATION_DEFAULT = AmbariPath.get("/var/lib/ambari-server/resources/stacks")
 
-    self.DEFAULT_VIEWS_DIR = "/var/lib/ambari-server/resources/views"
+    self.DEFAULT_VIEWS_DIR = AmbariPath.get("/var/lib/ambari-server/resources/views")
 
     #keytool commands
     self.keytool_bin_subpath = "bin/keytool"
@@ -523,6 +524,10 @@ def get_ambari_properties():
     properties = Properties()
     with open(conf_file) as hfR:
       properties.load(hfR)
+      
+    for k,v in properties.iteritems():
+      properties.__dict__[k] = v.replace("$ROOT", os.environ["ROOT"])
+      properties._props[k] = v.replace("$ROOT", os.environ["ROOT"])
   except (Exception), e:
     print 'Could not read "%s": %s' % (conf_file, e)
     return -1
@@ -571,7 +576,7 @@ def get_value_from_properties(properties, key, default=""):
 def get_views_dir(properties):
   views_dir = properties.get_property(VIEWS_DIR_PROPERTY)
   if views_dir is None or views_dir == "":
-    views_dirs = glob.glob("/var/lib/ambari-server/resources/views/work")
+    views_dirs = glob.glob(AmbariPath.get("/var/lib/ambari-server/resources/views/work"))
   else:
     views_dirs = glob.glob(views_dir + "/work")
   return views_dirs
@@ -579,7 +584,7 @@ def get_views_dir(properties):
 def get_admin_views_dir(properties):
   views_dir = properties.get_property(VIEWS_DIR_PROPERTY)
   if views_dir is None or views_dir == "":
-    views_dirs = glob.glob("/var/lib/ambari-server/resources/views/work/ADMIN_VIEW*")
+    views_dirs = glob.glob(AmbariPath.get("/var/lib/ambari-server/resources/views/work/ADMIN_VIEW*"))
   else:
     views_dirs = glob.glob(views_dir + "/work/ADMIN_VIEW*")
   return views_dirs
@@ -599,7 +604,7 @@ def get_is_persisted(properties):
 def get_credential_store_location(properties):
   store_loc = properties[SECURITY_KEYS_DIR]
   if store_loc is None or store_loc == "":
-    store_loc = "/var/lib/ambari-server/keys/credentials.jceks"
+    store_loc = AmbariPath.get("/var/lib/ambari-server/keys/credentials.jceks")
   else:
     store_loc += os.sep + "credentials.jceks"
   return store_loc

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/main/python/ambari_server/serverSetup.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py
index c370257..643aebd 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -45,7 +45,7 @@ from ambari_server.setupSecurity import adjust_directory_permissions
 from ambari_server.userInput import get_YN_input, get_validated_string_input
 from ambari_server.utils import locate_file
 from ambari_server.serverClassPath import ServerClassPath
-
+from ambari_server.ambariPath import AmbariPath
 
 # selinux commands
 GET_SE_LINUX_ST_CMD = locate_file('sestatus', '/usr/sbin')
@@ -310,7 +310,7 @@ class AmbariUserChecksLinux(AmbariUserChecks):
     self.NR_DEFAULT_USER = "root"
 
     self.NR_USERADD_CMD = 'useradd -M --comment "{1}" ' \
-                          '--shell %s -d /var/lib/ambari-server/keys/ {0}' % locate_file('nologin', '/sbin')
+                          '--shell %s ' % locate_file('nologin', '/sbin') + '-d ' + AmbariPath.get('/var/lib/ambari-server/keys/') + ' {0}'
 
   def _create_custom_user(self):
     user = get_validated_string_input(
@@ -960,7 +960,7 @@ def _reset_database(options):
   if persistence_type == "remote":
       err = 'Ambari doesn\'t support resetting exernal DB automatically. ' \
             'To reset Ambari Server schema you must first drop and then create it ' \
-            'using DDL scripts from "/var/lib/ambari-server/resources/"'
+            'using DDL scripts from "{0}"'.format(AmbariPath.get("/var/lib/ambari-server/resources/"))
       raise FatalException(1, err)
   else:
     factory = DBMSConfigFactory()

http://git-wip-us.apache.org/repos/asf/ambari/blob/0bd63c80/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index f52edc3..6c19d5e 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -45,6 +45,7 @@ with patch("platform.linux_distribution", return_value = os_distro_value):
   with patch("os.symlink"):
     with patch("__builtin__.open"):
       with patch("glob.glob", return_value = ['/etc/init.d/postgresql-9.3']):
+        os.environ["ROOT"] = ""
         _ambari_server_ = __import__('ambari-server')
 
         from ambari_commons.firewall import Firewall
@@ -6622,7 +6623,6 @@ class TestAmbariServer(TestCase):
     dbms = OracleConfig(args, properties, "local")
 
     self.assertTrue(decrypt_password_for_alias_method.called)
-    self.assertFalse(path_isabs_method.called)
     self.assertEquals("fakeuser", dbms.database_username)
     self.assertEquals("falepasswd", dbms.database_password)
 


[12/21] ambari git commit: AMBARI-15066. Spark History server does not start after downgrade due to missing spark-events directory (Jeff Zhang via alejandro)

Posted by dm...@apache.org.
AMBARI-15066. Spark History server does not start after downgrade due to missing spark-events directory (Jeff Zhang via alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a35b3c6dfb5733aef7119dd3b26e295db12d1882
Parents: b09994b
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Feb 18 11:35:05 2016 -0800
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu Feb 18 11:35:05 2016 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml | 13 +++++++------
 .../resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml  |  2 ++
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a35b3c6d/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
index 67bc0e7..8fd74e4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
@@ -320,6 +320,13 @@
         <task xsi:type="configure" id ="hdp_2_4_0_0_kafka_broker_deprecate_port"/>
       </execute-stage>
 
+      <!-- SPARK -->
+      <execute-stage service="SPARK" component="SPARK_JOBHISTORYSERVER" title="Apply config changes for Spark JobHistoryServer">
+        <task xsi:type="configure" id="hdp_2_4_0_0_spark_jobhistoryserver"/>
+      </execute-stage>
+      <execute-stage service="SPARK" component="SPARK_THRIFTSERVER" title="Apply config changes for Spark ThriftServer">
+        <task xsi:type="configure" id="hdp_2_4_0_0_spark_thriftserver"/>
+      </execute-stage>
     </group>
 
     <!-- Now, restart all of the services. -->
@@ -884,17 +891,11 @@
 
     <service name="SPARK">
       <component name="SPARK_JOBHISTORYSERVER">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hdp_2_4_0_0_spark_jobhistoryserver"/>
-        </pre-upgrade>
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
       </component>
       <component name="SPARK_THRIFTSERVER">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hdp_2_4_0_0_spark_thriftserver"/>
-        </pre-upgrade>
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a35b3c6d/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 42148b0..29ebc1f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -658,6 +658,7 @@
 
     <service name="SPARK">
       <component name="SPARK_JOBHISTORYSERVER">
+        <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_4_0_0_spark_jobhistoryserver"/>
         </pre-upgrade>
@@ -666,6 +667,7 @@
         </upgrade>
       </component>
       <component name="SPARK_THRIFTSERVER">
+        <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_4_0_0_spark_thriftserver"/>
         </pre-upgrade>


[02/21] ambari git commit: AMBARI-15086. SCRIPT alert params should tooltip the description (onechiporenko)

Posted by dm...@apache.org.
AMBARI-15086. SCRIPT alert params should tooltip the description (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2926a4ecd3526c3d15291633c287cb6cfcc75b50
Parents: f927149
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Feb 18 13:16:36 2016 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Feb 18 17:32:28 2016 +0200

----------------------------------------------------------------------
 .../alerts/definition_configs_controller.js     |  1 +
 .../alerts/configs/alert_config_parameter.hbs   |  2 +-
 .../main/alerts/definition_configs_view.js      | 10 +++++-
 .../test/controllers/wizard/step4_test.js       | 36 +++++++++++++-------
 ambari-web/test/utils/config_test.js            |  4 ---
 .../views/main/service/info/summary_test.js     |  4 +--
 6 files changed, 36 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
index 130434f..1b7fecf 100644
--- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
+++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
@@ -330,6 +330,7 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
       result.push(App.AlertConfigProperties.Parameter.create(mixin, {
         value: isWizard ? '' : parameter.get('value'),
         apiProperty: parameter.get('name'),
+        description: parameter.get('description'),
         label: isWizard ? '' : parameter.get('displayName'),
         threshold: isWizard ? '' : parameter.get('threshold'),
         units: isWizard ? '' : parameter.get('units'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
index fffa7bd..608dc59 100644
--- a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
+++ b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
@@ -24,7 +24,7 @@
         </span>&nbsp;
     </div>
   {{/if}}
-  <div {{bindAttr class="view.bigInput:span12:span3 view.property.units:input-append view.property.thresholdNotExists:stuck-left"}}>
+  <div rel="parameter-tooltip" {{bindAttr data-original-title="view.property.description" class="view.bigInput:span12:span3 view.property.units:input-append view.property.thresholdNotExists:stuck-left"}}>
     {{view Em.TextField valueBinding="view.property.value" disabledBinding="view.property.isDisabled" class ="view.bigInput:span12:span7"}}
     {{#if view.property.units}}
       <span class="add-on">{{view.property.units}}</span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/app/views/main/alerts/definition_configs_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alerts/definition_configs_view.js b/ambari-web/app/views/main/alerts/definition_configs_view.js
index 00e26d4..f3c77df 100644
--- a/ambari-web/app/views/main/alerts/definition_configs_view.js
+++ b/ambari-web/app/views/main/alerts/definition_configs_view.js
@@ -100,6 +100,14 @@ App.AlertConfigParameterView = Em.View.extend({
 
   bigInput: Em.computed.equal('property.type', 'STRING'),
 
-  classNameBindings: ['property.classNames', 'parentView.basicClass']
+  classNameBindings: ['property.classNames', 'parentView.basicClass'],
+
+  didInsertElement: function () {
+    App.tooltip($("[rel='parameter-tooltip']"));
+  },
+
+  willDestroyElement: function () {
+    $("[rel='parameter-tooltip']").tooltip('destroy');
+  }
 
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/test/controllers/wizard/step4_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index 7796d61..e88f4c3 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -646,19 +646,29 @@ describe('App.WizardStep4Controller', function () {
     });
 
     cases.forEach(function (item) {
-      it(item.title, function () {
-        controller.set('content', generateSelectedServicesContent(item.services));        
-        controller.serviceDependencyValidation();   
-        expect(controller.get('errorStack').mapProperty('id').contains("serviceCheck_"+item.dependentServices[0])).to.equal(true);        
-        expect(controller.get('errorStack').mapProperty('id').contains("serviceCheck_"+item.dependentServices[1])).to.equal(true);
-        controller.findProperty('serviceName', item.dependentServices[0]).set('isSelected', true);
-        
-        //simulate situation where user clicks cancel on error for first dependent service and then selects it in which case
-        //serviceDependencyValidation() will be called again
-        controller.serviceDependencyValidation();   
-        //error for first dependent service must be removed from errorStack array
-        expect(controller.get('errorStack').mapProperty('id').contains("serviceCheck_"+item.dependentServices[0])).to.equal(false);        
-        expect(controller.get('errorStack').mapProperty('id').contains("serviceCheck_"+item.dependentServices[1])).to.equal(true);
+      describe(item.title, function () {
+
+        beforeEach(function () {
+          controller.set('content', generateSelectedServicesContent(item.services));
+          controller.serviceDependencyValidation();
+        });
+
+        it('check errors in the stack', function () {
+          var ids = controller.get('errorStack').mapProperty('id');
+          expect(ids.contains("serviceCheck_" + item.dependentServices[0])).to.be.true;
+          expect(ids.contains("serviceCheck_" + item.dependentServices[1])).to.be.true;
+        });
+
+        it('simulate situation where user clicks cancel on error for first dependent service and then selects it in which case', function () {
+          controller.findProperty('serviceName', item.dependentServices[0]).set('isSelected', true);
+          //serviceDependencyValidation() will be called again
+          controller.serviceDependencyValidation();
+          //error for first dependent service must be removed from errorStack array
+          var ids = controller.get('errorStack').mapProperty('id');
+          expect(ids.contains("serviceCheck_" + item.dependentServices[0])).to.be.false;
+          expect(ids.contains("serviceCheck_" + item.dependentServices[1])).to.be.true;
+        });
+
       });
     });
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 18471a2..8dda9f6 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -23,10 +23,6 @@ require('utils/config');
 require('models/service/hdfs');
 var setups = require('test/init_model_test');
 
-function dummyCopy(val) {
-  return JSON.parse(JSON.stringify(val));
-}
-
 describe('App.config', function () {
 
   describe('#trimProperty',function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2926a4ec/ambari-web/test/views/main/service/info/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/info/summary_test.js b/ambari-web/test/views/main/service/info/summary_test.js
index 6a84bb6..d9fff97 100644
--- a/ambari-web/test/views/main/service/info/summary_test.js
+++ b/ambari-web/test/views/main/service/info/summary_test.js
@@ -667,7 +667,7 @@ describe('App.MainServiceInfoSummaryView', function() {
       });
       view.set('controller.widgets', [widget]);
       view.setTimeRange({context: {value: '0'}});
-      expect(widget.get('properties')['time_range']).to.equal('0')
+      expect(widget.get('properties').time_range).to.be.equal('0')
     });
 
     it("range = 1", function() {
@@ -679,7 +679,7 @@ describe('App.MainServiceInfoSummaryView', function() {
       });
       view.set('controller.widgets', [widget]);
       view.setTimeRange({context: {value: '1'}});
-      expect(widget.get('properties')['time_range']).to.equal('1')
+      expect(widget.get('properties').time_range).to.be.equal('1')
     });
   });
 


[18/21] ambari git commit: AMBARI-15067: Add custom commands for HAWQ to run check and clear cache(mithmatt via jaoki)

Posted by dm...@apache.org.
AMBARI-15067: Add custom commands for HAWQ to run check and clear cache(mithmatt via jaoki)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0941997b0f68f1044242354c9f3f0f4b3a476c7d
Parents: 183f71f
Author: Jun Aoki <ja...@apache.org>
Authored: Thu Feb 18 17:44:41 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Thu Feb 18 17:44:41 2016 -0800

----------------------------------------------------------------------
 .../common-services/HAWQ/2.0.0/metainfo.xml     | 16 +++++++
 .../2.0.0/package/scripts/hawq_constants.py     |  2 +-
 .../HAWQ/2.0.0/package/scripts/hawqmaster.py    | 19 +++++++++
 .../HAWQ/2.0.0/package/scripts/master_helper.py | 16 ++++---
 .../HAWQ/2.0.0/package/scripts/params.py        |  6 +++
 .../HAWQ/2.0.0/package/templates/hawq-hosts.j2  | 22 ----------
 .../HAWQ/2.0.0/package/templates/slaves.j2      | 22 ----------
 ambari-web/app/messages.js                      |  2 +
 ambari-web/app/models/host_component.js         | 44 ++++++++++++++------
 ambari-web/app/utils/helper.js                  | 20 +++++----
 ambari-web/app/views/main/service/item.js       |  2 +-
 11 files changed, 96 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
index 656d3a1..b77eb34 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
@@ -46,6 +46,22 @@
                 <timeout>1200</timeout>
               </commandScript>
             </customCommand>
+            <customCommand>
+              <name>HAWQ_CLEAR_CACHE</name>
+              <commandScript>
+                <script>scripts/hawqmaster.py</script>
+                <scriptType>PYTHON</scriptType>
+                <timeout>1200</timeout>
+              </commandScript>
+            </customCommand>
+            <customCommand>
+              <name>RUN_HAWQ_CHECK</name>
+              <commandScript>
+                <script>scripts/hawqmaster.py</script>
+                <scriptType>PYTHON</scriptType>
+                <timeout>1200</timeout>
+              </commandScript>
+            </customCommand>
           </customCommands>
           <dependencies>
             <dependency>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
index 9fdbde5..2a671da 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
@@ -47,7 +47,7 @@ sysctl_conf_dir = "/etc/sysctl.d"
 # Files
 hawq_slaves_file = os.path.join(hawq_config_dir, "slaves")
 hawq_greenplum_path_file = os.path.join(hawq_home_dir, "greenplum_path.sh")
-hawq_hosts_file = "/tmp/hawq_hosts"
+hawq_hosts_file = os.path.join(hawq_config_dir, "hawq_hosts")
 hawq_check_file = os.path.join(hawq_config_dir, "hawq_check.cnf")
 sysctl_suse_file = "/etc/sysctl.conf"
 sysctl_backup_file = "/etc/sysctl.conf.backup.{0}"

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
index d2f9ad0..3309561 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py
@@ -17,7 +17,13 @@ See the License for the specific language governing permissions and
 limitations under the License.
 """
 from resource_management import Script
+from resource_management.core.resources.system import Execute
+from resource_management.core.logger import Logger
 from resource_management.libraries.functions.check_process_status import check_process_status
+try:
+    from resource_management.libraries.functions import hdp_select as hadoop_select
+except ImportError:
+    from resource_management.libraries.functions import phd_select as hadoop_select
 
 import master_helper
 import common
@@ -54,5 +60,18 @@ class HawqMaster(Script):
   def immediate_stop_hawq_service(self, env):
     master_helper.stop(hawq_constants.IMMEDIATE, hawq_constants.CLUSTER)
 
+  def hawq_clear_cache(self, env):
+    import params
+    from utils import exec_psql_cmd
+    cmd = "SELECT gp_metadata_cache_clear()"
+    Logger.info("Clearing HAWQ's HDFS Metadata cache ...")
+    exec_psql_cmd(cmd, params.hawqmaster_host, params.hawq_master_address_port)
+
+  def run_hawq_check(self, env):
+    Logger.info("Executing HAWQ Check ...")
+    Execute("source {0} && hawq check -f {1} --hadoop {2} --config {3}".format(hawq_constants.hawq_greenplum_path_file, hawq_constants.hawq_hosts_file, hadoop_select.get_hadoop_dir('home'), hawq_constants.hawq_check_file),
+            user=hawq_constants.hawq_user,
+            timeout=hawq_constants.default_exec_timeout)
+
 if __name__ == "__main__":
   HawqMaster().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
index c5f891b..9482b35 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
@@ -18,7 +18,7 @@ limitations under the License.
 import os
 import sys
 from resource_management.core.resources.system import File, Execute
-from resource_management.core.source import Template
+from resource_management.core.source import InlineTemplate
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format
@@ -34,14 +34,14 @@ def __setup_master_specific_conf_files():
   """
   import params
 
-  File(hawq_constants.hawq_check_file, content=params.hawq_check_content, owner=hawq_constants.hawq_user, group=hawq_constants.hawq_group,
-      mode=0644)
+  params.File(hawq_constants.hawq_check_file,
+              content=params.hawq_check_content)
 
-  File(hawq_constants.hawq_slaves_file, content=Template("slaves.j2"), owner=hawq_constants.hawq_user, group=hawq_constants.hawq_group,
-       mode=0644)
+  params.File(hawq_constants.hawq_slaves_file,
+              content=InlineTemplate("{% for host in hawqsegment_hosts %}{{host}}\n{% endfor %}"))
 
-  File(hawq_constants.hawq_hosts_file, content=Template("hawq-hosts.j2"), owner=hawq_constants.hawq_user, group=hawq_constants.hawq_group,
-       mode=0644)
+  params.File(hawq_constants.hawq_hosts_file,
+              content=InlineTemplate("{% for host in hawq_all_hosts %}{{host}}\n{% endfor %}"))
 
 
 def __setup_passwordless_ssh():
@@ -51,8 +51,6 @@ def __setup_passwordless_ssh():
   import params
   utils.exec_hawq_operation("ssh-exkeys", format('-f {hawq_hosts_file} -p {hawq_password!p}', hawq_hosts_file=hawq_constants.hawq_hosts_file, hawq_password=params.hawq_password))
 
-  File(hawq_constants.hawq_hosts_file, action='delete')
-
 
 def configure_master():
   """

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
index 74c9813..7633731 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
@@ -19,6 +19,7 @@ limitations under the License.
 import functools
 import hawq_constants
 from resource_management import Script
+from resource_management.core.resources.system import File
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.resources.xml_config import XmlConfig
@@ -75,6 +76,11 @@ HdfsResource = functools.partial(HdfsResource,
                                  hdfs_site=hdfs_site,
                                  default_fs=default_fs)
 
+# File partial function
+File = functools.partial(File,
+                         owner=hawq_constants.hawq_user,
+                         group=hawq_constants.hawq_group,
+                         mode=0644)
 
 # XMLConfig partial function
 XmlConfig = functools.partial(XmlConfig,

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2 b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
deleted file mode 100644
index e093375..0000000
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-{% for host in hawq_all_hosts %}
-{{host}}
-{% endfor %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/slaves.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/slaves.j2 b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/slaves.j2
deleted file mode 100644
index 0435b3e..0000000
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/slaves.j2
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-{% for host in hawqsegment_hosts %}
-{{host}}
-{% endfor %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9d24b4f..1b08248 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1690,6 +1690,8 @@ Em.I18n.translations = {
   'services.service.actions.run.immediateStopHawqSegment.context':'Stop HAWQ Segment (Immediate Mode)',
   'services.service.actions.run.resyncHawqStandby.context':'Re-Sync HAWQ Standby',
   'services.service.actions.run.resyncHawqStandby.label':'Re-Synchronize HAWQ Standby',
+  'services.service.actions.run.clearHawqCache.label':'Clear HAWQ\'s HDFS Metadata Cache',
+  'services.service.actions.run.runHawqCheck.label':'Run HAWQ Check',
   'services.service.actions.manage_configuration_groups.short':'Manage Config Groups',
   'services.service.actions.serviceActions':'Service Actions',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index d3d4ab9..61a51cd 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -375,6 +375,12 @@ App.HostComponentActionMap = {
         hasSubmenu: ctx.get('controller.isSeveralClients'),
         submenuOptions: ctx.get('controller.clientComponents')
       },
+      DELETE_SERVICE: {
+        action: 'deleteService',
+        context: ctx.get('serviceName'),
+        label: Em.I18n.t('common.delete'),
+        cssClass: 'icon-remove'
+      },
       IMMEDIATE_STOP_HAWQ_SERVICE: {
         action: 'executeHawqCustomCommand',
         customCommand: 'IMMEDIATE_STOP_HAWQ_SERVICE',
@@ -398,18 +404,6 @@ App.HostComponentActionMap = {
         isHidden : App.get('isSingleNode') || !HS ,
         disabled: !((!!HMComponent && HMComponent.get('startedCount') === 1) && (!!HS && HS.get('workStatus') === App.HostComponentStatus.started))
       },
-      MASTER_CUSTOM_COMMAND: {
-        action: 'executeCustomCommand',
-        cssClass: 'icon-play-circle',
-        isHidden: false,
-        disabled: false
-      },
-      DELETE_SERVICE: {
-        action: 'deleteService',
-        context: ctx.get('serviceName'),
-        label: Em.I18n.t('common.delete'),
-        cssClass: 'icon-remove'
-      },
       TOGGLE_ADD_HAWQ_STANDBY: {
         action: 'addHawqStandby',
         label: Em.I18n.t('admin.addHawqStandby.button.enable'),
@@ -424,7 +418,31 @@ App.HostComponentActionMap = {
         cssClass: 'icon-arrow-up',
         isHidden: App.get('isSingleNode') || !HS,
         disabled: false
-       }
+      },
+      HAWQ_CLEAR_CACHE: {
+        action: 'executeHawqCustomCommand',
+        customCommand: 'HAWQ_CLEAR_CACHE',
+        context: Em.I18n.t('services.service.actions.run.clearHawqCache.label'),
+        label: Em.I18n.t('services.service.actions.run.clearHawqCache.label'),
+        cssClass: 'icon-refresh',
+        isHidden : false,
+        disabled: !HM || HM.get('workStatus') != App.HostComponentStatus.started
+      },
+      RUN_HAWQ_CHECK: {
+        action: 'executeHawqCustomCommand',
+        customCommand: 'RUN_HAWQ_CHECK',
+        context: Em.I18n.t('services.service.actions.run.runHawqCheck.label'),
+        label: Em.I18n.t('services.service.actions.run.runHawqCheck.label'),
+        cssClass: 'icon-thumbs-up-alt',
+        isHidden : false,
+        disabled: false
+      },
+      MASTER_CUSTOM_COMMAND: {
+        action: 'executeCustomCommand',
+        cssClass: 'icon-play-circle',
+        isHidden: false,
+        disabled: false
+      }
     };
   }
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-web/app/utils/helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index 8f4985f..ff5fe11 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -661,16 +661,22 @@ App.format = {
     }
  // HAWQ custom commands on back Ops page.
     if (result === ' Resync Hawq Standby HAWQ Standby Master') {
-        result = Em.I18n.t('services.service.actions.run.resyncHawqStandby.label');
-     }
+      result = Em.I18n.t('services.service.actions.run.resyncHawqStandby.label');
+    }
     if (result === ' Immediate Stop Hawq Service HAWQ Master') {
-        result = Em.I18n.t('services.service.actions.run.immediateStopHawqService.label');
-     }
+      result = Em.I18n.t('services.service.actions.run.immediateStopHawqService.label');
+    }
     if (result === ' Immediate Stop Hawq Segment HAWQ Segment') {
-        result = Em.I18n.t('services.service.actions.run.immediateStopHawqSegment.label');
-     }
+      result = Em.I18n.t('services.service.actions.run.immediateStopHawqSegment.label');
+    }
     if(result === ' Activate Hawq Standby HAWQ Standby Master') {
-        result = Em.I18n.t('admin.activateHawqStandby.button.enable');
+      result = Em.I18n.t('admin.activateHawqStandby.button.enable');
+    }
+    if(result === ' Hawq Clear Cache HAWQ Master') {
+      result = Em.I18n.t('services.service.actions.run.clearHawqCache.label');
+    }
+    if(result === ' Run Hawq Check HAWQ Master') {
+      result = Em.I18n.t('services.service.actions.run.runHawqCheck.label');
     }
     //<---End HAWQ custom commands--->
     return result;

http://git-wip-us.apache.org/repos/asf/ambari/blob/0941997b/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index e74a588..020048b 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -35,7 +35,7 @@ App.MainServiceItemView = Em.View.extend({
     'RESOURCEMANAGER': ['DECOMMISSION', 'REFRESHQUEUES'],
     'HBASE_MASTER': ['DECOMMISSION'],
     'KNOX_GATEWAY': ['STARTDEMOLDAP','STOPDEMOLDAP'],
-    'HAWQMASTER': ['IMMEDIATE_STOP_HAWQ_SERVICE'],
+    'HAWQMASTER': ['IMMEDIATE_STOP_HAWQ_SERVICE', 'RUN_HAWQ_CHECK', 'HAWQ_CLEAR_CACHE'],
     'HAWQSEGMENT': ['IMMEDIATE_STOP_HAWQ_SEGMENT'],
     'HAWQSTANDBY' : ['RESYNC_HAWQ_STANDBY','ACTIVATE_HAWQ_STANDBY']
   },


[15/21] ambari git commit: AMBARI-15080. HBase unittest fails when using python 2.6(Lav Jain via odiachenko).

Posted by dm...@apache.org.
AMBARI-15080. HBase unittest fails when using python 2.6(Lav Jain via odiachenko).


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: defbeddae55d110b3323b389c2666071eec6883d
Parents: 6d121dd
Author: Oleksandr Diachenko <od...@pivotal.io>
Authored: Thu Feb 18 13:54:05 2016 -0800
Committer: Oleksandr Diachenko <od...@pivotal.io>
Committed: Thu Feb 18 13:54:05 2016 -0800

----------------------------------------------------------------------
 .../python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/defbedda/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
index 7722af0..6c3ad89 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_phoenix_queryserver.py
@@ -18,7 +18,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 import json
-from unittest import SkipTest
+import sys
+import unittest
 
 from mock.mock import MagicMock, patch
 from stacks.utils.RMFTestCase import *
@@ -152,7 +153,11 @@ class TestPhoenixQueryServer(RMFTestCase):
     self.assertNoMoreResources()
 
   def test_start_default_24(self):
-    raise SkipTest("there's nothing to upgrade to yet")
+    if sys.version_info >= (2, 7):
+      raise unittest.SkipTest("there's nothing to upgrade to yet")
+    else:
+      # skiptest functionality is not available with Python 2.6 unittest
+      return
 
     self.executeScript(
       self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/phoenix_queryserver.py",


[10/21] ambari git commit: AMBARI-15064. RU/EU can't start if hosts have name in MixedCASE in configs for NameNode, HBASE Master, ResourceManager (alejandro)

Posted by dm...@apache.org.
AMBARI-15064. RU/EU can't start if hosts have name in MixedCASE in configs for NameNode, HBASE Master, ResourceManager (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8f58e5f97e0e6c7853956ad4f48d45603cee9d7f
Parents: 7da4706
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Feb 18 11:21:04 2016 -0800
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu Feb 18 11:21:16 2016 -0800

----------------------------------------------------------------------
 .../controller/AmbariActionExecutionHelper.java |  13 +-
 .../internal/UpgradeResourceProvider.java       |   1 +
 .../ambari/server/stack/MasterHostResolver.java |  53 +++++--
 .../AmbariManagementControllerTest.java         |   2 +-
 .../ambari/server/state/UpgradeHelperTest.java  | 140 +++++++++++++++++--
 5 files changed, 178 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f58e5f9/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
index 795dfa7..88180c0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
@@ -262,6 +262,13 @@ public class AmbariActionExecutionHelper {
     final String serviceName = actionContext.getExpectedServiceName();
     final String componentName = actionContext.getExpectedComponentName();
 
+    LOG.debug("Called addExecutionCommandsToStage() for serviceName: {}, componentName: {}.", serviceName, componentName);
+    if (resourceFilter.getHostNames().isEmpty()) {
+      LOG.debug("Resource filter has no hostnames.");
+    } else {
+      LOG.debug("Resource filter has hosts: {}", StringUtils.join(resourceFilter.getHostNames(), ", "));
+    }
+
     if (null != cluster) {
       StackId stackId = cluster.getCurrentStackVersion();
       if (serviceName != null && !serviceName.isEmpty()) {
@@ -275,6 +282,7 @@ public class AmbariActionExecutionHelper {
                 stackId.getStackVersion(), serviceName, componentName);
           } catch (ObjectNotFoundException e) {
             // do nothing, componentId is checked for null later
+            LOG.error("Did not find service {} and component {} in stack {}.", serviceName, componentName, stackId.getStackName());
           }
         } else {
           for (String component : cluster.getService(serviceName).getServiceComponents().keySet()) {
@@ -288,6 +296,7 @@ public class AmbariActionExecutionHelper {
         // All hosts are valid target host
         candidateHosts.addAll(clusters.getHostsForCluster(cluster.getClusterName()).keySet());
       }
+      LOG.debug("Request for service {} and component {} is set to run on candidate hosts: {}.", serviceName, componentName, StringUtils.join(candidateHosts, ", "));
 
       // Filter hosts that are in MS
       Set<String> ignoredHosts = maintenanceStateHelper.filterHostsInMaintenanceState(
@@ -301,7 +310,9 @@ public class AmbariActionExecutionHelper {
                 }
               }
       );
+
       if (! ignoredHosts.isEmpty()) {
+        LOG.debug("Hosts to ignore: {}.", StringUtils.join(ignoredHosts, ", "));
         LOG.debug("Ignoring action for hosts due to maintenance state." +
             "Ignored hosts =" + ignoredHosts + ", component="
             + componentName + ", service=" + serviceName
@@ -323,7 +334,7 @@ public class AmbariActionExecutionHelper {
       for (String hostname : resourceFilter.getHostNames()) {
         if (!candidateHosts.contains(hostname)) {
           throw new AmbariException("Request specifies host " + hostname +
-            " but its not a valid host based on the " +
+            " but it is not a valid host based on the " +
             "target service=" + serviceName + " and component=" + componentName);
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f58e5f9/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 70440fc..e5664c2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -1175,6 +1175,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     RequestResourceFilter filter = new RequestResourceFilter("", "",
         new ArrayList<String>(wrapper.getHosts()));
 
+    LOG.debug("Analyzing upgrade item {} with tasks: {}.", entity.getText(), entity.getTasks());
     Map<String, String> params = getNewParameterMap();
     params.put(COMMAND_PARAM_TASKS, entity.getTasks());
     params.put(COMMAND_PARAM_VERSION, context.getVersion());

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f58e5f9/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
index 561350b..360f2b8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
@@ -63,7 +63,7 @@ public class MasterHostResolver {
   /**
    * Union of status for several services.
    */
-  enum Status {
+  protected enum Status {
     ACTIVE,
     STANDBY
   }
@@ -247,11 +247,11 @@ public class MasterHostResolver {
     return false;
   }
 
-
   /**
    * Get mapping of the HDFS Namenodes from the state ("active" or "standby") to the hostname.
    * @return Returns a map from the state ("active" or "standby" to the hostname with that state if exactly
    * one active and one standby host were found, otherwise, return null.
+   * The hostnames are returned in lowercase.
    */
   private Map<Status, String> getNameNodePair() {
     Map<Status, String> stateToHost = new HashMap<Status, String>();
@@ -291,7 +291,9 @@ public class MasterHostResolver {
 
         if (null != state && (state.equalsIgnoreCase(Status.ACTIVE.toString()) || state.equalsIgnoreCase(Status.STANDBY.toString()))) {
           Status status = Status.valueOf(state.toUpperCase());
-          stateToHost.put(status, hp.host);
+          stateToHost.put(status, hp.host.toLowerCase());
+        } else {
+          LOG.error(String.format("Could not retrieve state for NameNode %s from property %s by querying JMX.", hp.host, key));
         }
       } catch (MalformedURLException e) {
         LOG.error(e.getMessage());
@@ -304,6 +306,12 @@ public class MasterHostResolver {
     return null;
   }
 
+  /**
+   * Resolve the name of the Resource Manager master and convert the hostname to lowercase.
+   * @param cluster Cluster
+   * @param hostType RM hosts
+   * @throws MalformedURLException
+   */
   private void resolveResourceManagers(Cluster cluster, HostsType hostType) throws MalformedURLException {
     LinkedHashSet<String> orderedHosts = new LinkedHashSet<String>(hostType.hosts);
 
@@ -320,18 +328,24 @@ public class MasterHostResolver {
 
       if (null != value) {
         if (null == hostType.master) {
-          hostType.master = hostname;
+          hostType.master = hostname.toLowerCase();
         }
 
         // Quick and dirty to make sure the master is last in the list
-        orderedHosts.remove(hostname);
-        orderedHosts.add(hostname);
+        orderedHosts.remove(hostname.toLowerCase());
+        orderedHosts.add(hostname.toLowerCase());
       }
 
     }
     hostType.hosts = orderedHosts;
   }
 
+  /**
+   * Resolve the HBASE master and convert the hostname to lowercase.
+   * @param cluster Cluster
+   * @param hostsType HBASE master host.
+   * @throws AmbariException
+   */
   private void resolveHBaseMasters(Cluster cluster, HostsType hostsType) throws AmbariException {
     String hbaseMasterInfoPortProperty = "hbase.master.info.port";
     String hbaseMasterInfoPortValue = m_configHelper.getValueFromDesiredConfigurations(cluster, ConfigHelper.HBASE_SITE, hbaseMasterInfoPortProperty);
@@ -348,22 +362,31 @@ public class MasterHostResolver {
       if (null != value) {
         Boolean bool = Boolean.valueOf(value);
         if (bool.booleanValue()) {
-          hostsType.master = hostname;
+          hostsType.master = hostname.toLowerCase();
         } else {
-          hostsType.secondary = hostname;
+          hostsType.secondary = hostname.toLowerCase();
         }
       }
-
     }
   }
 
-  private String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName,
-                                   boolean asQuery) {
+  protected String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName,
+                                  boolean asQuery) {
     return queryJmxBeanValue(hostname, port, beanName, attributeName, asQuery, false);
   }
 
-  private String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName,
-      boolean asQuery, boolean encrypted) {
+  /**
+   * Query the JMX attribute at http(s)://$server:$port/jmx?qry=$query or http(s)://$server:$port/jmx?get=$bean::$attribute
+   * @param hostname host name
+   * @param port port number
+   * @param beanName if asQuery is false, then search for this bean name
+   * @param attributeName if asQuery is false, then search for this attribute name
+   * @param asQuery whether to search bean or query
+   * @param encrypted true if using https instead of http.
+   * @return The jmx value.
+   */
+  protected String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName,
+                                  boolean asQuery, boolean encrypted) {
 
     String protocol = encrypted ? "https://" : "http://";
     String endPoint = protocol + (asQuery ?
@@ -385,9 +408,9 @@ public class MasterHostResolver {
       return jmxBeans.get("beans").get(0).get(attributeName);
     } catch (Exception e) {
       if (LOG.isDebugEnabled()) {
-        LOG.info("Could not load JMX from {}/{} from {}", beanName, attributeName, hostname, e);
+        LOG.debug("Could not load JMX from {}/{} from {}", beanName, attributeName, hostname, e);
       } else {
-        LOG.info("Could not load JMX from {}/{} from {}", beanName, attributeName, hostname);
+        LOG.debug("Could not load JMX from {}/{} from {}", beanName, attributeName, hostname);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f58e5f9/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index a0ac966..ffee3fa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -4650,7 +4650,7 @@ public class AmbariManagementControllerTest {
 
     actionRequest = new ExecuteActionRequest("c1", null, "a2", resourceFilters, null, params, false);
     expectActionCreationErrorWithMessage(actionRequest, requestProperties,
-        "Request specifies host h6 but its not a valid host based on the target service=HDFS and component=DATANODE");
+        "Request specifies host h6 but it is not a valid host based on the target service=HDFS and component=DATANODE");
 
     hosts.clear();
     hosts.add("h1");

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f58e5f9/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
index eb5bf62..4ea8f15 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
@@ -95,21 +95,23 @@ public class UpgradeHelperTest {
   private AmbariManagementController m_managementController;
   private Gson m_gson = new Gson();
 
-  @Before
-  public void before() throws Exception {
+  /**
+   * Because test cases need to share config mocks, put common ones in this function.
+   * @throws Exception
+   */
+  private void setConfigMocks() throws Exception {
     // configure the mock to return data given a specific placeholder
     m_configHelper = EasyMock.createNiceMock(ConfigHelper.class);
+    expect(m_configHelper.getPlaceholderValueFromDesiredConfigurations(
+        EasyMock.anyObject(Cluster.class), EasyMock.eq("{{foo/bar}}"))).andReturn("placeholder-rendered-properly").anyTimes();
+    expect(m_configHelper.getEffectiveDesiredTags(
+        EasyMock.anyObject(Cluster.class), EasyMock.anyObject(String.class))).andReturn(new HashMap<String, Map<String, String>>()).anyTimes();
+  }
 
-    expect(
-      m_configHelper.getPlaceholderValueFromDesiredConfigurations(
-        EasyMock.anyObject(Cluster.class), EasyMock.eq("{{foo/bar}}"))).andReturn(
-        "placeholder-rendered-properly").anyTimes();
-
-    expect(
-        m_configHelper.getEffectiveDesiredTags(
-            EasyMock.anyObject(Cluster.class), EasyMock.anyObject(String.class))).
-        andReturn(new HashMap<String, Map<String, String>>()).anyTimes();
-
+  @Before
+  public void before() throws Exception {
+    setConfigMocks();
+    // Most test cases can replay the common config mocks. If any test case needs custom ones, it can re-initialize m_configHelper;
     replay(m_configHelper);
 
     final InMemoryDefaultTestModule injectorModule = new InMemoryDefaultTestModule() {
@@ -1244,7 +1246,7 @@ public class UpgradeHelperTest {
     Service s = c.getService("ZOOKEEPER");
     ServiceComponent sc = s.addServiceComponent("ZOOKEEPER_SERVER");
 
-    ServiceComponentHost sch1 =sc.addServiceComponentHost("h1");
+    ServiceComponentHost sch1 = sc.addServiceComponentHost("h1");
     sch1.setVersion("2.1.1.0-1234");
 
     ServiceComponentHost sch2 = sc.addServiceComponentHost("h2");
@@ -1252,7 +1254,6 @@ public class UpgradeHelperTest {
 
     List<ServiceComponentHost> schs = c.getServiceComponentHosts("ZOOKEEPER", "ZOOKEEPER_SERVER");
     assertEquals(2, schs.size());
-
     MasterHostResolver mhr = new MasterHostResolver(null, c, "2.1.1.0-1234");
 
     HostsType ht = mhr.getMasterAndHosts("ZOOKEEPER", "ZOOKEEPER_SERVER");
@@ -1267,6 +1268,117 @@ public class UpgradeHelperTest {
     assertEquals("h2", ht.hosts.iterator().next());
   }
 
+  /**
+   * Test that MasterHostResolver is case-insensitive even if configs have hosts in upper case for NameNode.
+   * @throws Exception
+   */
+  @Test
+  public void testResolverCaseInsensitive() throws Exception {
+    Clusters clusters = injector.getInstance(Clusters.class);
+    ServiceFactory serviceFactory = injector.getInstance(ServiceFactory.class);
+
+    String clusterName = "c1";
+    String version = "2.1.1.0-1234";
+
+    StackId stackId = new StackId("HDP-2.1.1");
+    clusters.addCluster(clusterName, stackId);
+    Cluster c = clusters.getCluster(clusterName);
+
+    helper.getOrCreateRepositoryVersion(stackId,
+        c.getDesiredStackVersion().getStackVersion());
+
+    c.createClusterVersion(stackId,
+        c.getDesiredStackVersion().getStackVersion(), "admin",
+        RepositoryVersionState.UPGRADING);
+
+    for (int i = 0; i < 2; i++) {
+      String hostName = "h" + (i+1);
+      clusters.addHost(hostName);
+      Host host = clusters.getHost(hostName);
+
+      Map<String, String> hostAttributes = new HashMap<String, String>();
+      hostAttributes.put("os_family", "redhat");
+      hostAttributes.put("os_release_version", "6");
+
+      host.setHostAttributes(hostAttributes);
+
+      host.persist();
+      clusters.mapHostToCluster(hostName, clusterName);
+    }
+
+    // Add services
+    c.addService(serviceFactory.createNew(c, "HDFS"));
+
+    Service s = c.getService("HDFS");
+    ServiceComponent sc = s.addServiceComponent("NAMENODE");
+    sc.addServiceComponentHost("h1");
+    sc.addServiceComponentHost("h2");
+
+    List<ServiceComponentHost> schs = c.getServiceComponentHosts("HDFS", "NAMENODE");
+    assertEquals(2, schs.size());
+
+    setConfigMocks();
+    expect(m_configHelper.getValueFromDesiredConfigurations(c, "hdfs-site", "dfs.nameservices")).andReturn("ha").anyTimes();
+    expect(m_configHelper.getValueFromDesiredConfigurations(c, "hdfs-site", "dfs.ha.namenodes.ha")).andReturn("nn1,nn2").anyTimes();
+    expect(m_configHelper.getValueFromDesiredConfigurations(c, "hdfs-site", "dfs.http.policy")).andReturn("HTTP_ONLY").anyTimes();
+
+    // Notice that these names are all caps.
+    expect(m_configHelper.getValueFromDesiredConfigurations(c, "hdfs-site", "dfs.namenode.http-address.ha.nn1")).andReturn("H1:50070").anyTimes();
+    expect(m_configHelper.getValueFromDesiredConfigurations(c, "hdfs-site", "dfs.namenode.http-address.ha.nn2")).andReturn("H2:50070").anyTimes();
+    replay(m_configHelper);
+
+    MasterHostResolver mhr = new MockMasterHostResolver(m_configHelper, c, version);
+
+    HostsType ht = mhr.getMasterAndHosts("HDFS", "NAMENODE");
+    assertNotNull(ht.master);
+    assertNotNull(ht.secondary);
+    assertEquals(2, ht.hosts.size());
+
+    // Should be stored in lowercase.
+    assertTrue(ht.hosts.contains("h1"));
+    assertTrue(ht.hosts.contains("h1"));
+  }
+
+  /**
+   * Extend {@link org.apache.ambari.server.stack.MasterHostResolver} in order to overwrite the JMX methods.
+   */
+  private class MockMasterHostResolver extends MasterHostResolver {
+
+    public MockMasterHostResolver(ConfigHelper configHelper, Cluster cluster) {
+      this(configHelper, cluster, null);
+    }
+
+    public MockMasterHostResolver(ConfigHelper configHelper, Cluster cluster, String version) {
+      super(configHelper, cluster, version);
+    }
+
+    /**
+     * Mock the call to get JMX Values.
+     * @param hostname host name
+     * @param port port number
+     * @param beanName if asQuery is false, then search for this bean name
+     * @param attributeName if asQuery is false, then search for this attribute name
+     * @param asQuery whether to search bean or query
+     * @param encrypted true if using https instead of http.
+     * @return
+     */
+    @Override
+    public String queryJmxBeanValue(String hostname, int port, String beanName, String attributeName,
+                                    boolean asQuery, boolean encrypted) {
+
+      if (beanName.equalsIgnoreCase("Hadoop:service=NameNode,name=NameNodeStatus") && attributeName.equalsIgnoreCase("State") && asQuery) {
+        switch (hostname) {
+          case "H1":
+            return Status.ACTIVE.toString();
+          case "H2":
+            return Status.STANDBY.toString();
+          default:
+            return "UNKNOWN_NAMENODE_STATUS_FOR_THIS_HOST";
+        }
+      }
+      return  "NOT_MOCKED";
+    }
+  }
 
   private class MockModule implements Module {
 


[07/21] ambari git commit: AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)

Posted by dm...@apache.org.
AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fab9fa5d89a188719aa1c873123a94995e1c8aa3
Parents: 260419b
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 18 19:23:54 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 18 19:24:10 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari_server/ambariPath.py | 4 +++-
 ambari-server/src/test/python/TestAmbariServer.py         | 2 +-
 ambari-server/src/test/python/TestBackupRestore.py        | 3 +++
 ambari-server/src/test/python/TestResourceFilesKeeper.py  | 3 +++
 ambari-server/src/test/python/TestServerClassPath.py      | 3 +++
 ambari-server/src/test/python/TestServerUpgrade.py        | 2 ++
 ambari-server/src/test/python/TestServerUtils.py          | 3 +++
 7 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/main/python/ambari_server/ambariPath.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/ambariPath.py b/ambari-server/src/main/python/ambari_server/ambariPath.py
index 9d68206..1d57558 100644
--- a/ambari-server/src/main/python/ambari_server/ambariPath.py
+++ b/ambari-server/src/main/python/ambari_server/ambariPath.py
@@ -21,6 +21,7 @@ Ambari Agent
 """
 
 import os
+import re
 
 AMBARI_SERVER_ROOT_ENV_VARIABLE = "ROOT"
 
@@ -34,6 +35,7 @@ class AmbariPath():
     Which is needed for the situations when ambari-server installed not in / but in other folder like /opt.
     Not ambari paths like /var/run/postgresql SHOULD NOT wrapped by this call though.
     """
-    return os.path.realpath(AmbariPath.root_directory + os.sep + path)
+    #return os.path.realpath(AmbariPath.root_directory + os.sep + path) # realpath won't replace slashes for python2.6
+    return re.sub('/+', '/', AmbariPath.root_directory + os.sep + path)
     
   
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index 6c19d5e..c47cc67 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -34,6 +34,7 @@ import stat
 import StringIO
 import tempfile
 from unittest import TestCase
+os.environ["ROOT"] = ""
 
 from only_for_platform import get_platform, not_for_platform, only_for_platform, os_distro_value, PLATFORM_LINUX, PLATFORM_WINDOWS
 
@@ -45,7 +46,6 @@ with patch("platform.linux_distribution", return_value = os_distro_value):
   with patch("os.symlink"):
     with patch("__builtin__.open"):
       with patch("glob.glob", return_value = ['/etc/init.d/postgresql-9.3']):
-        os.environ["ROOT"] = ""
         _ambari_server_ = __import__('ambari-server')
 
         from ambari_commons.firewall import Firewall

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestBackupRestore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestBackupRestore.py b/ambari-server/src/test/python/TestBackupRestore.py
index 8a377ec..ab37ca1 100644
--- a/ambari-server/src/test/python/TestBackupRestore.py
+++ b/ambari-server/src/test/python/TestBackupRestore.py
@@ -19,6 +19,9 @@ limitations under the License.
 
 import unittest
 
+import os
+os.environ["ROOT"] = ""
+
 import mock
 from mock.mock import MagicMock, patch
 from ambari_server import BackupRestore

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestResourceFilesKeeper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestResourceFilesKeeper.py b/ambari-server/src/test/python/TestResourceFilesKeeper.py
index f6efeb6..966d3b1 100644
--- a/ambari-server/src/test/python/TestResourceFilesKeeper.py
+++ b/ambari-server/src/test/python/TestResourceFilesKeeper.py
@@ -16,6 +16,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+import os
+os.environ["ROOT"] = ""
+
 import time
 import subprocess
 import os

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestServerClassPath.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestServerClassPath.py b/ambari-server/src/test/python/TestServerClassPath.py
index e6c5ca8..7ec36da 100644
--- a/ambari-server/src/test/python/TestServerClassPath.py
+++ b/ambari-server/src/test/python/TestServerClassPath.py
@@ -17,6 +17,9 @@ limitations under the License.
 '''
 
 import os
+os.environ["ROOT"] = ""
+
+import os
 from mock.mock import patch, MagicMock
 from unittest import TestCase
 from ambari_server.properties import Properties

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestServerUpgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestServerUpgrade.py b/ambari-server/src/test/python/TestServerUpgrade.py
index f728669..05a7c6b 100644
--- a/ambari-server/src/test/python/TestServerUpgrade.py
+++ b/ambari-server/src/test/python/TestServerUpgrade.py
@@ -16,6 +16,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+import os
+os.environ["ROOT"] = ""
 import StringIO
 import sys
 from ambari_commons.exceptions import FatalException

http://git-wip-us.apache.org/repos/asf/ambari/blob/fab9fa5d/ambari-server/src/test/python/TestServerUtils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestServerUtils.py b/ambari-server/src/test/python/TestServerUtils.py
index 474a83d..70d8f5a 100644
--- a/ambari-server/src/test/python/TestServerUtils.py
+++ b/ambari-server/src/test/python/TestServerUtils.py
@@ -16,6 +16,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+import os
+os.environ["ROOT"] = ""
+
 from unittest import TestCase
 from ambari_server.serverUtils import get_ambari_server_api_base
 from ambari_server.serverConfiguration import CLIENT_API_PORT, CLIENT_API_PORT_PROPERTY, SSL_API, DEFAULT_SSL_API_PORT, SSL_API_PORT


[05/21] ambari git commit: AMBARI-15089 Refactor create configs JSON methods for saving. (ababiichuk)

Posted by dm...@apache.org.
AMBARI-15089 Refactor create configs JSON methods for saving. (ababiichuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0a9101e97c21b5bb5f25a84d264176a86f159f2e
Parents: 0bd63c8
Author: ababiichuk <ab...@hortonworks.com>
Authored: Thu Feb 18 15:21:07 2016 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Feb 18 18:54:01 2016 +0200

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js  | 240 ++++++-------------
 .../mixins/common/configs/configs_comparator.js |   4 +-
 .../app/mixins/common/configs/configs_saver.js  | 217 +++++++----------
 .../test/controllers/wizard/step8_test.js       | 176 +-------------
 .../mixins/common/configs/configs_saver_test.js |  98 ++++----
 5 files changed, 225 insertions(+), 510 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9101e9/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 0ac998b..911d0a8 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -18,13 +18,27 @@
 
 var App = require('app');
 var stringUtils = require('utils/string_utils');
-var dataManipulationUtils = require('utils/data_manipulation');
 
-App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wizardDeployProgressControllerMixin, App.ConfigOverridable, {
+App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wizardDeployProgressControllerMixin, App.ConfigOverridable, App.ConfigsSaverMixin, {
 
   name: 'wizardStep8Controller',
 
   /**
+   * @type {boolean}
+   */
+  isAddService: Em.computed.equal('content.controllerName', 'addServiceController'),
+
+  /**
+   * @type {boolean}
+   */
+  isAddHost: Em.computed.equal('content.controllerName', 'addHostController'),
+
+  /**
+   * @type {boolean}
+   */
+  isInstaller: Em.computed.equal('content.controllerName', 'installerController'),
+
+  /**
    * List of raw data about cluster that should be displayed
    * @type {Array}
    */
@@ -622,31 +636,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   },
 
   /**
-   * Update configurations for installed services.
-   * Do separated PUT-request for each siteName for each service
-   *
-   * @param {Array} fileNamesToUpdate - file names that should be updated
-   * @method updateConfigurations
-   */
-  updateConfigurations: function (fileNamesToUpdate) {
-    var configurationController = App.router.get('mainServiceInfoConfigsController');
-    var configs = this.get('configs').slice(0);
-    var configsMap = [];
-    fileNamesToUpdate.forEach(function (fileName) {
-      // TODO - Temporarily commented out before refactoring should clean it more properly
-      // if (!fileName || /^(core)/.test(fileName)) return;
-      var tagName = 'version' + (new Date).getTime();
-      var configsToSave = configs.filterProperty('filename', fileName);
-      configsToSave.forEach(function (item) {
-        item.value = App.config.trimProperty(item, false);
-      });
-      configsMap.push(configurationController.createSiteObj(fileName.replace(".xml", ""), tagName, configsToSave));
-    }, this);
-
-    if (!configsMap.length) return;
-    this.applyConfigurationsToCluster(configsMap);
-  },
-  /**
    * Prepare <code>ajaxQueue</code> and start to execute it
    * @method submitProceed
    */
@@ -859,7 +848,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
         }
         var fileNamesToUpdate = this.get('wizardController').getDBProperty('fileNamesToUpdate').uniq();
         if (fileNamesToUpdate && fileNamesToUpdate.length) {
-          this.updateConfigurations(fileNamesToUpdate);
+          this.applyConfigurationsToCluster(this.generateDesiredConfigsJSON(this.get('configs'), fileNamesToUpdate));
         }
       }
       this.createConfigurations();
@@ -1357,70 +1346,23 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   },
 
   /**
-   * Compare generated config object with current configs that were filled
-   * on "Customize Services" page.
-   *
-   * @param {Object} properties - generated by createSiteObj|createCoreSiteObj
-   * @param {Array} configs - current configs to compare
-   * @return {Boolean}
-   * @method isConfigsChanged
-   **/
-  isConfigsChanged: function (properties, configs) {
-    var isChanged = false;
-    for (var property in properties) {
-      var config = configs.findProperty('name', property);
-      // if config not found then it's looks like a new config
-      if (!config) {
-        isChanged = true;
-      } else {
-        if (!config.hasInitialValue || config.isNotDefaultValue) {
-          isChanged = true;
-        }
-      }
-    }
-    return isChanged;
-  },
-
-  /**
    * Create config objects for cluster and services
    * @method createConfigurations
    */
   createConfigurations: function () {
-    var selectedServices = this.get('selectedServices');
-    var coreSiteObject = this.createCoreSiteObj();
-    var tag = 'version1';
-    var clusterSiteObj = this.createSiteObj('cluster-env', tag);
+    var tag = this.getServiceConfigVersion();
 
-    if (this.get('content.controllerName') == 'installerController') {
-      this.get('serviceConfigTags').pushObject(clusterSiteObj);
+    if (this.get('isInstaller')) {
+      /** add cluster-env **/
+      this.get('serviceConfigTags').pushObject(this.createDesiredConfig('cluster-env', tag, this.get('configs').filterProperty('filename', 'cluster-env.xml')));
     }
 
-    if (this.get('content.controllerName') == 'addServiceController') {
-      tag = 'version' + (new Date).getTime();
-      coreSiteObject.tag = tag;
-      var coreSiteConfigs = this.get('configs').filterProperty('filename', 'core-site.xml');
-      if (this.isConfigsChanged(coreSiteObject.properties, coreSiteConfigs)) {
-        coreSiteObject.service_config_version_note = Em.I18n.t('dashboard.configHistory.table.notes.addService');
-        this.get('serviceConfigTags').pushObject(coreSiteObject);
-      }
-    }
-
-    selectedServices.forEach(function (service) {
+    this.get('selectedServices').forEach(function (service) {
       Object.keys(service.get('configTypes')).forEach(function (type) {
         if (!this.get('serviceConfigTags').someProperty('type', type)) {
-          var serviceVersionNotes = Em.I18n.t('dashboard.configHistory.table.notes.default').format(service.get('displayName'));
-          if (type === 'core-site') {
-            coreSiteObject.service_config_version_note = serviceVersionNotes;
-            this.get('serviceConfigTags').pushObject(coreSiteObject);
-          } else if (type === 'storm-site') {
-            var obj = this.createStormSiteObj(tag);
-            obj.service_config_version_note = serviceVersionNotes;
-            this.get('serviceConfigTags').pushObject(obj);
-          }  else {
-            var obj = this.createSiteObj(type, tag);
-            obj.service_config_version_note = serviceVersionNotes;
-            this.get('serviceConfigTags').pushObject(obj);
-          }
+          var configs = this.get('configs').filterProperty('filename', App.config.getOriginalFileName(type));
+          var serviceConfigNote = this.getServiceConfigNote(type, service.get('displayName'));
+          this.get('serviceConfigTags').pushObject(this.createDesiredConfig(type, tag, configs, serviceConfigNote));
         }
       }, this);
     }, this);
@@ -1428,6 +1370,27 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   },
 
   /**
+   * Get config version tag
+   *
+   * @returns {string}
+   */
+  getServiceConfigVersion: function() {
+    return 'version' + (this.get('isAddService') ? (new Date).getTime() : '1');
+  },
+
+  /**
+   * Get config version message
+   *
+   * @param type
+   * @param serviceDisplayName
+   * @returns {*}
+   */
+  getServiceConfigNote: function(type, serviceDisplayName) {
+    return (this.get('isAddService') && (type === 'core-site')) ?
+      Em.I18n.t('dashboard.configHistory.table.notes.addService') : Em.I18n.t('dashboard.configHistory.table.notes.default').format(serviceDisplayName);
+  },
+
+  /**
    * Send <code>serviceConfigTags</code> to server
    * Queued request
    * One request for each service config tag
@@ -1564,7 +1527,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
     });
 
     return sites.map(function (site) {
-      return App.router.get('mainServiceInfoConfigsController').createSiteObj(site.type, site.tag, site.properties);
+      return this.createDesiredConfig(site.type, site.tag, site.properties, null, true);
     }, this);
   },
 
@@ -1608,94 +1571,45 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   },
 
   /**
-   * Create Core Site object
-   * @returns {{type: string, tag: string, properties: {}}}
-   * @method createCoreSiteObj
-   */
-  createCoreSiteObj: function () {
-    var installedAndSelectedServices = Em.A([]);
-    installedAndSelectedServices.pushObjects(this.get('installedServices'));
-    installedAndSelectedServices.pushObjects(this.get('selectedServices'));
-    var coreSiteObj = this.get('configs').filterProperty('filename', 'core-site.xml'),
-      coreSiteProperties = this.createSiteObj('core-site', 'version1').properties,
-      isGLUSTERFSSelected = installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
-
-    coreSiteObj.forEach(function (_coreSiteObj) {
-      if (coreSiteObj.isRequiredByAgent !== false) {
-        if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
-          coreSiteProperties[_coreSiteObj.name] =
-            this.get('configs').someProperty('name', 'fs_glusterfs_default_name') ?
-              this.get('configs').findProperty('name', 'fs_glusterfs_default_name').value : null;
-        }
-        if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
-          coreSiteProperties[_coreSiteObj.name] =
-            this.get('configs').someProperty('name', 'glusterfs_defaultFS_name') ?
-              this.get('configs').findProperty('name', 'glusterfs_defaultFS_name').value : null;
-        }
-      }
-    }, this);
-    var attributes = App.router.get('mainServiceInfoConfigsController').getConfigAttributes(coreSiteObj);
-    var configObj = {"type": "core-site", "tag": "version1", "properties": coreSiteProperties};
-    if (attributes) {
-      configObj['properties_attributes'] = attributes;
-    }
-    return  configObj;
-  },
+   * Selected and installed services
+   * @override
+   */
+  currentServices: function() {
+    return this.get('installedServices').concat(this.get('selectedServices'));
+  }.property('installedServices.length', 'selectedServices.length'),
 
   /**
-   * Create siteObj for custom service with it own configs
-   * @param {string} site
-   * @param tag
-   * @returns {{type: string, tag: string, properties: {}}}
-   * @method createSiteObj
-   */
-  createSiteObj: function (site,  tag) {
-    var properties = {};
-    var configs = this.get('configs').filterProperty('filename', site + '.xml');
-    var attributes = App.router.get('mainServiceInfoConfigsController').getConfigAttributes(configs);
-    configs.forEach(function (_configProperty) {
-      var heapsizeExceptions = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize',
-        'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize',
-        'accumulo_other_heapsize', 'hbase_master_heapsize', 'hbase_regionserver_heapsize', 'metrics_collector_heapsize'];
-        // do not pass any globals whose name ends with _host or _hosts
-        if (_configProperty.isRequiredByAgent !== false) {
-          // append "m" to JVM memory options except for heapsizeExtensions
-          if (/_heapsize|_newsize|_maxnewsize|_permsize|_maxpermsize$/.test(_configProperty.name) && !heapsizeExceptions.contains(_configProperty.name) && !(_configProperty.value).endsWith("m")) {
-            properties[_configProperty.name] = _configProperty.value + "m";
-          } else {
-            properties[_configProperty.name] = _configProperty.value;
-          }
-        }
-    }, this);
-    var configObj = {"type": site, "tag": tag, "properties": properties };
-    if (attributes) {
-      configObj['properties_attributes'] = attributes;
+   * Add handling GLUSTREFS properties
+   * @param property
+   * @returns {*}
+   * @override
+   */
+  formatValueBeforeSave: function(property) {
+    if (this.formatGLUSTERFSProperties(Em.get(property, 'filename'))) {
+      switch (property.name) {
+        case "fs.default.name":
+          return this.get('configs').someProperty('name', 'fs_glusterfs_default_name') ?
+            this.get('configs').findProperty('name', 'fs_glusterfs_default_name').value : null;
+        case "fs.defaultFS":
+          return this.get('configs').someProperty('name', 'glusterfs_defaultFS_name') ?
+            this.get('configs').findProperty('name', 'glusterfs_defaultFS_name').value : null;
+      }
     }
-    return configObj;
+    return this._super(property);
   },
 
   /**
-   * Create site obj for Storm
-   * Some config-properties should be modified in custom way
-   * @param tag
-   * @returns {{type: string, tag: string, properties: {}}}
-   * @method createStormSiteObj
+   * Defines if some GLUSTERFS properties should be changed
+   *
+   * @param {String} type
+   * @returns {boolean}
    */
-  createStormSiteObj: function (tag) {
-    var configs = this.get('configs').filterProperty('filename', 'storm-site.xml');
-    var stormProperties = {};
-    configs.forEach(function (_configProperty) {
-      if (_configProperty.isRequiredByAgent !== false) {
-        if (["nimbus.seeds", "storm.zookeeper.servers"].contains(_configProperty.name)) {
-          stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g, "'");
-        } else {
-          stormProperties[_configProperty.name] = _configProperty.value;
-        }
-      }
-    }, this);
-    return {type: 'storm-site', tag: tag, properties: stormProperties};
+  formatGLUSTERFSProperties: function(type) {
+    return App.config.getConfigTagFromFileName(type) === 'core-site'
+      && this.get('installedServices').concat(this.get('selectedServices')).someProperty('serviceName', 'GLUSTERFS');
   },
 
+
   /**
    * Create one Alert Notification (if user select this on step7)
    * Only for Install Wizard and stack

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9101e9/ambari-web/app/mixins/common/configs/configs_comparator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_comparator.js b/ambari-web/app/mixins/common/configs/configs_comparator.js
index 75bb44a..c7d8322 100644
--- a/ambari-web/app/mixins/common/configs/configs_comparator.js
+++ b/ambari-web/app/mixins/common/configs/configs_comparator.js
@@ -89,11 +89,11 @@ App.ConfigsComparator = Em.Mixin.create({
     json.items.forEach(function (item) {
       item.configurations.forEach(function (configuration) {
         if (serviceName == 'YARN' && configuration.type == 'capacity-scheduler') {
-          var configsToSkip = this.get('settingsTabProperties').filterProperty('filename', 'capacity-scheduler.xml').filterProperty('subSection').mapProperty('name');
+          var configsToSkip = App.config.getPropertiesFromTheme('YARN');
           // put all properties in a single textarea for capacity-scheduler
           var value = '';
           for (var prop in configuration.properties) {
-            if (configsToSkip.contains(prop)) {
+            if (configsToSkip.contains(App.config.configId(prop, configuration.type))) {
               serviceVersionMap[item.service_config_version][prop + '-' + configuration.type] = {
                 name: prop,
                 value: configuration.properties[prop],

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9101e9/ambari-web/app/mixins/common/configs/configs_saver.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_saver.js b/ambari-web/app/mixins/common/configs/configs_saver.js
index c2da486..78ce85d 100644
--- a/ambari-web/app/mixins/common/configs/configs_saver.js
+++ b/ambari-web/app/mixins/common/configs/configs_saver.js
@@ -17,21 +17,14 @@
  */
 
 var App = require('app');
-var dataManipulationUtils = require('utils/data_manipulation');
 var lazyLoading = require('utils/lazy_loading');
 
 /**
- * this mixin has method to save configs (used in MainServiceInfoConfigsController)
- * all methods are divided into couple groups :
- *  0. HELPERS - some helper methods
- *  1. PRE SAVE CHECKS - warning popups and validations checks
- *  2. PREPARE CONFIGS TO SAVE - filtering and formatting changed configs
- *    2.1 PREPARE DATABASE CONFIGS - modify database properties
- *    2.2 ADD DYNAMIC CONFIGS - !!!NEED INVESTIGATION
- *  3. GENERATING JSON TO SAVE - generating json data
- *  4. AJAX REQUESTS - ajax request
- *  5. AFTER SAVE INFO - after save methods like to show popup with result
- *  6. ADDITIONAL
+ * Mixin for saving configs
+ * Contains methods for
+ * - generation JSON for saving configs and groups
+ * - format properties if needed
+ * - requests to save configs and groups
  */
 App.ConfigsSaverMixin = Em.Mixin.create({
 
@@ -50,7 +43,10 @@ App.ConfigsSaverMixin = Em.Mixin.create({
    * List of heapsize properties not to be parsed
    * @type {string[]}
    */
-  heapsizeException: ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize', 'hbase_master_heapsize', 'hbase_regionserver_heapsize', 'metrics_collector_heapsize'],
+  heapsizeException: ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize',
+    'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize',
+    'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize',
+    'hbase_master_heapsize', 'hbase_regionserver_heapsize', 'metrics_collector_heapsize'],
 
   /**
    * Regular expression for heapsize properties detection
@@ -59,6 +55,30 @@ App.ConfigsSaverMixin = Em.Mixin.create({
   heapsizeRegExp: /_heapsize|_newsize|_maxnewsize|_permsize|_maxpermsize$/,
 
   /**
+   * If some of services has such type core-site can be saved
+   *
+   * @type {string}
+   */
+  coreSiteServiceType: 'HCFS',
+
+  /**
+   * Core site can be used by multiple services
+   * If some of services listed below is selected/installed than core site can be saved
+   *
+   * @type {string[]}
+   */
+  coreSiteServiceNames: ['HDFS', 'GLUSTERFS', 'RANGER_KMS'],
+
+  /**
+   * List of services which configs should be saved
+   *
+   * @type {App.StackService[]}
+   */
+  currentServices: function() {
+    return [App.StackService.find(this.get('content.serviceName'))];
+  }.property('content.serviceName'),
+
+  /**
    * clear info to default
    * @method clearSaveInfo
    */
@@ -353,11 +373,11 @@ App.ConfigsSaverMixin = Em.Mixin.create({
    * generating common JSON object for desired configs
    * @param configsToSave
    * @param fileNamesToSave
-   * @param serviceConfigNote
-   * @param {boolean} [isNotDefaultGroup=false]
+   * @param {string} [serviceConfigNote='']
+   * @param {boolean} [ignoreVersionNote=false]
    * @returns {Array}
    */
-  generateDesiredConfigsJSON: function(configsToSave, fileNamesToSave, serviceConfigNote, isNotDefaultGroup) {
+  generateDesiredConfigsJSON: function(configsToSave, fileNamesToSave, serviceConfigNote, ignoreVersionNote) {
     var desired_config = [];
     if (Em.isArray(configsToSave) && Em.isArray(fileNamesToSave) && fileNamesToSave.length && configsToSave.length) {
       serviceConfigNote = serviceConfigNote || "";
@@ -367,7 +387,7 @@ App.ConfigsSaverMixin = Em.Mixin.create({
         if (this.allowSaveSite(fName)) {
           var properties = configsToSave.filterProperty('filename', fName);
           var type = App.config.getConfigTagFromFileName(fName);
-          desired_config.push(this.createDesiredConfig(type, tagVersion, properties, serviceConfigNote, isNotDefaultGroup));
+          desired_config.push(this.createDesiredConfig(type, tagVersion, properties, serviceConfigNote, ignoreVersionNote));
         }
       }, this);
     }
@@ -375,54 +395,65 @@ App.ConfigsSaverMixin = Em.Mixin.create({
   },
 
   /**
-   * for some file names we have a restriction
-   * and can't save them, in this this method will return false
+   * For some file names we have a restriction
+   * and can't save them, in this case method will return false
+   *
    * @param fName
    * @returns {boolean}
    */
   allowSaveSite: function(fName) {
-    switch (fName) {
-      case 'mapred-queue-acls.xml':
+    switch(App.config.getConfigTagFromFileName(fName)) {
+      case 'mapred-queue-acls':
         return false;
-      case 'core-site.xml':
-        var serviceName = this.get('content.serviceName');
-        var serviceType = App.StackService.find().findProperty('serviceName',serviceName).get('serviceType');
-        return ['HDFS', 'GLUSTERFS', 'RANGER_KMS'].contains(this.get('content.serviceName')) || serviceType === 'HCFS';
-      default :
+      case 'core-site':
+        return this.allowSaveCoreSite();
+      default:
         return true;
     }
   },
 
   /**
+   * Defines conditions in which core-site can be saved
+   *
+   * @returns {boolean}
+   */
+  allowSaveCoreSite: function() {
+    return this.get('currentServices').some(function(service) {
+      return (this.get('coreSiteServiceNames').contains(service.get('serviceName'))
+        || this.get('coreSiteServiceType') === service.get('serviceType'));
+    }, this);
+  },
+
+  /**
    * generating common JSON object for desired config
    * @param {string} type - file name without '.xml'
    * @param {string} tagVersion - version + timestamp
    * @param {App.ConfigProperty[]} properties - array of properties from model
-   * @param {string} serviceConfigNote
-   * @param {boolean} [isNotDefaultGroup=false]
+   * @param {string} [serviceConfigNote='']
+   * @param {boolean} [ignoreVersionNote=false]
    * @returns {{type: string, tag: string, properties: {}, properties_attributes: {}|undefined, service_config_version_note: string|undefined}}
    */
-  createDesiredConfig: function(type, tagVersion, properties, serviceConfigNote, isNotDefaultGroup) {
+  createDesiredConfig: function(type, tagVersion, properties, serviceConfigNote, ignoreVersionNote) {
     Em.assert('type and tagVersion should be defined', type && tagVersion);
     var desired_config = {
       "type": type,
       "tag": tagVersion,
       "properties": {}
     };
-    if (!isNotDefaultGroup) {
+    if (!ignoreVersionNote) {
       desired_config.service_config_version_note = serviceConfigNote || "";
     }
     var attributes = { final: {} };
     if (Em.isArray(properties)) {
       properties.forEach(function(property) {
 
-        if (property.get('isRequiredByAgent')) {
-          desired_config.properties[property.get('name')] = this.formatValueBeforeSave(property);
+        if (Em.get(property, 'isRequiredByAgent')) {
+          desired_config.properties[Em.get(property, 'name')] = this.formatValueBeforeSave(property);
           /**
            * add is final value
            */
-          if (property.get('isFinal')) {
-            attributes.final[property.get('name')] = "true";
+          if (Em.get(property, 'isFinal')) {
+            attributes.final[Em.get(property, 'name')] = "true";
           }
         }
       }, this);
@@ -441,20 +472,20 @@ App.ConfigsSaverMixin = Em.Mixin.create({
    * @returns {string}
    */
   formatValueBeforeSave: function(property) {
-    var name = property.get('name');
-    var value = property.get('value');
+    var name = Em.get(property, 'name');
+    var value = Em.get(property, 'value');
     var kdcTypesMap = App.router.get('mainAdminKerberosController.kdcTypesValues');
-    //TODO check for core-site
-    if (this.get('heapsizeRegExp').test(name) && !this.get('heapsizeException').contains(name) && !(value).endsWith("m")) {
+
+    if (this.addM(name, value)) {
       return value += "m";
     }
-    if (typeof property.get('value') === "boolean") {
-      return property.get('value').toString();
+    if (typeof value === "boolean") {
+      return value.toString();
     }
     switch (name) {
       case 'kdc_type':
         return Em.keys(kdcTypesMap).filter(function(key) {
-            return kdcTypesMap[key] === property.get('value');
+            return kdcTypesMap[key] === value;
         })[0];
       case 'storm.zookeeper.servers':
       case 'nimbus.seeds':
@@ -465,10 +496,23 @@ App.ConfigsSaverMixin = Em.Mixin.create({
         }
         break;
       default:
-        return App.config.trimProperty(property, true);
+        return App.config.trimProperty(property);
     }
   },
 
+  /**
+   * Site object name follow the format *permsize/*heapsize and the value NOT ends with "m"
+   *
+   * @param name
+   * @param value
+   * @returns {*|boolean}
+   */
+  addM: function (name, value) {
+    return this.get('heapsizeRegExp').test(name)
+      && !this.get('heapsizeException').contains(name)
+      && !(value).endsWith("m");
+  },
+
   /*********************************** 4. AJAX REQUESTS **************************************/
 
   /**
@@ -863,94 +907,5 @@ App.ConfigsSaverMixin = Em.Mixin.create({
         this.hide();
       }
     });
-  },
-
-  /**
-   * Save "final" attribute for properties
-   * @param {Array} properties - array of properties
-   * @returns {Object|null}
-   * @method getConfigAttributes
-   */
-  getConfigAttributes: function(properties) {
-    var attributes = {
-      final: {}
-    };
-    var finalAttributes = attributes.final;
-    var hasAttributes = false;
-    properties.forEach(function (property) {
-      if (property.isRequiredByAgent !== false && property.isFinal) {
-        hasAttributes = true;
-        finalAttributes[property.name] = "true";
-      }
-    });
-    if (hasAttributes) {
-      return attributes;
-    }
-    return null;
-  },
-
-  /**
-   * create site object
-   * @param {string} siteName
-   * @param {string} tagName
-   * @param {object[]} siteObj
-   * @return {Object}
-   * @method createSiteObj
-   */
-  createSiteObj: function (siteName, tagName, siteObj) {
-    var heapsizeException = this.get('heapsizeException');
-    var heapsizeRegExp = this.get('heapsizeRegExp');
-    var siteProperties = {};
-    siteObj.forEach(function (_siteObj) {
-      var value = _siteObj.value;
-      if (_siteObj.isRequiredByAgent == false) return;
-      // site object name follow the format *permsize/*heapsize and the value NOT ends with "m"
-      if (heapsizeRegExp.test(_siteObj.name) && !heapsizeException.contains(_siteObj.name) && !(_siteObj.value).endsWith("m")) {
-        value += "m";
-      }
-      siteProperties[_siteObj.name] = value;
-      switch (siteName) {
-        case 'falcon-startup.properties':
-        case 'falcon-runtime.properties':
-        case 'pig-properties':
-          siteProperties[_siteObj.name] = value;
-          break;
-        default:
-          siteProperties[_siteObj.name] = this.setServerConfigValue(_siteObj.name, value);
-      }
-    }, this);
-    var result = {"type": siteName, "tag": tagName, "properties": siteProperties};
-    var attributes = this.getConfigAttributes(siteObj);
-    if (attributes) {
-      result['properties_attributes'] = attributes;
-    }
-    return result;
-  },
-
-  /**
-   * This method will be moved to config's decorators class.
-   *
-   * For now, provide handling for special properties that need
-   * be specified in special format required for server.
-   *
-   * @param configName {String} - name of config property
-   * @param value {*} - value of config property
-   *
-   * @return {String} - formatted value
-   * @method setServerConfigValue
-   */
-  setServerConfigValue: function (configName, value) {
-    switch (configName) {
-      case 'storm.zookeeper.servers':
-      case 'nimbus.seeds':
-        if(Em.isArray(value)) {
-          return JSON.stringify(value).replace(/"/g, "'");
-        } else {
-          return value;
-        }
-        break;
-      default:
-        return value;
-    }
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9101e9/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 298c9a8..e647eda 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -67,36 +67,6 @@ describe('App.WizardStep8Controller', function () {
     configurationController = App.MainServiceInfoConfigsController.create({});
   });
 
-  var siteObjTests = Em.A([
-    {name: 'createHdfsSiteObj', e: {type: 'hdfs-site', tag: 'version1', l: 2}},
-    {name: 'createHueSiteObj', e: {type: 'hue-site', tag: 'version1', l: 2}},
-    {name: 'createMrSiteObj', e: {type: 'mapred-site', tag: 'version1', l: 2}},
-    {name: 'createYarnSiteObj', e: {type: 'yarn-site', tag: 'version1', l: 2}},
-    {name: 'createCapacityScheduler', e: {type: 'capacity-scheduler', tag: 'version1', l: 2}},
-    {name: 'createMapredQueueAcls', e: {type: 'mapred-queue-acls', tag: 'version1', l: 2}},
-    {name: 'createHbaseSiteObj', e: {type: 'hbase-site', tag: 'version1', l: 2}},
-    {name: 'createOozieSiteObj', e: {type: 'oozie-site', tag: 'version1', l: 2}},
-    {name: 'createHiveSiteObj', e: {type: 'hive-site', tag: 'version1', l: 2}},
-    {name: 'createWebHCatSiteObj', e: {type: 'webhcat-site', tag: 'version1', l: 2}},
-    {name: 'createTezSiteObj', e: {type: 'tez-site', tag: 'version1', l: 2}},
-    {name: 'createPigPropertiesSiteObj', e: {type: 'pig-properties', tag: 'version1', l: 1}},
-    {name: 'createFalconStartupSiteObj', e: {type: 'falcon-startup.properties', tag: 'version1', l: 2}},
-    {name: 'createFalconRuntimeSiteObj', e: {type: 'falcon-runtime.properties', tag: 'version1', l: 2}}
-  ]);
-
-  siteObjTests.forEach(function (test) {
-    describe('#' + test.name, function () {
-
-      it(test.name, function () {
-
-        var siteObj = installerStep8Controller.createSiteObj(test.e.type, test.e.tag);
-        expect(siteObj.tag).to.equal(test.e.tag);
-        expect(Em.keys(siteObj.properties).length).to.equal(test.e.l);
-      });
-
-    });
-  });
-
   App.TestAliases.testAsComputedFilterBy(getController(), 'installedServices', 'content.services', 'isInstalled', true);
 
   App.TestAliases.testAsComputedEqual(getController(), 'isManualKerberos', 'App.router.mainAdminKerberosController.kdc_type', 'none');
@@ -239,91 +209,6 @@ describe('App.WizardStep8Controller', function () {
 
   });
 
-  describe('#createCoreSiteObj', function () {
-
-    beforeEach(function () {
-      var content = Em.Object.create({
-        services: Em.A([
-          Em.Object.create({
-            serviceName: 's1',
-            isSelected: true,
-            isInstalled: false
-          }),
-          Em.Object.create({
-            serviceName: 's2',
-            isSelected: true,
-            isInstalled: false
-          }),
-          Em.Object.create({
-            serviceName: 's3',
-            isSelected: true,
-            isInstalled: false
-          }),
-          Em.Object.create({
-            serviceName: 'GLUSTERFS',
-            isSelected: false,
-            isInstalled: true,
-            configTypesRendered: {hdfs:'tag1'}
-          })
-        ])
-      });
-      var installedServices = content.services.filterProperty('isInstalled', true);
-      var selectedServices = content.services.filterProperty('isSelected', true);
-      installerStep8Controller.set('content', content);
-      installerStep8Controller.set('installedServices', installedServices);
-      installerStep8Controller.set('selectedServices', selectedServices);
-      installerStep8Controller.set('configs', Em.A([
-        Em.Object.create({
-          name: 'fs_glusterfs_default_name',
-          filename: 'core-site.xml',
-          value: 'value',
-          overrides: Em.A([
-            Em.Object.create({
-              value: '4',
-              hosts: Em.A(['h1','h2'])
-            })
-          ])
-        }),
-        Em.Object.create({
-          name: 'fs.defaultFS',
-          filename: 'core-site.xml',
-          value: 'value',
-          overrides: Em.A([
-            Em.Object.create({
-              value: '4',
-              hosts: Em.A(['h1','h2'])
-            })
-          ])
-        }),
-        Em.Object.create({
-          name: 'glusterfs_defaultFS_name',
-          filename: 'core-site.xml',
-          value: 'value',
-          overrides: Em.A([
-            Em.Object.create({
-              value: '4',
-              hosts: Em.A(['h1','h2'])
-            })
-          ])
-        })
-      ]));
-    });
-
-    it('should return config', function () {
-      var expected = {
-        "type": "core-site",
-        "tag": "version1",
-        "properties": {
-          "fs_glusterfs_default_name": "value",
-          "fs.defaultFS": "value",
-          "glusterfs_defaultFS_name": "value"
-        }
-      };
-
-      expect(installerStep8Controller.createCoreSiteObj()).to.eql(expected);
-    });
-  });
-
   describe('#createConfigurationGroups', function () {
     var content;
     beforeEach(function() {
@@ -337,8 +222,7 @@ describe('App.WizardStep8Controller', function () {
         },
         getConfigAttributes: function() {
           return Em.A(['atr']);
-        },
-        createSiteObj: App.MainServiceInfoConfigsController.create({}).createSiteObj.bind(App.MainServiceInfoConfigsController.create({}))
+        }
       }));
       content = Em.Object.create({
         configGroups: Em.A([
@@ -423,22 +307,6 @@ describe('App.WizardStep8Controller', function () {
     });
   });
 
-  describe('#isConfigsChanged', function () {
-    it('should return true if config changed', function () {
-      var properties = Em.Object.create({
-        property:true,
-        property1: Em.Object.create({
-          hasInitialValue: false,
-          isNotDefaultValue: false
-        })
-      });
-      var _configs = Em.A([Em.Object.create({
-        name: 'property'
-      })]);
-      expect(installerStep8Controller.isConfigsChanged(properties, _configs)).to.be.true;
-    });
-  });
-
   describe('#loadServices', function () {
 
     beforeEach(function () {
@@ -1197,42 +1065,6 @@ describe('App.WizardStep8Controller', function () {
 
   });
 
-  describe('#createStormSiteObj', function() {
-    it('should replace quote \'"\' to "\'" for some properties', function() {
-      var _configs = [
-          {filename: 'storm-site.xml', value: ["a", "b"], name: 'storm.zookeeper.servers'}
-        ],
-        expected = {
-          type: 'storm-site',
-          tag: 'version1',
-          properties: {
-            'storm.zookeeper.servers': '[\'a\',\'b\']'
-          }
-        };
-      installerStep8Controller.reopen({configs: _configs});
-      expect(installerStep8Controller.createStormSiteObj('version1')).to.eql(expected);
-    });
-
-    it('should not escape special characters', function() {
-      var _configs = [
-          {filename: 'storm-site.xml', value: "abc\n\t", name: 'nimbus.childopts'},
-          {filename: 'storm-site.xml', value: "a\nb", name: 'supervisor.childopts'},
-          {filename: 'storm-site.xml', value: "a\t\tb", name: 'worker.childopts'}
-        ],
-        expected = {
-          type: 'storm-site',
-          tag: 'version1',
-          properties: {
-            'nimbus.childopts': 'abc\n\t',
-            'supervisor.childopts': 'a\nb',
-            'worker.childopts': 'a\t\tb'
-          }
-        };
-      installerStep8Controller.reopen({configs: _configs});
-      expect(installerStep8Controller.createStormSiteObj('version1')).to.eql(expected);
-    });
-  });
-
   describe('#ajaxQueueFinished', function() {
 
     beforeEach(function () {
@@ -2068,20 +1900,20 @@ describe('App.WizardStep8Controller', function () {
 
   describe('#startDeploy', function () {
 
-    var stubbedNames = ['createCluster', 'createSelectedServices', 'updateConfigurations', 'createConfigurations',
+    var stubbedNames = ['createCluster', 'createSelectedServices', 'createConfigurations',
         'applyConfigurationsToCluster', 'createComponents', 'registerHostsToCluster', 'createConfigurationGroups',
         'createMasterHostComponents', 'createSlaveAndClientsHostComponents', 'createAdditionalClientComponents',
         'createAdditionalHostComponents'],
       cases = [
         {
           controllerName: 'installerController',
-          notExecuted: ['createAdditionalClientComponents', 'updateConfigurations'],
+          notExecuted: ['createAdditionalClientComponents'],
           fileNamesToUpdate: [],
           title: 'Installer, no configs to update'
         },
         {
           controllerName: 'addHostController',
-          notExecuted: ['updateConfigurations', 'createConfigurations', 'applyConfigurationsToCluster', 'createAdditionalClientComponents'],
+          notExecuted: ['createConfigurations', 'applyConfigurationsToCluster', 'createAdditionalClientComponents'],
           title: 'Add Host Wizard'
         },
         {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9101e9/ambari-web/test/mixins/common/configs/configs_saver_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/configs_saver_test.js b/ambari-web/test/mixins/common/configs/configs_saver_test.js
index 2156a46..f7be831 100644
--- a/ambari-web/test/mixins/common/configs/configs_saver_test.js
+++ b/ambari-web/test/mixins/common/configs/configs_saver_test.js
@@ -22,62 +22,76 @@ describe('App.ConfigsSaverMixin', function() {
   var mixinObject = Em.Controller.extend(App.ConfigsSaverMixin, {});
   var instanceObject = mixinObject.create({});
 
-  describe('#allowSaveSite()', function() {
+  describe('#allowSaveCoreSite()', function () {
+    var allowedType = 'CORETYPE';
+    var allowedService = ['S1'];
     var stackServices = [
       Em.Object.create({
-        serviceName: 'HDFS',
-        serviceType: 'NONHCFS'
+        serviceName: 'S4',
+        serviceType: 'CORETYPE'
       }),
       Em.Object.create({
         serviceName: 'S1',
-        serviceType: 'HCFS'
+        serviceType: 'SOMEOTHERTYPE'
       }),
       Em.Object.create({
         serviceName: 'S2',
-        serviceType: 'NONHCFS'
-      }),
-      Em.Object.create({
-        serviceName: 'S3'
+        serviceType: 'SOMEOTHERTYPE'
       })
     ];
-    beforeEach(function() {
-      instanceObject.set('content', {});
-      sinon.stub(App.StackService, 'find', function () {
-        return stackServices;
+    beforeEach(function () {
+      instanceObject.setProperties({
+        'content': {},
+        'coreSiteServiceType': allowedType,
+        'coreSiteServiceNames': allowedService
       });
     });
 
-    afterEach(function() {
-      App.StackService.find.restore();
-    });
-
-    it('returns true by default', function() {
-      expect(instanceObject.allowSaveSite('some-site')).to.be.true
-    });
-
-    it('returns true for core-site and proper service', function() {
-      instanceObject.set('content.serviceName', 'HDFS');
-      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.true
-    });
-
-    it('returns true for core-site and serviceType HCFS', function() {
-      instanceObject.set('content.serviceName', 'S1');
-      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.true
-    });
-
-    it('returns false for core-site and serviceType not HCFS', function() {
-      instanceObject.set('content.serviceName', 'S2');
-      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.false
-    });
-
-    it('returns false for core-site but serviceType undefined', function() {
-      instanceObject.set('content.serviceName', 'S3');
-      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.false
-    });
+    [{
+      currentServices: stackServices[0],
+      res: true,
+      m: 'service type is ok'
+    }, {
+      currentServices: stackServices[1],
+      res: true,
+      m: 'service name is ok'
+    }, {
+      currentServices: stackServices[2],
+      res: false,
+      m: 'not ok'
+    }].forEach(function (c) {
+        describe(c.m, function () {
+          beforeEach(function () {
+            instanceObject.reopen({
+              currentServices: c.currentServices
+            });
+            it('', function () {
+              expect(instanceObject.allowSaveCoreSite()).to.equal(c.res);
+            });
+          });
+        });
+      });
+  });
 
-    it('returns false for mapred-queue-acls.xml', function() {
-      expect(instanceObject.allowSaveSite('mapred-queue-acls.xml')).to.be.false
-    });
+  describe('allowSaveSite', function() {
+    [
+      { fName: 'mapred-queue-acls', res: false, m: 'file name is restricted to be saved' },
+      { fName: 'core-site', res: true, allowSaveCoreSite: true, m: 'core site is allowed to be saved' },
+      { fName: 'core-site', res: false, allowSaveCoreSite: false, m: 'core site is not allowed to be saved' },
+      { fName: 'other-file-name', res: true, m: 'file name has not restriction rule, so can be saved' }
+    ].forEach(function (c) {
+        describe(c.m, function () {
+          beforeEach(function() {
+            sinon.stub(instanceObject, 'allowSaveCoreSite').returns(c.allowSaveCoreSite);
+          });
+          afterEach(function() {
+            instanceObject.allowSaveCoreSite.restore();
+          });
+          it('', function () {
+            expect(instanceObject.allowSaveSite(c.fName)).to.equal(c.res);
+          });
+        });
+      });
   });
 
   describe('#createDesiredConfig()', function() {


[17/21] ambari git commit: AMBARI-15101. Remove the dependency between ZK start and Ranger user sync start (smohanty)

Posted by dm...@apache.org.
AMBARI-15101. Remove the dependency between ZK start and Ranger user sync start (smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 183f71f90495cfbba29961182b293c9408d3effb
Parents: 5ae72ac
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Feb 18 14:53:44 2016 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Feb 18 14:53:44 2016 -0800

----------------------------------------------------------------------
 .../src/main/resources/stacks/HDP/2.2/role_command_order.json       | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/183f71f9/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
index 465d442..efa3b0d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
@@ -23,7 +23,6 @@
     "KAFKA_BROKER-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START"],
     "KAFKA_SERVICE_CHECK-SERVICE_CHECK": ["KAFKA_BROKER-START"],
     "RANGER_USERSYNC-START" : ["RANGER_ADMIN-START"],
-    "ZOOKEEPER_SERVER-START" : ["RANGER_USERSYNC-START"],
     "KNOX_GATEWAY-START": ["RANGER_USERSYNC-START"],
     "KNOX_SERVICE_CHECK-SERVICE_CHECK" : ["KNOX_GATEWAY-START"],
     "RESOURCEMANAGER-START" : ["RANGER_USERSYNC-START"],


[03/21] ambari git commit: AMBARI-15088. Incorrect information shown for 'leveldb-timeline-store' location while moving App Timeline Server component. (alexantonenko)

Posted by dm...@apache.org.
AMBARI-15088. Incorrect information shown for 'leveldb-timeline-store' location while moving App Timeline Server component. (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0c568cc8a20f1f33c1476f7c267c9245efd6dd0f
Parents: 2926a4e
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Feb 18 14:08:58 2016 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Feb 18 17:49:31 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                          |  6 +++---
 .../app/views/main/service/reassign/step5_view.js   | 16 +++++++++-------
 2 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c568cc8/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 8186088..9d24b4f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2093,10 +2093,10 @@ Em.I18n.translations = {
     '</div>',
   'services.reassign.step5.body.app_timeline_server': '<div class="alert alert-info">' +
   '<ol>' +
-  '<li>Copy <b>{7}/leveldb-timeline-store.ldb</b> from the source host <b>{1}</b> to <b>{7}/leveldb-timeline-store.ldb</b> on the target host <b>{2}</b>.</li>' +
+  '<li>Copy <b>{7}/{8}</b> from the source host <b>{1}</b> to <b>{7}/{8}</b> on the target host <b>{2}</b>.</li>' +
   '<li>Login to the target host <b>{2}</b> and change permissions by running:' +
-  '<div class="code-snippet">chown -R {3}:{5} {7}/leveldb-timeline-store.ldb</div></li>' +
-  '<div class="code-snippet">chmod -R 700 {7}/leveldb-timeline-store.ldb</div></li>' +
+  '<div class="code-snippet">chown -R {3}:{5} {7}/{8}</div></li>' +
+  '<div class="code-snippet">chmod -R 700 {7}/{8}</div></li>' +
   '</ol>' +
   '</div>',
   'services.reassign.step5.body.securityNotice': '<div class="alert alert-info"> <div class="alert alert-warn"> <strong>Note: </strong> Secure cluster' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c568cc8/ambari-web/app/views/main/service/reassign/step5_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step5_view.js b/ambari-web/app/views/main/service/reassign/step5_view.js
index 5eeba14..066b23b 100644
--- a/ambari-web/app/views/main/service/reassign/step5_view.js
+++ b/ambari-web/app/views/main/service/reassign/step5_view.js
@@ -27,12 +27,14 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
     if (!this.get('controller.content.componentsWithManualCommands').contains(this.get('controller.content.reassign.component_name'))) {
       return '';
     }
-    var componentDir = this.get('controller.content.componentDir') || '';
-    var componentDirCmd = componentDir.replace(/,/g, ' ');
-    var sourceHost = this.get('controller.content.reassignHosts.source');
-    var targetHost = this.get('controller.content.reassignHosts.target');
-    var ha = '';
-    var user = this.get('controller.content.hdfsUser'), path;
+    var
+      atsDir = App.get('isHadoop23Stack') ? "timeline-state-store.ldb" : "leveldb-timeline-store.ldb",
+      componentDir = this.get('controller.content.componentDir') || '',
+      componentDirCmd = componentDir.replace(/,/g, ' '),
+      sourceHost = this.get('controller.content.reassignHosts.source'),
+      targetHost = this.get('controller.content.reassignHosts.target'),
+      ha = '',
+      user = this.get('controller.content.hdfsUser'), path;
 
     if (this.get('controller.content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled')) {
       ha = '_ha';
@@ -45,7 +47,7 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
     }
 
     return Em.I18n.t('services.reassign.step5.body.' + this.get('controller.content.reassign.component_name').toLowerCase() + ha).
-      format(componentDir, sourceHost, targetHost, user, nnStartedHost,this.get('controller.content.group'), componentDirCmd, path);
+      format(componentDir, sourceHost, targetHost, user, nnStartedHost,this.get('controller.content.group'), componentDirCmd, path, atsDir);
   }.property('controller.content.reassign.component_name', 'controller.content.componentDir', 'controller.content.masterComponentHosts', 'controller.content.reassign.host_id', 'controller.content.hdfsUser'),
 
   /**


[13/21] ambari git commit: AMBARI-15098: Ambari Schema Version should ignore patch number from version number (jluniya)

Posted by dm...@apache.org.
AMBARI-15098: Ambari Schema Version should ignore patch number from version number (jluniya)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0818202169217994fab9dcc254b7728a2bfc238f
Parents: b57749d
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Thu Feb 18 12:55:38 2016 -0800
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Thu Feb 18 12:55:38 2016 -0800

----------------------------------------------------------------------
 ambari-server/pom.xml                                  | 13 +++++++++++++
 .../apache/ambari/server/controller/AmbariServer.java  |  3 ++-
 .../server/controller/utilities/DatabaseChecker.java   |  2 +-
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql     |  2 +-
 .../src/main/resources/Ambari-DDL-Oracle-CREATE.sql    |  2 +-
 .../src/main/resources/Ambari-DDL-Postgres-CREATE.sql  |  2 +-
 .../resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql  |  2 +-
 .../main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql   |  2 +-
 .../src/main/resources/Ambari-DDL-SQLServer-CREATE.sql |  2 +-
 .../apache/ambari/server/utils/TestVersionUtils.java   |  2 ++
 10 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 0fa0101..2d0559c 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -75,6 +75,19 @@
               <failIfNoMatch>false</failIfNoMatch>
             </configuration>
           </execution>
+          <execution>
+            <id>regex-schema-version</id>
+            <goals>
+              <goal>regex-property</goal>
+            </goals>
+            <configuration>
+              <name>ambariSchemaVersion</name>
+              <value>${project.version}</value>
+              <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
+              <replacement>$1.$2.$3</replacement>
+              <failIfNoMatch>false</failIfNoMatch>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index b416129..ad4a59b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -105,6 +105,7 @@ import org.apache.ambari.server.topology.TopologyManager;
 import org.apache.ambari.server.topology.TopologyRequestFactoryImpl;
 import org.apache.ambari.server.utils.RetryHelper;
 import org.apache.ambari.server.utils.StageUtils;
+import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.ambari.server.view.ViewRegistry;
 import org.apache.velocity.app.Velocity;
 import org.eclipse.jetty.http.HttpVersion;
@@ -787,7 +788,7 @@ public class AmbariServer {
 
       MetainfoEntity schemaVersion = new MetainfoEntity();
       schemaVersion.setMetainfoName(Configuration.SERVER_VERSION_KEY);
-      schemaVersion.setMetainfoValue(ambariMetaInfo.getServerVersion());
+      schemaVersion.setMetainfoValue(VersionUtils.getVersionSubstring(ambariMetaInfo.getServerVersion()));
 
       metainfoDAO.create(schemaVersion);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
index 190a6a7..3a3ef9a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
@@ -286,7 +286,7 @@ public class DatabaseChecker {
       throw new AmbariException("Unable to read server version file.");
     }
 
-    if (schemaVersionEntity==null || VersionUtils.compareVersions(schemaVersion, serverVersion, 4) != 0) {
+    if (schemaVersionEntity==null || VersionUtils.compareVersions(schemaVersion, serverVersion, 3) != 0) {
       String error = "Current database store version is not compatible with " +
         "current server version"
         + ", serverVersion=" + serverVersion

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 73b172a..4940e9d 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -1276,7 +1276,7 @@ insert into adminprivilege (privilege_id, permission_id, resource_id, principal_
   select 1, 1, 1, 1;
 
 insert into metainfo(`metainfo_key`, `metainfo_value`)
-  select 'version','${ambariVersion}';
+  select 'version','${ambariSchemaVersion}';
 
 -- Quartz tables
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 1df396d..e43a7fc 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -991,7 +991,7 @@ INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('topology_ho
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('setting_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('hostcomponentstate_id_seq', 0);
 
-INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariVersion}');
+INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariSchemaVersion}');
 
 insert into adminresourcetype (resource_type_id, resource_type_name)
   select 1, 'AMBARI' from dual

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index d948b3b..848d9e0 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -1313,7 +1313,7 @@ INSERT INTO adminprivilege (privilege_id, permission_id, resource_id, principal_
   SELECT 1, 1, 1, 1;
 
 INSERT INTO metainfo (metainfo_key, metainfo_value)
-  SELECT 'version', '${ambariVersion}';
+  SELECT 'version', '${ambariSchemaVersion}';
 COMMIT;
 
 -- Quartz tables

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index 5fe742c..a379575 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -1412,7 +1412,7 @@ INSERT INTO ambari.adminprivilege (privilege_id, permission_id, resource_id, pri
   SELECT 1, 1, 1, 1;
 
 INSERT INTO ambari.metainfo (metainfo_key, metainfo_value)
-  SELECT 'version', '${ambariVersion}';
+  SELECT 'version', '${ambariSchemaVersion}';
 COMMIT;
 
 -- Quartz tables

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index fe1e505..b57d377 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -1263,7 +1263,7 @@ insert into adminprivilege (privilege_id, permission_id, resource_id, principal_
   select 1, 1, 1, 1;
 
 insert into metainfo(metainfo_key, metainfo_value)
-  select 'version','${ambariVersion}';
+  select 'version','${ambariSchemaVersion}';
 
 -- Quartz tables
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index 41dac77..b2fd5e2 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -1373,7 +1373,7 @@ BEGIN TRANSACTION
     select 1, 1, 1, 1;
 
   insert into metainfo(metainfo_key, metainfo_value)
-    select 'version','${ambariVersion}';
+    select 'version','${ambariSchemaVersion}';
 COMMIT TRANSACTION
 
 -- Quartz tables

http://git-wip-us.apache.org/repos/asf/ambari/blob/08182021/ambari-server/src/test/java/org/apache/ambari/server/utils/TestVersionUtils.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestVersionUtils.java b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestVersionUtils.java
index 371660b..5141dc0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestVersionUtils.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestVersionUtils.java
@@ -84,6 +84,8 @@ public class TestVersionUtils {
     Assert.assertEquals(0, VersionUtils.compareVersions("1.2.3", "1.2.3.4", 3));
     Assert.assertEquals(0, VersionUtils.compareVersions("1.2.3.6.7", "1.2.3.4", 3));
     Assert.assertEquals(1, VersionUtils.compareVersions("1.2.3.6.7", "1.2.3.4", 4));
+    Assert.assertEquals(0, VersionUtils.compareVersions("1.2.3", "1.2.3.0", 4));
+    Assert.assertEquals(-1, VersionUtils.compareVersions("1.2.3", "1.2.3.1", 4));
     Assert.assertEquals(1, VersionUtils.compareVersions("1.2.3.6.7\n", "1.2.3.4\n", 4)); //test version trimming
 
     Assert.assertEquals(1, VersionUtils.compareVersions("1.2.3.1", "1.2.3", true));


[16/21] ambari git commit: AMBARI-15099 : Ambari missing metrics in UI with Vip settings enabled (avijayan)

Posted by dm...@apache.org.
AMBARI-15099 : Ambari missing metrics in UI with Vip settings enabled (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 5ae72ac59e14dc033140ee4626dbe0761a574893
Parents: defbedd
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Thu Feb 18 14:28:35 2016 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Thu Feb 18 14:28:35 2016 -0800

----------------------------------------------------------------------
 .../internal/AbstractProviderModule.java        | 31 ++++++++++----------
 1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ae72ac5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 52d95e0..ff9b4e4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -310,7 +310,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
         if (!configProperties.isEmpty()) {
           clusterMetricserverVipHost = configProperties.get("METRICS_COLLECTOR");
           if (clusterMetricserverVipHost != null) {
-            clusterMetricCollectorMap.put(clusterName, clusterMetricserverVipHost);
+            LOG.info("Setting Metrics Collector Vip Host : " + clusterMetricserverVipHost);
             vipHostConfigPresent = true;
           }
         }
@@ -340,15 +340,19 @@ public abstract class AbstractProviderModule implements ProviderModule,
           if (isHostLive(clusterName, hostname)
             && isHostComponentLive(clusterName, hostname, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name())) {
             clusterMetricCollectorMap.put(clusterName, hostname);
-            LOG.debug("New Metrics Collector Host : " + hostname);
+            LOG.info("New Metrics Collector Host : " + hostname);
             break;
           } else {
-            LOG.debug("Metrics Collector Host or host component not live : " + hostname);
+            LOG.info("Metrics Collector Host or host component not live : " + hostname);
           }
         }
       }
     }
-    return clusterMetricCollectorMap.get(clusterName);
+
+    LOG.debug("Cluster Metrics Vip Host : " + clusterMetricserverVipHost);
+    LOG.debug("Cluster Metrics Collector Host : " + clusterMetricCollectorMap.get(clusterName));
+
+    return (clusterMetricserverVipHost != null) ? clusterMetricserverVipHost : clusterMetricCollectorMap.get(clusterName);
   }
 
   @Override
@@ -848,19 +852,16 @@ public abstract class AbstractProviderModule implements ProviderModule,
             clusterGangliaCollectorMap.put(clusterName, hostName);
           }
           if (componentName.equals(METRIC_SERVER)) {
-            //If vip config not present
             //  If current collector host is null or if the host or the host component not live
             //    Update clusterMetricCollectorMap.
-            if (!vipHostConfigPresent) {
-              String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
-              LOG.debug("Current Metrics collector Host : " + currentCollectorHost);
-              if ((currentCollectorHost == null) ||
-                !(isHostLive(clusterName, currentCollectorHost) &&
-                  isHostComponentLive(clusterName, currentCollectorHost, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name()))
-                ) {
-                LOG.debug("New Metrics collector Host : " + hostName);
-                clusterMetricCollectorMap.put(clusterName, hostName);
-              }
+            String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
+            LOG.info("Current Metrics collector Host : " + currentCollectorHost);
+            if ((currentCollectorHost == null) ||
+              !(isHostLive(clusterName, currentCollectorHost) &&
+                isHostComponentLive(clusterName, currentCollectorHost, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name()))
+              ) {
+              LOG.info("New Metrics collector Host : " + hostName);
+              clusterMetricCollectorMap.put(clusterName, hostName);
             }
             metricServerHosts.add(hostName);
           }


[14/21] ambari git commit: AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)

Posted by dm...@apache.org.
AMBARI-15090. [Ambari tarballs] ambari-server python scripts should support running from custom root (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6d121dd6e361b36a144134cd6f89c72e7cc17f27
Parents: 0818202
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 18 23:43:19 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 18 23:43:41 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/test/python/TestOSCheck.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d121dd6/ambari-server/src/test/python/TestOSCheck.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestOSCheck.py b/ambari-server/src/test/python/TestOSCheck.py
index d919fbc..2d9f737 100644
--- a/ambari-server/src/test/python/TestOSCheck.py
+++ b/ambari-server/src/test/python/TestOSCheck.py
@@ -38,6 +38,7 @@ utils = __import__('ambari_server.utils').utils
 with patch("platform.linux_distribution", return_value = os_distro_value_linux):
   with patch.object(OSCheck, "os_distribution", return_value = os_distro_value):
     with patch.object(utils, "get_postgre_hba_dir"):
+      os.environ["ROOT"] = ""
       ambari_server = __import__('ambari-server')
 
       from ambari_server.serverConfiguration import update_ambari_properties, configDefaults


[21/21] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade

Posted by dm...@apache.org.
Merge branch 'trunk' into branch-dev-patch-upgrade


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4b5a250e7778ffa89e318d293dafe727d8a20644
Parents: 418745d d48fb9b
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Feb 19 15:24:50 2016 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Feb 19 15:24:50 2016 +0200

----------------------------------------------------------------------
 .../src/main/repo/install_ambari_tarball.py     |   2 +-
 ambari-server/conf/unix/ambari-env.sh           |   6 +-
 ambari-server/conf/unix/ambari.properties       |  30 +--
 ambari-server/conf/unix/install-helper.sh       |   7 +-
 ambari-server/conf/unix/log4j.properties        |   2 +-
 ambari-server/conf/windows/log4j.properties     |   2 +-
 ambari-server/pom.xml                           |  14 ++
 ambari-server/sbin/ambari-server                |  57 +++--
 ambari-server/src/main/conf/log4j.properties    |   2 +-
 .../controller/AmbariActionExecutionHelper.java |  13 +-
 .../ambari/server/controller/AmbariServer.java  |   3 +-
 .../internal/AbstractProviderModule.java        |  31 +--
 .../internal/UpgradeResourceProvider.java       |   1 +
 .../controller/utilities/DatabaseChecker.java   |   2 +-
 .../ambari/server/stack/MasterHostResolver.java |  53 ++--
 .../src/main/package/deb/control/preinst        |   2 +-
 ambari-server/src/main/python/ambari-server.py  |  17 +-
 .../main/python/ambari_server/BackupRestore.py  |  11 +-
 .../src/main/python/ambari_server/ambariPath.py |  41 ++++
 .../ambari_server/dbConfiguration_linux.py      |  29 +--
 .../python/ambari_server/serverConfiguration.py | 103 ++++----
 .../main/python/ambari_server/serverSetup.py    |   6 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |   2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql     |   2 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |   2 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |   2 +-
 .../common-services/HAWQ/2.0.0/metainfo.xml     |  16 ++
 .../HAWQ/2.0.0/package/scripts/common.py        |   9 +-
 .../2.0.0/package/scripts/hawq_constants.py     |   2 +-
 .../HAWQ/2.0.0/package/scripts/hawqmaster.py    |  19 ++
 .../HAWQ/2.0.0/package/scripts/master_helper.py |  16 +-
 .../HAWQ/2.0.0/package/scripts/params.py        |   6 +
 .../HAWQ/2.0.0/package/templates/hawq-hosts.j2  |  22 --
 .../HAWQ/2.0.0/package/templates/slaves.j2      |  22 --
 .../1.4.4.2.0/configuration/sqoop-site.xml      |  43 ++++
 .../SQOOP/1.4.4.2.0/metainfo.xml                |   6 +
 .../1.4.4.2.0/package/scripts/params_linux.py   |  20 +-
 .../SQOOP/1.4.4.2.0/package/scripts/sqoop.py    |  26 ++
 .../main/resources/scripts/Ambaripreupload.py   |   7 +
 .../stacks/HDP/2.2/role_command_order.json      |   1 -
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml |  13 +-
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml     |   2 +
 .../main/resources/stacks/HDP/2.6/metainfo.xml  |  25 ++
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml |  92 +++++++
 .../HDP/2.6/services/ACCUMULO/metainfo.xml      |  26 ++
 .../stacks/HDP/2.6/services/ATLAS/metainfo.xml  |  26 ++
 .../stacks/HDP/2.6/services/FALCON/metainfo.xml |  26 ++
 .../stacks/HDP/2.6/services/FLUME/metainfo.xml  |  26 ++
 .../stacks/HDP/2.6/services/HBASE/metainfo.xml  |  26 ++
 .../stacks/HDP/2.6/services/HDFS/metainfo.xml   |  26 ++
 .../stacks/HDP/2.6/services/HIVE/metainfo.xml   |  26 ++
 .../stacks/HDP/2.6/services/KAFKA/metainfo.xml  |  26 ++
 .../HDP/2.6/services/KERBEROS/metainfo.xml      |  25 ++
 .../stacks/HDP/2.6/services/KNOX/metainfo.xml   |  26 ++
 .../stacks/HDP/2.6/services/MAHOUT/metainfo.xml |  26 ++
 .../stacks/HDP/2.6/services/OOZIE/metainfo.xml  |  26 ++
 .../stacks/HDP/2.6/services/PIG/metainfo.xml    |  26 ++
 .../stacks/HDP/2.6/services/RANGER/metainfo.xml |  29 +++
 .../HDP/2.6/services/RANGER_KMS/metainfo.xml    |  29 +++
 .../stacks/HDP/2.6/services/SLIDER/metainfo.xml |  26 ++
 .../stacks/HDP/2.6/services/SPARK/metainfo.xml  |  29 +++
 .../stacks/HDP/2.6/services/SQOOP/metainfo.xml  |  26 ++
 .../stacks/HDP/2.6/services/STORM/metainfo.xml  |  27 +++
 .../stacks/HDP/2.6/services/TEZ/metainfo.xml    |  26 ++
 .../stacks/HDP/2.6/services/YARN/metainfo.xml   |  27 +++
 .../HDP/2.6/services/ZOOKEEPER/metainfo.xml     |  26 ++
 .../stacks/HDP/2.6/services/stack_advisor.py    |  22 ++
 .../AmbariManagementControllerTest.java         |   2 +-
 .../ambari/server/state/UpgradeHelperTest.java  | 140 +++++++++--
 .../ambari/server/utils/TestVersionUtils.java   |   2 +
 .../src/test/python/TestAmbariServer.py         |   2 +-
 .../src/test/python/TestBackupRestore.py        |   3 +
 ambari-server/src/test/python/TestOSCheck.py    |   1 +
 .../src/test/python/TestResourceFilesKeeper.py  |   3 +
 .../src/test/python/TestServerClassPath.py      |   3 +
 .../src/test/python/TestServerUpgrade.py        |   2 +
 .../src/test/python/TestServerUtils.py          |   3 +
 .../2.0.6/HBASE/test_phoenix_queryserver.py     |   9 +-
 .../python/stacks/2.0.6/SQOOP/test_sqoop.py     |  12 +
 .../python/stacks/2.0.6/configs/default.json    |   5 +
 .../python/stacks/2.0.6/configs/secured.json    |   5 +
 .../test/python/stacks/2.3/configs/default.json |   5 +
 .../alerts/definition_configs_controller.js     |   1 +
 .../service/widgets/create/wizard_controller.js |  16 +-
 .../app/controllers/wizard/step8_controller.js  | 240 ++++++-------------
 ambari-web/app/messages.js                      |   8 +-
 .../mixins/common/configs/configs_comparator.js |   4 +-
 .../app/mixins/common/configs/configs_saver.js  | 217 +++++++----------
 ambari-web/app/models/host_component.js         |  44 +++-
 .../alerts/configs/alert_config_parameter.hbs   |   2 +-
 ambari-web/app/utils/helper.js                  |  20 +-
 .../stack_upgrade/upgrade_version_box_view.js   |   8 +-
 .../main/alerts/definition_configs_view.js      |  10 +-
 ambari-web/app/views/main/service/item.js       |   2 +-
 .../views/main/service/reassign/step5_view.js   |  16 +-
 .../test/controllers/wizard/step4_test.js       |  36 ++-
 .../test/controllers/wizard/step8_test.js       | 176 +-------------
 .../mixins/common/configs/configs_saver_test.js |  98 ++++----
 ambari-web/test/utils/config_test.js            |   4 -
 .../upgrade_version_box_view_test.js            |  17 +-
 .../views/main/service/info/summary_test.js     |   4 +-
 103 files changed, 1691 insertions(+), 826 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --cc ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index f8e4ee1,e43a7fc..026efea
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@@ -1010,10 -990,8 +1010,10 @@@ INSERT INTO ambari_sequences(sequence_n
  INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('topology_host_group_id_seq', 0);
  INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('setting_id_seq', 0);
  INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('hostcomponentstate_id_seq', 0);
 +INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('servicecomponentdesiredstate_id_seq', 0);
 +INSERT INTO ambari_sequences(sequence_name, sequence_value) values ('servicecomponent_history_id_seq', 0);
  
- INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariVersion}');
+ INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariSchemaVersion}');
  
  insert into adminresourcetype (resource_type_id, resource_type_name)
    select 1, 'AMBARI' from dual

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-web/app/messages.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b5a250e/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------


[08/21] ambari git commit: AMBARI-15092. Oozie sharelib missing SQL JDBC driver (aonishuk)

Posted by dm...@apache.org.
AMBARI-15092. Oozie sharelib missing SQL JDBC driver (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1d7af0ebd37e2e0d01d6e03380cd52750754fea3
Parents: fab9fa5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 18 19:43:10 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Feb 18 19:43:10 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/main/resources/scripts/Ambaripreupload.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1d7af0eb/ambari-server/src/main/resources/scripts/Ambaripreupload.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index a803de4..cc6213e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -43,6 +43,8 @@ from resource_management.libraries.functions.format import format
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.resources.execute_hadoop import ExecuteHadoop
 from resource_management import Script
+
+SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
  
 """
 This file provides helper methods needed for the versioning of RPMs. Specifically, it does dynamic variable
@@ -266,6 +268,10 @@ with Environment() as env:
     with open("/var/lib/ambari-agent/data/.hdfs_resource_ignore", "a+") as fp:
       fp.write(file_content)
       
+  def putSQLDriverToOozieShared():
+    params.HdfsResource('/user/oozie/share/lib/sqoop/{0}'.format(os.path.basename(SQL_DRIVER_PATH)),
+                        owner='hdfs', type='file', action=['create_on_execute'], mode=0644, source=SQL_DRIVER_PATH)
+      
   env.set_params(params)
   hadoop_conf_dir = params.hadoop_conf_dir
    
@@ -374,6 +380,7 @@ with Environment() as env:
   copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/sqoop/sqoop.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/sqoop/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group)
   print "Creating hdfs directories..."
   createHdfsResources()
+  putSQLDriverToOozieShared()
   putCreatedHdfsResourcesToIgnore(env)
   
   # jar shouldn't be used before (read comment below)


[19/21] ambari git commit: AMBARI-15110 On large cluster clicking on 'Install Packages' does not show the 'Installing' progress bar. (atkach)

Posted by dm...@apache.org.
AMBARI-15110 On large cluster clicking on 'Install Packages' does not show the 'Installing' progress bar. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9c9b4ab3b6c7822168ad2c5e408ead2170ecc65d
Parents: 0941997
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Fri Feb 19 11:38:18 2016 +0200
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Fri Feb 19 11:38:18 2016 +0200

----------------------------------------------------------------------
 .../stack_upgrade/upgrade_version_box_view.js      |  8 ++++++--
 .../stack_upgrade/upgrade_version_box_view_test.js | 17 ++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c9b4ab3/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 20280fe..0721234 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -41,8 +41,12 @@ App.UpgradeVersionBoxView = Em.View.extend({
    * @type {number}
    */
   installProgress: function() {
-    var requestId = App.get('testMode') ? 1 : App.db.get('repoVersionInstall', 'id')[0];
-    var installRequest = App.router.get('backgroundOperationsController.services').findProperty('id', requestId);
+    if (App.get('testMode')) return 100;
+
+    var installRequest, requestIds = App.db.get('repoVersionInstall', 'id');
+    if (requestIds) {
+      installRequest = App.router.get('backgroundOperationsController.services').findProperty('id', requestIds[0]);
+    }
     return (installRequest) ? installRequest.get('progress') : 0;
   }.property('App.router.backgroundOperationsController.serviceTimestamp'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c9b4ab3/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index e432813..5746d3a 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -79,21 +79,32 @@ describe('App.UpgradeVersionBoxView', function () {
   });
 
   describe("#installProgress", function () {
+
     beforeEach(function () {
-      sinon.stub(App.db, 'get').returns(1);
+      this.mockDB = sinon.stub(App.db, 'get');
       this.mock = sinon.stub(App.router, 'get');
+      App.set('testMode', false);
     });
     afterEach(function () {
-      App.db.get.restore();
+      this.mockDB.restore();
       this.mock.restore();
     });
+
+    it("request id is not set", function () {
+      this.mock.returns([]);
+      this.mockDB.returns(undefined);
+      view.propertyDidChange('installProgress');
+      expect(view.get('installProgress')).to.equal(0);
+    });
     it("request absent", function () {
       this.mock.returns([]);
+      this.mockDB.returns([1]);
       view.propertyDidChange('installProgress');
       expect(view.get('installProgress')).to.equal(0);
     });
     it("request present", function () {
-      this.mock.returns([Em.Object.create({progress: 100})]);
+      this.mockDB.returns([1]);
+      this.mock.returns([Em.Object.create({progress: 100, id: 1})]);
       view.propertyDidChange('installProgress');
       expect(view.get('installProgress')).to.equal(100);
     });


[11/21] ambari git commit: AMBARI-15075. Edit Widget Wizard still open even though it was closed/saved in the previous step. (jaimin)

Posted by dm...@apache.org.
AMBARI-15075. Edit Widget Wizard still open even though it was closed/saved in the previous step. (jaimin)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b09994b81c29ce0b9b835205ea7b8ff161a5f517
Parents: 8f58e5f
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Feb 19 01:00:08 2016 +0530
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Feb 19 01:02:45 2016 +0530

----------------------------------------------------------------------
 .../service/widgets/create/wizard_controller.js     | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b09994b8/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js b/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
index 69f63ed..d45b936 100644
--- a/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
+++ b/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
@@ -416,14 +416,21 @@ App.WidgetWizardController = App.WizardController.extend({
     var service = App.Service.find(this.get('content.widgetService'));
 
     this.finish();
-    this.get('popup').hide();
-    App.router.transitionTo('main.services.service.summary', service);
-    if (!App.get('testMode')) {
+    var self = this;
+    var successCallBack = function() {
+      self.get('popup').hide();
+      App.router.transitionTo('main.services.service.summary', service);
+      App.get('router.updateController').updateAll();
+    };
+
+    if (App.get('testMode')) {
+      successCallBack();
+    } else {
       App.clusterStatus.setClusterStatus({
         clusterName: App.router.getClusterName(),
         clusterState: 'DEFAULT',
         localdb: App.db.data
-      });
+      }, {successCallback: successCallBack});
     }
   },
 
@@ -435,6 +442,5 @@ App.WidgetWizardController = App.WizardController.extend({
     this.setCurrentStep('1', false, true);
     this.save('widgetType', '');
     this.resetDbNamespace();
-    App.get('router.updateController').updateAll();
   }
 });