You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2017/10/18 14:18:15 UTC

[01/13] ambari git commit: AMBARI-22245 - YARN Service Checks Fails Because of Old hadoop-client Classpath Entry (jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-20859 553e4f9d2 -> 06676d66e


AMBARI-22245 - YARN Service Checks Fails Because of Old hadoop-client Classpath Entry (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4a2235037e2306ac8197f8d1bf917f5402f248bb
Parents: 523f505
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Oct 16 15:33:17 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Oct 16 16:13:00 2017 -0400

----------------------------------------------------------------------
 .../2.1.0.2.0/package/scripts/params_linux.py   | 34 +++++++++++--
 .../2.1.0.2.0/package/scripts/status_params.py  | 52 ++++++++-----------
 .../YARN/3.0.0.3.0/configuration/yarn-site.xml  |  2 +-
 .../3.0.0.3.0/package/scripts/params_linux.py   | 53 +++++++++++++++-----
 .../3.0.0.3.0/package/scripts/status_params.py  | 52 ++++++++-----------
 .../services/YARN/configuration/yarn-site.xml   |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  |  7 +++
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |  7 ++-
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |  1 +
 9 files changed, 124 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 2ab779f..620408b 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -20,8 +20,10 @@ Ambari Agent
 """
 import os
 
+from resource_management.core import sudo
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
+from resource_management.libraries.functions import component_version
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import format
@@ -88,6 +90,7 @@ stack_supports_ranger_audit_db = check_stack_feature(StackFeature.RANGER_AUDIT_D
 hostname = config['hostname']
 
 # hadoop default parameters
+hadoop_home = status_params.hadoop_home
 hadoop_libexec_dir = stack_select.get_hadoop_dir("libexec")
 hadoop_bin = stack_select.get_hadoop_dir("sbin")
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
@@ -113,12 +116,33 @@ if stack_supports_ru:
   if command_role in YARN_SERVER_ROLE_DIRECTORY_MAP:
     yarn_role_root = YARN_SERVER_ROLE_DIRECTORY_MAP[command_role]
 
-  hadoop_mapred2_jar_location = format("{stack_root}/current/{mapred_role_root}")
-  mapred_bin = format("{stack_root}/current/{mapred_role_root}/sbin")
-
+  # defaults set to current based on role
+  hadoop_mapr_home = format("{stack_root}/current/{mapred_role_root}")
   hadoop_yarn_home = format("{stack_root}/current/{yarn_role_root}")
-  yarn_bin = format("{stack_root}/current/{yarn_role_root}/sbin")
-  yarn_container_bin = format("{stack_root}/current/{yarn_role_root}/bin")
+
+  # try to render the specific version
+  version = component_version.get_component_repository_version()
+  if version is None:
+    version = default("/commandParams/version", None)
+
+
+  if version is not None:
+    hadoop_mapr_versioned_home = format("{stack_root}/{version}/hadoop-mapreduce")
+    hadoop_yarn_versioned_home = format("{stack_root}/{version}/hadoop-yarn")
+
+    if sudo.path_isdir(hadoop_mapr_versioned_home):
+      hadoop_mapr_home = hadoop_mapr_versioned_home
+
+    if sudo.path_isdir(hadoop_yarn_versioned_home):
+      hadoop_yarn_home = hadoop_yarn_versioned_home
+
+
+  hadoop_mapred2_jar_location = hadoop_mapr_home
+  mapred_bin = format("{hadoop_mapr_home}/sbin")
+
+  yarn_bin = format("{hadoop_yarn_home}/sbin")
+  yarn_container_bin = format("{hadoop_yarn_home}/bin")
+
 
 if stack_supports_timeline_state_store:
   # Timeline Service property that was added timeline_state_store stack feature

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/status_params.py
index c2e9d92..6bb528f 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/status_params.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/status_params.py
@@ -19,43 +19,31 @@ limitations under the License.
 """
 from resource_management.libraries.script.script import Script
 from resource_management.libraries import functions
+from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions.default import default
-from ambari_commons import OSCheck
 
 config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 
-if OSCheck.is_windows_family():
-  resourcemanager_win_service_name = 'resourcemanager'
-  nodemanager_win_service_name = 'nodemanager'
-  historyserver_win_service_name = 'historyserver'
-  timelineserver_win_service_name = 'timelineserver'
-
-  service_map = {
-    'resourcemanager' : resourcemanager_win_service_name,
-    'nodemanager' : nodemanager_win_service_name,
-    'historyserver' : historyserver_win_service_name,
-    'timelineserver' : timelineserver_win_service_name
-  }
-else:
-  mapred_user = config['configurations']['mapred-env']['mapred_user']
-  yarn_user = config['configurations']['yarn-env']['yarn_user']
-  yarn_pid_dir_prefix = config['configurations']['yarn-env']['yarn_pid_dir_prefix']
-  mapred_pid_dir_prefix = config['configurations']['mapred-env']['mapred_pid_dir_prefix']
-  yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
-  mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
-
-  resourcemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-resourcemanager.pid")
-  nodemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-nodemanager.pid")
-  yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/yarn-{yarn_user}-historyserver.pid")
-  yarn_historyserver_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
-  mapred_historyserver_pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-historyserver.pid")
-
-  hadoop_conf_dir = functions.conf_select.get_hadoop_conf_dir()
-
-  hostname = config['hostname']
-  kinit_path_local = functions.get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
-  security_enabled = config['configurations']['cluster-env']['security_enabled']
+mapred_user = config['configurations']['mapred-env']['mapred_user']
+yarn_user = config['configurations']['yarn-env']['yarn_user']
+yarn_pid_dir_prefix = config['configurations']['yarn-env']['yarn_pid_dir_prefix']
+mapred_pid_dir_prefix = config['configurations']['mapred-env']['mapred_pid_dir_prefix']
+yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
+mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
+
+resourcemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-resourcemanager.pid")
+nodemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-nodemanager.pid")
+yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/yarn-{yarn_user}-historyserver.pid")
+yarn_historyserver_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
+mapred_historyserver_pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-historyserver.pid")
+
+hadoop_home = stack_select.get_hadoop_dir("home")
+hadoop_conf_dir = functions.conf_select.get_hadoop_conf_dir()
+
+hostname = config['hostname']
+kinit_path_local = functions.get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
+security_enabled = config['configurations']['cluster-env']['security_enabled']
 
 stack_name = default("/hostLevelParams/stack_name", None)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration/yarn-site.xml b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration/yarn-site.xml
index 2a69d35..6f571e4 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration/yarn-site.xml
@@ -151,7 +151,7 @@
   </property>
   <property>
     <name>yarn.application.classpath</name>
-    <value>$HADOOP_CONF_DIR,{{stack_root}}/current/hadoop-client/*,{{stack_root}}/current/hadoop-client/lib/*,{{stack_root}}/current/hadoop-hdfs-client/*,{{stack_root}}/current/hadoop-hdfs-client/lib/*,{{stack_root}}/current/hadoop-yarn-client/*,{{stack_root}}/current/hadoop-yarn-client/lib/*</value>
+    <value>$HADOOP_CONF_DIR,{{hadoop_home}}/*,{{hadoop_home}}/lib/*,{{stack_root}}/current/hadoop-hdfs-client/*,{{stack_root}}/current/hadoop-hdfs-client/lib/*,{{stack_root}}/current/hadoop-yarn-client/*,{{stack_root}}/current/hadoop-yarn-client/lib/*</value>
     <description>Classpath for typical applications.</description>
     <on-ambari-upgrade add="false"/>
   </property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
index e66ec3c..e4dbe2c 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/params_linux.py
@@ -20,8 +20,10 @@ Ambari Agent
 """
 import os
 
+from resource_management.core import sudo
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
+from resource_management.libraries.functions import component_version
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import format
@@ -30,12 +32,13 @@ from resource_management.libraries.functions.stack_features import check_stack_f
 from resource_management.libraries.functions.stack_features import get_stack_feature_version
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.libraries.functions.get_not_managed_resources import get_not_managed_resources
-from resource_management.libraries.functions.version import format_stack_version
+from resource_management.libraries.functions.version import format_stack_version, get_major_version
 from resource_management.libraries.functions.default import default
 from resource_management.libraries import functions
 from resource_management.libraries.functions import is_empty
 from resource_management.libraries.functions.get_architecture import get_architecture
 from resource_management.libraries.functions.setup_ranger_plugin_xml import get_audit_configs, generate_ranger_service_config
+
 import status_params
 
 # a map of the Ambari role to the component name
@@ -65,30 +68,33 @@ tarball_map = default("/configurations/cluster-env/tarball_map", None)
 config_path = os.path.join(stack_root, "current/hadoop-client/conf")
 config_dir = os.path.realpath(config_path)
 
+# get the correct version to use for checking stack features
+version_for_stack_feature_checks = get_stack_feature_version(config)
+
 # This is expected to be of the form #.#.#.#
 stack_version_unformatted = config['hostLevelParams']['stack_version']
 stack_version_formatted_major = format_stack_version(stack_version_unformatted)
 stack_version_formatted = functions.get_stack_version('hadoop-yarn-resourcemanager')
+major_stack_version = get_major_version(stack_version_formatted_major)
 
-stack_supports_ru = stack_version_formatted_major and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted_major)
-stack_supports_timeline_state_store = stack_version_formatted_major and check_stack_feature(StackFeature.TIMELINE_STATE_STORE, stack_version_formatted_major)
+stack_supports_ru = check_stack_feature(StackFeature.ROLLING_UPGRADE, version_for_stack_feature_checks)
+stack_supports_timeline_state_store = check_stack_feature(StackFeature.TIMELINE_STATE_STORE, version_for_stack_feature_checks)
 
 # New Cluster Stack Version that is defined during the RESTART of a Stack Upgrade.
 # It cannot be used during the initial Cluser Install because the version is not yet known.
 version = default("/commandParams/version", None)
 
-# get the correct version to use for checking stack features
-version_for_stack_feature_checks = get_stack_feature_version(config)
-
 stack_supports_ranger_kerberos = check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, version_for_stack_feature_checks)
 stack_supports_ranger_audit_db = check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, version_for_stack_feature_checks)
 
 hostname = config['hostname']
 
 # hadoop default parameters
+hadoop_home = status_params.hadoop_home
 hadoop_libexec_dir = stack_select.get_hadoop_dir("libexec")
 hadoop_bin = stack_select.get_hadoop_dir("sbin")
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
+hadoop_lib_home = stack_select.get_hadoop_dir("lib")
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hadoop_yarn_home = '/usr/lib/hadoop-yarn'
 hadoop_mapred2_jar_location = "/usr/lib/hadoop-mapreduce"
@@ -110,12 +116,33 @@ if stack_supports_ru:
   if command_role in YARN_SERVER_ROLE_DIRECTORY_MAP:
     yarn_role_root = YARN_SERVER_ROLE_DIRECTORY_MAP[command_role]
 
-  hadoop_mapred2_jar_location = format("{stack_root}/current/{mapred_role_root}")
-  mapred_bin = format("{stack_root}/current/{mapred_role_root}/sbin")
-
+  # defaults set to current based on role
+  hadoop_mapr_home = format("{stack_root}/current/{mapred_role_root}")
   hadoop_yarn_home = format("{stack_root}/current/{yarn_role_root}")
-  yarn_bin = format("{stack_root}/current/{yarn_role_root}/sbin")
-  yarn_container_bin = format("{stack_root}/current/{yarn_role_root}/bin")
+
+  # try to render the specific version
+  version = component_version.get_component_repository_version()
+  if version is None:
+    version = default("/commandParams/version", None)
+
+
+  if version is not None:
+    hadoop_mapr_versioned_home = format("{stack_root}/{version}/hadoop-mapreduce")
+    hadoop_yarn_versioned_home = format("{stack_root}/{version}/hadoop-yarn")
+
+    if sudo.path_isdir(hadoop_mapr_versioned_home):
+      hadoop_mapr_home = hadoop_mapr_versioned_home
+
+    if sudo.path_isdir(hadoop_yarn_versioned_home):
+      hadoop_yarn_home = hadoop_yarn_versioned_home
+
+
+  hadoop_mapred2_jar_location = hadoop_mapr_home
+  mapred_bin = format("{hadoop_mapr_home}/sbin")
+
+  yarn_bin = format("{hadoop_yarn_home}/sbin")
+  yarn_container_bin = format("{hadoop_yarn_home}/bin")
+
 
 if stack_supports_timeline_state_store:
   # Timeline Service property that was added timeline_state_store stack feature
@@ -347,7 +374,7 @@ HdfsResource = functools.partial(
   immutable_paths = get_not_managed_resources(),
   dfs_type = dfs_type
  )
-update_files_only = default("/commandParams/update_files_only", False)
+update_files_only = default("/commandParams/update_files_only",False)
 
 mapred_tt_group = default("/configurations/mapred-site/mapreduce.tasktracker.group", user_group)
 
@@ -365,7 +392,7 @@ cgroups_dir = "/cgroups_test/cpu"
 
 # hostname of the active HDFS HA Namenode (only used when HA is enabled)
 dfs_ha_namenode_active = default("/configurations/hadoop-env/dfs_ha_initial_namenode_active", None)
-if dfs_ha_namenode_active is not None: 
+if dfs_ha_namenode_active is not None:
   namenode_hostname = dfs_ha_namenode_active
 else:
   namenode_hostname = config['clusterHostInfo']['namenode_host'][0]

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
index 7c1b2c7..6bb528f 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
@@ -19,43 +19,31 @@ limitations under the License.
 """
 from resource_management.libraries.script.script import Script
 from resource_management.libraries import functions
+from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions.default import default
-from ambari_commons import OSCheck
 
 config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 
-if OSCheck.is_windows_family():
-  resourcemanager_win_service_name = 'resourcemanager'
-  nodemanager_win_service_name = 'nodemanager'
-  historyserver_win_service_name = 'historyserver'
-  timelineserver_win_service_name = 'timelineserver'
-
-  service_map = {
-    'resourcemanager' : resourcemanager_win_service_name,
-    'nodemanager' : nodemanager_win_service_name,
-    'historyserver' : historyserver_win_service_name,
-    'timelineserver' : timelineserver_win_service_name
-  }
-else:
-  mapred_user = config['configurations']['mapred-env']['mapred_user']
-  yarn_user = config['configurations']['yarn-env']['yarn_user']
-  yarn_pid_dir_prefix = config['configurations']['yarn-env']['yarn_pid_dir_prefix']
-  mapred_pid_dir_prefix = config['configurations']['mapred-env']['mapred_pid_dir_prefix']
-  yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
-  mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
-
-  resourcemanager_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-resourcemanager.pid")
-  nodemanager_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-nodemanager.pid")
-  yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/hadoop-{yarn_user}-historyserver.pid")
-  yarn_historyserver_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
-  mapred_historyserver_pid_file = format("{mapred_pid_dir}/hadoop-{mapred_user}-historyserver.pid")
-
-  hadoop_conf_dir = functions.conf_select.get_hadoop_conf_dir()
-
-  hostname = config['hostname']
-  kinit_path_local = functions.get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
-  security_enabled = config['configurations']['cluster-env']['security_enabled']
+mapred_user = config['configurations']['mapred-env']['mapred_user']
+yarn_user = config['configurations']['yarn-env']['yarn_user']
+yarn_pid_dir_prefix = config['configurations']['yarn-env']['yarn_pid_dir_prefix']
+mapred_pid_dir_prefix = config['configurations']['mapred-env']['mapred_pid_dir_prefix']
+yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
+mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
+
+resourcemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-resourcemanager.pid")
+nodemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-nodemanager.pid")
+yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/yarn-{yarn_user}-historyserver.pid")
+yarn_historyserver_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
+mapred_historyserver_pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-historyserver.pid")
+
+hadoop_home = stack_select.get_hadoop_dir("home")
+hadoop_conf_dir = functions.conf_select.get_hadoop_conf_dir()
+
+hostname = config['hostname']
+kinit_path_local = functions.get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
+security_enabled = config['configurations']['cluster-env']['security_enabled']
 
 stack_name = default("/hostLevelParams/stack_name", None)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml
index b5eedea..71c63c1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml
@@ -19,7 +19,7 @@
 <configuration supports_final="true">
   <property>
     <name>yarn.application.classpath</name>
-    <value>/etc/hadoop/conf,/usr/hdp/current/hadoop-client/*,/usr/hdp/current/hadoop-client/lib/*,/usr/hdp/current/hadoop-hdfs-client/*,/usr/hdp/current/hadoop-hdfs-client/lib/*,/usr/hdp/current/hadoop-yarn-client/*,/usr/hdp/current/hadoop-yarn-client/lib/*,/usr/hdp/current/ext/hadoop/*</value>
+    <value>{{hadoop_home}}/conf,{{hadoop_home}}/*,{{hadoop_home}}/lib/*,/usr/hdp/current/hadoop-hdfs-client/*,/usr/hdp/current/hadoop-hdfs-client/lib/*,/usr/hdp/current/hadoop-yarn-client/*,/usr/hdp/current/hadoop-yarn-client/lib/*,/usr/hdp/current/ext/hadoop/*</value>
     <description>Classpath for typical applications.</description>
     <on-ambari-upgrade add="true"/>
   </property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
index fd7e438..91044d8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
@@ -155,6 +155,13 @@
               if-key="yarn.resourcemanager.monitor.capacity.preemption.natural_termination_factor"
               if-key-state="absent" />
           </definition>
+
+
+          <definition xsi:type="configure" id="hdp_2_6_yarn_app_classpath_parameterization" summary="Application Classpath Parameterization">
+            <type>yarn-site</type>
+            <replace key="yarn.application.classpath" find="/usr/hdp/current/hadoop-client" replace-with="{{hadoop_home}}"/>
+          </definition>
+
         </changes>
       </component>
       <component name="NODEMANAGER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
index 832c505..0b5e8c1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
@@ -279,8 +279,7 @@
     <!-- After processing this group, will change the effective Stack of the UpgradeContext object. -->
     <group xsi:type="update-stack" name="UPDATE_DESIRED_REPOSITORY_ID" title="Update Target Repositories">
       <execute-stage title="Update Target Repositories">
-        <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredRepositoryAction">
-        </task>
+        <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredRepositoryAction"/>
       </execute-stage>
     </group>
 
@@ -343,6 +342,10 @@
         <task xsi:type="configure" id="hdp_2_6_yarn_preemption"/>
       </execute-stage>
 
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Application Classpath Parameterization">
+        <task xsi:type="configure" id="hdp_2_6_yarn_app_classpath_parameterization" supports-patch="true"/>
+      </execute-stage>
+
       <!-- YARN -->
       <execute-stage service="YARN" component="NODEMANAGER" title="Apply config changes for YARN NM">
         <task xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_llap_mem">

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a223503/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
index d0e11a1..00597c6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
@@ -696,6 +696,7 @@
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_6_maint_ranger_yarn_plugin_cluster_name"/>
           <task xsi:type="configure" id="hdp_2_6_yarn_preemption" />
+          <task xsi:type="configure" id="hdp_2_6_yarn_app_classpath_parameterization" supports-patch="true"/>
         </pre-upgrade>
         <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <upgrade>


[12/13] ambari git commit: AMBARI-22250. Upgrade option not showing in stack versions. (Ishan Bhatt via yusaku)

Posted by rl...@apache.org.
AMBARI-22250. Upgrade option not showing in stack versions. (Ishan Bhatt via yusaku)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: ee509e08fa25545953d78450997b3a47bf68f904
Parents: 881e15d
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Oct 17 15:41:20 2017 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Oct 17 15:41:20 2017 -0700

----------------------------------------------------------------------
 .../views/main/admin/stack_upgrade/upgrade_version_box_view.js   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee509e08/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 355ad88..c0786a3 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
@@ -279,9 +279,9 @@ App.UpgradeVersionBoxView = Em.View.extend({
         default:
           var isVersionColumnView = this.get('isVersionColumnView');
           var stackServices = this.get('content.stackServices');
-          var isUpgradable = stackServices && stackServices.some( function(stackService){
+          var isUpgradable = stackServices && (this.get('content.isStandard') || stackServices.some( function(stackService){
               return stackService.get('isUpgradable');
-          });
+          }));
           var isPatch = this.get('content.isPatch');
           var isMaint = this.get('content.isMaint');
 


[04/13] ambari git commit: AMBARI-22248. HBase default.rootdir config results in deploy failure if value is not overriden. (swagle)

Posted by rl...@apache.org.
AMBARI-22248. HBase default.rootdir config results in deploy failure if value is not overriden. (swagle)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e19029cbd419fc6512350c365e43faff60d4acc9
Parents: 79d4ac2
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Mon Oct 16 17:57:42 2017 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Mon Oct 16 17:57:42 2017 -0700

----------------------------------------------------------------------
 .../HBASE/0.96.0.2.0/configuration/hbase-site.xml  | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e19029cb/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
index 54ab35d..a48aad4 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
@@ -22,15 +22,16 @@
 <configuration supports_final="true">
   <property>
     <name>hbase.rootdir</name>
-    <value>hdfs://localhost:8020/apps/hbase/data</value>
+    <value>/apps/hbase/data</value>
     <description>The directory shared by region servers and into
-    which HBase persists.  The URL should be 'fully-qualified'
-    to include the filesystem scheme.  For example, to specify the
-    HDFS directory '/hbase' where the HDFS instance's namenode is
-    running at namenode.example.org on port 9000, set this value to:
-    hdfs://namenode.example.org:9000/hbase.  By default HBase writes
-    into /tmp.  Change this configuration else all data will be lost
-    on machine restart.
+      which HBase persists.  The URL should be 'fully-qualified'
+      to include the filesystem scheme.  For example, to specify the
+      HDFS directory '/hbase' where the HDFS instance's namenode is
+      running at namenode.example.org on port 9000, set this value to:
+      hdfs://namenode.example.org:9000/hbase.  By default HBase writes
+      into /tmp.  Change this configuration else all data will be lost
+      on machine restart. Ambari sets this a scheme less value which defaults to
+      a HDFS relative path.
     </description>
     <on-ambari-upgrade add="false"/>
   </property>


[08/13] ambari git commit: AMBARI-22257. Metrics collector fails to stop after Datanode is stopped in distributed mode. (swagle)

Posted by rl...@apache.org.
AMBARI-22257. Metrics collector fails to stop after Datanode is stopped in distributed mode. (swagle)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 53f028e92a6a783a161b4540e48484c7ecfaaf44
Parents: 448d6a8
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Tue Oct 17 10:47:43 2017 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Tue Oct 17 10:47:43 2017 -0700

----------------------------------------------------------------------
 .../src/main/resources/stacks/HDP/2.0.6/role_command_order.json    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/53f028e9/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
index 31f26e3..78a31f1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
@@ -56,7 +56,7 @@
     "NAMENODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP",
         "HISTORYSERVER-STOP", "HBASE_MASTER-STOP", "METRICS_COLLECTOR-STOP"],
     "DATANODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP",
-        "HISTORYSERVER-STOP", "HBASE_MASTER-STOP"],
+        "HISTORYSERVER-STOP", "HBASE_MASTER-STOP", "METRICS_COLLECTOR-STOP"],
     "METRICS_GRAFANA-START": ["METRICS_COLLECTOR-START"],
     "METRICS_COLLECTOR-STOP": ["METRICS_GRAFANA-STOP"]
   },


[03/13] ambari git commit: AMBARI-22245 - YARN Service Checks Fails Because of Old hadoop-client Classpath Entry (part2) (jonathanhurley)

Posted by rl...@apache.org.
AMBARI-22245 - YARN Service Checks Fails Because of Old hadoop-client Classpath Entry (part2) (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 79d4ac220d41a6bd7c5e77b34ecc230f439cd968
Parents: 75102dc
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Oct 16 20:06:40 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Oct 16 20:06:59 2017 -0400

----------------------------------------------------------------------
 .../YARN/3.0.0.3.0/package/scripts/status_params.py       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/79d4ac22/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
index 6bb528f..d2d1307 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/package/scripts/status_params.py
@@ -33,11 +33,11 @@ mapred_pid_dir_prefix = config['configurations']['mapred-env']['mapred_pid_dir_p
 yarn_pid_dir = format("{yarn_pid_dir_prefix}/{yarn_user}")
 mapred_pid_dir = format("{mapred_pid_dir_prefix}/{mapred_user}")
 
-resourcemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-resourcemanager.pid")
-nodemanager_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-nodemanager.pid")
-yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/yarn-{yarn_user}-historyserver.pid")
-yarn_historyserver_pid_file = format("{yarn_pid_dir}/yarn-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
-mapred_historyserver_pid_file = format("{mapred_pid_dir}/mapred-{mapred_user}-historyserver.pid")
+resourcemanager_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-resourcemanager.pid")
+nodemanager_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-nodemanager.pid")
+yarn_historyserver_pid_file_old = format("{yarn_pid_dir}/hadoop-{yarn_user}-historyserver.pid")
+yarn_historyserver_pid_file = format("{yarn_pid_dir}/hadoop-{yarn_user}-timelineserver.pid")  # *-historyserver.pid is deprecated
+mapred_historyserver_pid_file = format("{mapred_pid_dir}/hadoop-{mapred_user}-historyserver.pid")
 
 hadoop_home = stack_select.get_hadoop_dir("home")
 hadoop_conf_dir = functions.conf_select.get_hadoop_conf_dir()


[11/13] ambari git commit: Updated team page. (yusaku)

Posted by rl...@apache.org.
Updated team page. (yusaku)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 881e15d8d5c0ad3718e50e4427b8948c723ac255
Parents: b9f2670
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Oct 17 14:35:15 2017 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Oct 17 14:35:15 2017 -0700

----------------------------------------------------------------------
 docs/pom.xml | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/881e15d8/docs/pom.xml
----------------------------------------------------------------------
diff --git a/docs/pom.xml b/docs/pom.xml
index e041002..a75e093 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -196,7 +196,19 @@
             <organization>
                 Hortonworks
             </organization>
-        </developer>        
+        </developer>
+        <developer>
+            <id>anitajebaraj</id>
+            <name>Anita Jebaraj</name>
+            <email>anitajebaraj@apache.org</email>
+            <timezone></timezone>
+            <roles>
+                <role>Committer</role>
+            </roles>
+            <organization>
+                IBM
+            </organization>
+        </developer>
         <developer>
             <id>atkach</id>
             <name>Andrii Tkach</name>
@@ -362,6 +374,17 @@
             </organization>            
         </developer>
         <developer>
+            <id>dgergely</id>
+            <name>Daniel Gergely</name>
+            <email>dgergely</email>
+            <timezone>+1</timezone>
+            <roles>
+                <role>Committer</role>
+            </roles>
+            <organization>
+            </organization>
+        </developer>
+        <developer>
             <id>dillidorai</id>
             <name>Dilli Dorai</name>
             <email>dillidorai@apache.org</email>
@@ -852,6 +875,18 @@
             </organization>
         </developer>
         <developer>
+            <id>qin</id>
+            <name>Qin Liu</name>
+            <email>qin@apache.org</email>
+            <timezone></timezone>
+            <roles>
+                <role>Committer</role>
+            </roles>
+            <organization>
+                IBM
+            </organization>
+        </developer>
+        <developer>
             <id>ramya</id>
             <name>Ramya Sunil</name>
             <email>ramya@apache.org</email>
@@ -1137,6 +1172,18 @@
             </organization>
         </developer>       
         <developer>
+            <id>vishalsuvagia</id>
+            <name>Vishal Suvagia</name>
+            <email>vishalsuvagia@apache.org</email>
+            <timezone></timezone>
+            <roles>
+                <role>Committer</role>
+            </roles>
+            <organization>
+                Hortonworks
+            </organization>
+        </developer>
+        <developer>
             <id>vsairam</id>
             <name>Venkata Sairam Lanka</name>
             <email>vsairam@apache.org</email>


[06/13] ambari git commit: AMBARI-22246 Restart HDFS/JOURNALNODE failed on revert patch upgrade(dgrinenko)

Posted by rl...@apache.org.
AMBARI-22246 Restart HDFS/JOURNALNODE failed on revert patch upgrade(dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: ce29f8ce7762ed6c6d5c2f50d882b6e03b23acfc
Parents: d6cd303
Author: Dmytro Grinenko <ha...@apache.org>
Authored: Tue Oct 17 16:53:47 2017 +0300
Committer: Dmytro Grinenko <ha...@apache.org>
Committed: Tue Oct 17 16:53:47 2017 +0300

----------------------------------------------------------------------
 .../ambari/server/state/UpgradeContext.java     | 55 ++++++++++++++------
 .../ambari/server/state/UpgradeContextTest.java | 38 +++++++++++++-
 2 files changed, 75 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ce29f8ce/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
index de0f868..cb44adb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
@@ -261,6 +261,38 @@ public class UpgradeContext {
    */
   private RepositoryType m_orchestration = RepositoryType.STANDARD;
 
+  /**
+   * Reading upgrade type from provided request  or if nothing were provided,
+   * from previous upgrade for downgrade direction.
+   *
+   * @param upgradeRequestMap arguments provided for current upgrade request
+   * @param upgradeEntity previous upgrade entity, should be passed only for downgrade direction
+   *
+   * @return
+   * @throws AmbariException
+   */
+  private UpgradeType calculateUpgradeType(Map<String, Object> upgradeRequestMap,
+                                           UpgradeEntity upgradeEntity) throws AmbariException{
+
+    UpgradeType upgradeType = UpgradeType.ROLLING;
+
+    String upgradeTypeProperty = (String) upgradeRequestMap.get(UPGRADE_TYPE);
+    boolean upgradeTypePassed = StringUtils.isNotBlank(upgradeTypeProperty);
+
+    if (upgradeTypePassed){
+      try {
+        upgradeType = UpgradeType.valueOf(upgradeRequestMap.get(UPGRADE_TYPE).toString());
+      } catch (Exception e) {
+        throw new AmbariException(String.format("Property %s has an incorrect value of %s.",
+          UPGRADE_TYPE, upgradeTypeProperty));
+      }
+    } else if (upgradeEntity != null){
+      upgradeType = upgradeEntity.getUpgradeType();
+    }
+
+    return upgradeType;
+  }
+
   @AssistedInject
   public UpgradeContext(@Assisted Cluster cluster,
       @Assisted Map<String, Object> upgradeRequestMap, Gson gson, UpgradeHelper upgradeHelper,
@@ -271,23 +303,7 @@ public class UpgradeContext {
     m_upgradeHelper = upgradeHelper;
     m_upgradeDAO = upgradeDAO;
     m_repoVersionDAO = repoVersionDAO;
-
     m_cluster = cluster;
-
-    // determine upgrade type (default is ROLLING)
-    String upgradeTypeProperty = (String) upgradeRequestMap.get(UPGRADE_TYPE);
-    if (StringUtils.isNotBlank(upgradeTypeProperty)) {
-      try {
-        m_type = UpgradeType.valueOf(upgradeRequestMap.get(UPGRADE_TYPE).toString());
-      } catch (Exception e) {
-        throw new AmbariException(String.format("Property %s has an incorrect value of %s.",
-            UPGRADE_TYPE, upgradeTypeProperty));
-      }
-    } else {
-      // default type
-      m_type= UpgradeType.ROLLING;
-    }
-
     m_isRevert = upgradeRequestMap.containsKey(UPGRADE_REVERT_UPGRADE_ID);
 
     if (m_isRevert) {
@@ -316,13 +332,15 @@ public class UpgradeContext {
             "Only successfully completed upgrades can be reverted. Downgrades cannot be reverted.");
       }
 
-      if (revertableUpgrade.getId() != revertUpgrade.getId()) {
+      if (!revertableUpgrade.getId().equals(revertUpgrade.getId())) {
         throw new AmbariException(String.format(
             "The only upgrade which is currently allowed to be reverted for cluster %s is upgrade ID %s which was an upgrade to %s",
             cluster.getClusterName(), revertableUpgrade.getId(),
             revertableUpgrade.getRepositoryVersion().getVersion()));
       }
 
+      m_type = calculateUpgradeType(upgradeRequestMap, revertUpgrade);
+
       // !!! build all service-specific reversions
       Set<RepositoryVersionEntity> priors = new HashSet<>();
       Map<String, Service> clusterServices = cluster.getServices();
@@ -382,6 +400,8 @@ public class UpgradeContext {
                     UPGRADE_REPO_VERSION_ID, m_direction));
           }
 
+          m_type = calculateUpgradeType(upgradeRequestMap, null);
+
           // depending on the repository, add services
           m_repositoryVersion = m_repoVersionDAO.findByPK(Long.valueOf(repositoryVersionId));
           m_orchestration = m_repositoryVersion.getType();
@@ -396,6 +416,7 @@ public class UpgradeContext {
 
           m_repositoryVersion = upgrade.getRepositoryVersion();
           m_orchestration = upgrade.getOrchestration();
+          m_type = calculateUpgradeType(upgradeRequestMap, upgrade);
 
           // populate the repository maps for all services in the upgrade
           for (UpgradeHistoryEntity history : upgrade.getHistory()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ce29f8ce/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeContextTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeContextTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeContextTest.java
index 5176ffe..b38b272 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeContextTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeContextTest.java
@@ -317,7 +317,6 @@ public class UpgradeContextTest extends EasyMockSupport {
         EasyMock.anyObject(StackId.class), EasyMock.anyObject(Direction.class),
         EasyMock.anyObject(UpgradeType.class), EasyMock.anyString())).andReturn(upgradePack).once();
 
-
     expect(m_upgradeDAO.findRevertable(1L)).andReturn(m_completedRevertableUpgrade).once();
 
     Map<String, Object> requestMap = new HashMap<>();
@@ -337,6 +336,43 @@ public class UpgradeContextTest extends EasyMockSupport {
     verifyAll();
   }
 
+
+  /**
+   * Tests that the {@link UpgradeContext} for a EU reversion has the correct
+   * parameters set.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testRevertEU() throws Exception {
+    ConfigHelper configHelper = createNiceMock(ConfigHelper.class);
+    UpgradeHelper upgradeHelper = createNiceMock(UpgradeHelper.class);
+    UpgradePack upgradePack = createNiceMock(UpgradePack.class);
+
+    expect(upgradeHelper.suggestUpgradePack(EasyMock.anyString(), EasyMock.anyObject(StackId.class),
+      EasyMock.anyObject(StackId.class), EasyMock.anyObject(Direction.class),
+      EasyMock.anyObject(UpgradeType.class), EasyMock.anyString())).andReturn(upgradePack).once();
+
+    expect(m_upgradeDAO.findRevertable(1L)).andReturn(m_completedRevertableUpgrade).once();
+    expect(m_completedRevertableUpgrade.getUpgradeType()).andReturn(UpgradeType.NON_ROLLING);
+
+    Map<String, Object> requestMap = new HashMap<>();
+    requestMap.put(UpgradeResourceProvider.UPGRADE_REVERT_UPGRADE_ID, "1");
+
+    replayAll();
+
+    UpgradeContext context = new UpgradeContext(m_cluster, requestMap, null, upgradeHelper,
+      m_upgradeDAO, m_repositoryVersionDAO, configHelper);
+
+    assertEquals(Direction.DOWNGRADE, context.getDirection());
+    assertEquals(RepositoryType.PATCH, context.getOrchestrationType());
+    assertEquals(UpgradeType.NON_ROLLING, context.getType());
+    assertEquals(1, context.getSupportedServices().size());
+    assertTrue(context.isPatchRevert());
+
+    verifyAll();
+  }
+
   /**
    * Tests that the {@link UpgradeContext} for a reversion has the correct
    * services included in the reversion if one of the services in the original


[07/13] ambari git commit: AMBARI-22255. Make the install modal full screen (alexantonenko)

Posted by rl...@apache.org.
AMBARI-22255. Make the install modal full screen (alexantonenko)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 448d6a8b235583a20206b790bee8170de32f27b7
Parents: ce29f8c
Author: Alex Antonenko <aa...@hortonworks.com>
Authored: Tue Oct 17 20:26:49 2017 +0300
Committer: Alex Antonenko <aa...@hortonworks.com>
Committed: Tue Oct 17 20:26:49 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js             |  1 +
 ambari-web/app/routes/installer.js     |  3 +--
 ambari-web/app/routes/main.js          |  1 +
 ambari-web/app/styles/application.less |  3 +--
 ambari-web/app/styles/common.less      |  2 +-
 ambari-web/app/styles/wizard.less      | 24 +++++++++++++++++++++++-
 ambari-web/app/templates/installer.hbs |  2 +-
 7 files changed, 29 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 3c4f038..0123356 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -21,6 +21,7 @@ Em.I18n.translations = {
   'app.name':'Ambari',
   'app.name.subtitle':'Ambari - {0}',
   'app.name.subtitle.experimental':'Ambari Experimental',
+  'app.name.subtitle.installer':'Cluster Install Wizard',
   'app.reloadPopup.link': 'Reload Page',
   'app.reloadPopup.text': 'Trying to connect to server...',
   'app.reloadPopup.noClusterName.text': 'Failed to retrieve cluster name, trying to reload...',

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index ec8f1b9..f1f6659 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -35,8 +35,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           // check server/web client versions match
           App.router.get('installerController').checkServerClientVersion().done(function () {
 
-            var name = 'Cluster Install Wizard';
-            $('title').text('Ambari - ' + name);
+            $('title').text(Em.I18n.t('app.name.subtitle').format(Em.I18n.t('app.name.subtitle.installer')));
             $('#main').addClass('install-wizard-content');
 
             App.router.get('mainViewsController').loadAmbariViews();

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 7ed18de..d1f9012 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -40,6 +40,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           clusterController.loadAmbariProperties().complete(function () {
             App.router.get('mainViewsController').loadAmbariViews();
             clusterController.loadClusterName(false).done(function () {
+              $('#main').removeClass('install-wizard-content');
               if (App.get('testMode')) {
                 router.get('mainController').initialize();
               } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 099f3cf..d40ab8e 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -80,7 +80,6 @@ footer {
   color: #666;
   margin-top: -1 * @footer-height - 1;
   height: @footer-height - 60px;
-  margin-left: @side-navigation-width;
 }
 
 .editable-list-container {
@@ -2807,4 +2806,4 @@ a.abort-icon:hover {
 .container-wrap-table {
   padding: 0 10px;
   background-color: @diff-background-equal;
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/styles/common.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/common.less b/ambari-web/app/styles/common.less
index 7753a59..7202342 100644
--- a/ambari-web/app/styles/common.less
+++ b/ambari-web/app/styles/common.less
@@ -186,7 +186,7 @@
 }
 
 @footer-height: 100px;
-@side-navigation-width: 190px;
+@side-navigation-width: 230px;
 
 @default-font-size: 14px;
 @smaller-font-size: 12px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/styles/wizard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/wizard.less b/ambari-web/app/styles/wizard.less
index 5f60378..cb9eb92 100644
--- a/ambari-web/app/styles/wizard.less
+++ b/ambari-web/app/styles/wizard.less
@@ -659,6 +659,28 @@
   }
 }
 
+.install-wizard-content {
+  #top-nav .navbar.navbar-static-top {
+    margin-bottom: 0;
+  }
+  .navbar-static-top > .main-container,
+  >.main-container {
+    width: 100%;
+  }
+  >.main-container {
+    padding: 0;
+    .wizard {
+      border: none;
+      .wizard-nav {
+        width: 250px;
+      }
+      .wizard-content.col-md-9 {
+        width: calc(~"100% - 250px");
+      }
+    }
+  }
+}
+
 @media all and (max-width: 2560px) {
    .wizard-content {
     #serviceConfig {
@@ -675,4 +697,4 @@
       }
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/448d6a8b/ambari-web/app/templates/installer.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/installer.hbs b/ambari-web/app/templates/installer.hbs
index f63664a..73ecff4 100644
--- a/ambari-web/app/templates/installer.hbs
+++ b/ambari-web/app/templates/installer.hbs
@@ -23,7 +23,7 @@
 {{else}}
   <div class="wizard">
     <div class="wizard-body row">
-      <div class="wizard-nav col-md-3">
+      <div class="wizard-nav">
         <ul class="nav nav-pills nav-stacked" {{QAAttr "wizard-nav"}}>
           <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep0:active view.isStep0Disabled:disabled view.isStep0Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep0 target="controller"}}><i class="step-marker"><span class="step-index">0</span></i><p class="step-name">{{t installer.step0.header}}</p></a></li>
           <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep1:active view.isStep1Disabled:disabled view.isStep1Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}><i class="step-marker"><span class="step-index">1</span></i><p class="step-name">{{t installer.step1.header}}</p></a></li>


[02/13] ambari git commit: AMBARI-22238 : Maven cleanup of ambari utility, logsearch and ambari metrics modules. (Commit 2) (avijayan)

Posted by rl...@apache.org.
AMBARI-22238 : Maven cleanup of ambari utility, logsearch and ambari metrics modules. (Commit 2) (avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 75102dc4c8eb08772568cfd085682fe30f8289c6
Parents: 4a22350
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Mon Oct 16 15:58:47 2017 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Mon Oct 16 15:58:47 2017 -0700

----------------------------------------------------------------------
 ambari-infra/ambari-infra-assembly/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/75102dc4/ambari-infra/ambari-infra-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-assembly/pom.xml b/ambari-infra/ambari-infra-assembly/pom.xml
index 2b4959b..bf0e679 100644
--- a/ambari-infra/ambari-infra-assembly/pom.xml
+++ b/ambari-infra/ambari-infra-assembly/pom.xml
@@ -120,9 +120,9 @@
                       <sources>
                         <source>
                           <location>${solr.client.dir}/target/package</location>
-                          <exclude>
+                          <excludes>
                             <exclude>libs/checkstyle*.jar</exclude>
-                          </exclude>
+                          </excludes>
                         </source>
                       </sources>
                     </mapping>


[13/13] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-20859

Posted by rl...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-20859


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 06676d66ee97312bedfe7894a8a5dc8eafe3eef6
Parents: 553e4f9 ee509e0
Author: Robert Levas <rl...@hortonworks.com>
Authored: Wed Oct 18 10:18:07 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Wed Oct 18 10:18:07 2017 -0400

----------------------------------------------------------------------
 ambari-infra/ambari-infra-assembly/pom.xml      |  4 +-
 .../serveraction/upgrades/ConfigureAction.java  |  5 ++
 .../ambari/server/state/UpgradeContext.java     | 55 ++++++++++++++------
 .../ambari/server/state/stack/UpgradePack.java  | 30 ++++++++++-
 .../state/stack/upgrade/ClusterGrouping.java    | 13 +++++
 .../state/stack/upgrade/ConfigureTask.java      | 16 ++++++
 .../0.96.0.2.0/configuration/hbase-site.xml     | 17 +++---
 .../0.5.0.2.3/package/scripts/kms_server.py     | 21 ++++----
 .../1.0.0.3.0/package/scripts/kms_server.py     | 19 +++----
 .../2.1.0.2.0/package/scripts/params_linux.py   | 34 ++++++++++--
 .../2.1.0.2.0/package/scripts/status_params.py  | 52 +++++++-----------
 .../YARN/3.0.0.3.0/configuration/yarn-site.xml  |  2 +-
 .../3.0.0.3.0/package/scripts/params_linux.py   | 53 ++++++++++++++-----
 .../3.0.0.3.0/package/scripts/status_params.py  | 52 +++++++-----------
 .../stacks/HDP/2.0.6/role_command_order.json    |  2 +-
 .../stacks/HDP/2.5/services/stack_advisor.py    |  3 +-
 .../services/YARN/configuration/yarn-site.xml   |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  |  7 +++
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |  7 ++-
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |  1 +
 .../internal/UpgradeResourceProviderTest.java   | 13 +++++
 .../ambari/server/state/UpgradeContextTest.java | 38 +++++++++++++-
 .../state/stack/ConfigUpgradeValidityTest.java  | 10 ++++
 .../stacks/2.5/common/test_stack_advisor.py     |  5 +-
 ambari-web/app/messages.js                      |  1 +
 ambari-web/app/routes/installer.js              |  3 +-
 ambari-web/app/routes/main.js                   |  1 +
 ambari-web/app/styles/application.less          |  3 +-
 ambari-web/app/styles/common.less               |  2 +-
 ambari-web/app/styles/wizard.less               | 24 ++++++++-
 ambari-web/app/templates/installer.hbs          |  2 +-
 .../stack_upgrade/upgrade_version_box_view.js   |  4 +-
 docs/pom.xml                                    | 49 ++++++++++++++++-
 33 files changed, 403 insertions(+), 147 deletions(-)
----------------------------------------------------------------------



[09/13] ambari git commit: AMBARI-22254. RU: RU failed on 'Updating configuration sqoop-atlas-application.properties' (ncole)

Posted by rl...@apache.org.
AMBARI-22254. RU: RU failed on 'Updating configuration sqoop-atlas-application.properties' (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: c924ebdb6da802ab70f95c6f974087645a600b78
Parents: 53f028e
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Oct 17 13:38:10 2017 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Oct 17 14:18:24 2017 -0400

----------------------------------------------------------------------
 .../serveraction/upgrades/ConfigureAction.java  |  5 ++++
 .../ambari/server/state/stack/UpgradePack.java  | 30 +++++++++++++++++++-
 .../state/stack/upgrade/ClusterGrouping.java    | 13 +++++++++
 .../state/stack/upgrade/ConfigureTask.java      | 16 +++++++++++
 .../internal/UpgradeResourceProviderTest.java   | 13 +++++++++
 .../state/stack/ConfigUpgradeValidityTest.java  | 10 +++++++
 6 files changed, 86 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
index a7f910f..f15a507 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
@@ -183,6 +183,11 @@ public class ConfigureAction extends AbstractUpgradeServerAction {
     String configType = commandParameters.get(ConfigureTask.PARAMETER_CONFIG_TYPE);
     String serviceName = cluster.getServiceByConfigType(configType);
 
+    // !!! we couldn't get the service based on its config type, so try the associated
+    if (StringUtils.isBlank(serviceName)) {
+      serviceName = commandParameters.get(ConfigureTask.PARAMETER_ASSOCIATED_SERVICE);
+    }
+
     RepositoryVersionEntity sourceRepoVersion = upgradeContext.getSourceRepositoryVersion(serviceName);
     RepositoryVersionEntity targetRepoVersion = upgradeContext.getTargetRepositoryVersion(serviceName);
     StackId sourceStackId = sourceRepoVersion.getStackId();

http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
index 256b71d..7c32f37 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
@@ -37,11 +37,13 @@ import javax.xml.bind.annotation.XmlValue;
 
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping;
+import org.apache.ambari.server.state.stack.upgrade.ConfigureTask;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.Grouping;
 import org.apache.ambari.server.state.stack.upgrade.ServiceCheckGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -446,7 +448,7 @@ public class UpgradePack {
   private void initializeProcessingComponentMappings() {
     m_process = new LinkedHashMap<>();
 
-    if (null == processing || processing.isEmpty()) {
+    if (CollectionUtils.isEmpty(processing)) {
       return;
     }
 
@@ -574,6 +576,32 @@ public class UpgradePack {
 
         throw new RuntimeException(error);
       }
+
+      // !!! check for config tasks and mark the associated service
+      initializeTasks(service.name, preTasks);
+      initializeTasks(service.name, postTasks);
+      initializeTasks(service.name, tasks);
+      initializeTasks(service.name, preDowngradeTasks);
+      initializeTasks(service.name, postDowngradeTasks);
+    }
+
+    /**
+     * Checks for config tasks and marks the associated service.
+     * @param service
+     *          the service name
+     * @param tasks
+     *          the list of tasks to check
+     */
+    private void initializeTasks(String service, List<Task> tasks) {
+      if (CollectionUtils.isEmpty(tasks)) {
+        return;
+      }
+
+      for (Task task : tasks) {
+        if (Task.Type.CONFIGURE == task.getType()) {
+          ((ConfigureTask) task).associatedService = service;
+        }
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
index 65038e2..5bc3d8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -126,6 +127,18 @@ public class ClusterGrouping extends Grouping {
       return Objects.toStringHelper(this).add("id", id).add("title",
           title).omitNullValues().toString();
     }
+
+    /**
+     * If a task is found that is configure, set its associated service.  This is used
+     * if the configuration type cannot be isolated by service.
+     */
+    void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+      if (task.getType().equals(Task.Type.CONFIGURE) && StringUtils.isNotEmpty(service)) {
+        ((ConfigureTask) task).associatedService = service;
+      }
+    }
+
+
   }
 
   public class ClusterBuilder extends StageWrapperBuilder {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
index f88691d..75b5f59 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.ambari.server.serveraction.upgrades.ConfigureAction;
@@ -91,6 +92,11 @@ public class ConfigureTask extends ServerSideActionTask {
    */
   public static final String PARAMETER_INSERTIONS = "configure-task-insertions";
 
+  /**
+   * The associated service for the config task
+   */
+  public static final String PARAMETER_ASSOCIATED_SERVICE = "configure-task-associated-service";
+
   public static final String actionVerb = "Configuring";
 
   /**
@@ -114,6 +120,12 @@ public class ConfigureTask extends ServerSideActionTask {
   public boolean supportsPatch = false;
 
   /**
+   * The associated service is the service where this config task is specified
+   */
+  @XmlTransient
+  public String associatedService;
+
+  /**
    * {@inheritDoc}
    */
   @Override
@@ -236,6 +248,10 @@ public class ConfigureTask extends ServerSideActionTask {
       configParameters.put(ConfigureTask.PARAMETER_INSERTIONS, m_gson.toJson(insertions));
     }
 
+    if (StringUtils.isNotEmpty(associatedService)) {
+      configParameters.put(ConfigureTask.PARAMETER_ASSOCIATED_SERVICE, associatedService);
+    }
+
     return configParameters;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index 20adac2..d6b1ab3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -45,6 +45,7 @@ import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
 import org.apache.ambari.server.actionmanager.ActionManager;
 import org.apache.ambari.server.actionmanager.ExecutionCommandWrapper;
+import org.apache.ambari.server.actionmanager.ExecutionCommandWrapperFactory;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.actionmanager.Stage;
@@ -67,12 +68,14 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.dao.ExecutionCommandDAO;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
 import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.orm.dao.RequestDAO;
 import org.apache.ambari.server.orm.dao.StackDAO;
 import org.apache.ambari.server.orm.dao.StageDAO;
 import org.apache.ambari.server.orm.dao.UpgradeDAO;
+import org.apache.ambari.server.orm.entities.ExecutionCommandEntity;
 import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
 import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
 import org.apache.ambari.server.orm.entities.RequestEntity;
@@ -100,6 +103,7 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.UpgradeContext;
 import org.apache.ambari.server.state.UpgradeHelper;
 import org.apache.ambari.server.state.UpgradeState;
+import org.apache.ambari.server.state.stack.upgrade.ConfigureTask;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.ambari.server.topology.TopologyManager;
@@ -1832,6 +1836,15 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
       if (StringUtils.isNotBlank(command.getCustomCommandName()) &&
           command.getCustomCommandName().equals(ConfigureAction.class.getName())) {
         foundConfigTask = true;
+
+        ExecutionCommandDAO dao = injector.getInstance(ExecutionCommandDAO.class);
+        ExecutionCommandEntity entity = dao.findByPK(command.getTaskId());
+        ExecutionCommandWrapperFactory factory = injector.getInstance(ExecutionCommandWrapperFactory.class);
+        ExecutionCommandWrapper wrapper = factory.createFromJson(new String(entity.getCommand()));
+        Map<String, String> params = wrapper.getExecutionCommand().getCommandParams();
+        assertTrue(params.containsKey(ConfigureTask.PARAMETER_ASSOCIATED_SERVICE));
+        assertEquals("ZOOKEEPER", params.get(ConfigureTask.PARAMETER_ASSOCIATED_SERVICE));
+
         break;
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c924ebdb/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
index 2259e30..2930590 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
@@ -45,6 +45,7 @@ import org.apache.ambari.server.state.stack.upgrade.Task.Type;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.FileFilterUtils;
 import org.apache.commons.io.filefilter.IOFileFilter;
+import org.apache.commons.lang.StringUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -128,6 +129,12 @@ public class ConfigUpgradeValidityTest {
                   ConfigureTask configureTask = (ConfigureTask) executionStage.task;
                   assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack,
                       sourceStack);
+
+                  if (StringUtils.isNotBlank(executionStage.service)) {
+                    Assert.assertEquals(executionStage.service, configureTask.associatedService);
+                  } else {
+                    Assert.assertTrue(null == configureTask.associatedService);
+                  }
                 }
               }
             }
@@ -144,6 +151,7 @@ public class ConfigUpgradeValidityTest {
                   ConfigureTask configureTask = (ConfigureTask) preTask;
                   assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack,
                       sourceStack);
+                  Assert.assertTrue(StringUtils.isNotBlank(configureTask.associatedService));
                 }
               }
 
@@ -153,6 +161,7 @@ public class ConfigUpgradeValidityTest {
                     ConfigureTask configureTask = (ConfigureTask) task;
                     assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack,
                         sourceStack);
+                    Assert.assertTrue(StringUtils.isNotBlank(configureTask.associatedService));
                   }
                 }
               }
@@ -163,6 +172,7 @@ public class ConfigUpgradeValidityTest {
                     ConfigureTask configureTask = (ConfigureTask) postTask;
                     assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack,
                         sourceStack);
+                    Assert.assertTrue(StringUtils.isNotBlank(configureTask.associatedService));
                   }
                 }
               }


[05/13] ambari git commit: AMBARI-22234 Optimizing Ranger KMS imports (mugdha)

Posted by rl...@apache.org.
AMBARI-22234 Optimizing Ranger KMS imports (mugdha)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: d6cd303d0207ac6ffcdbc16d129758bba9494423
Parents: e19029c
Author: Mugdha Varadkar <mu...@apache.org>
Authored: Tue Oct 17 11:22:05 2017 +0530
Committer: Mugdha Varadkar <mu...@apache.org>
Committed: Tue Oct 17 11:24:13 2017 +0530

----------------------------------------------------------------------
 .../0.5.0.2.3/package/scripts/kms_server.py     | 21 ++++++++++----------
 .../1.0.0.3.0/package/scripts/kms_server.py     | 19 +++++++++---------
 2 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6cd303d/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
index fcf2478..0b37489 100755
--- a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
+++ b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms_server.py
@@ -27,9 +27,10 @@ from resource_management.libraries.functions.format import format
 from resource_management.core.logger import Logger
 from resource_management.core import shell
 from resource_management.libraries.functions.default import default
-from kms import kms, setup_kms_db, setup_java_patch, enable_kms_plugin, setup_kms_jce, update_password_configs
 from kms_service import kms_service
 
+import kms
+
 class KmsServer(Script):
 
   def install(self, env):
@@ -44,9 +45,9 @@ class KmsServer(Script):
       sudo = True
     )
 
-    setup_kms_db()
+    kms.setup_kms_db()
     self.configure(env)
-    setup_java_patch()
+    kms.setup_java_patch()
 
   def stop(self, env, upgrade_type=None):
     import params
@@ -63,9 +64,9 @@ class KmsServer(Script):
 
     env.set_params(params)
     self.configure(env)
-    enable_kms_plugin()
-    setup_kms_jce()
-    update_password_configs()
+    kms.enable_kms_plugin()
+    kms.setup_kms_jce()
+    kms.update_password_configs()
     kms_service(action = 'start', upgrade_type=upgrade_type)
 
   def status(self, env):
@@ -87,15 +88,15 @@ class KmsServer(Script):
     import params
 
     env.set_params(params)
-    kms()
+    kms.kms()
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params
     env.set_params(params)
 
     stack_select.select_packages(params.version)
-    kms(upgrade_type=upgrade_type)
-    setup_java_patch()
+    kms.kms(upgrade_type=upgrade_type)
+    kms.setup_java_patch()
 
   def setup_ranger_kms_database(self, env):
     import params
@@ -107,7 +108,7 @@ class KmsServer(Script):
 
     stack_version = upgrade_stack[1]
     Logger.info(format('Setting Ranger KMS database schema, using version {stack_version}'))
-    setup_kms_db(stack_version=stack_version)
+    kms.setup_kms_db(stack_version=stack_version)
     
   def get_log_folder(self):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6cd303d/ambari-server/src/main/resources/common-services/RANGER_KMS/1.0.0.3.0/package/scripts/kms_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER_KMS/1.0.0.3.0/package/scripts/kms_server.py b/ambari-server/src/main/resources/common-services/RANGER_KMS/1.0.0.3.0/package/scripts/kms_server.py
index 4c313c4..4708da1 100755
--- a/ambari-server/src/main/resources/common-services/RANGER_KMS/1.0.0.3.0/package/scripts/kms_server.py
+++ b/ambari-server/src/main/resources/common-services/RANGER_KMS/1.0.0.3.0/package/scripts/kms_server.py
@@ -27,10 +27,11 @@ from resource_management.libraries.functions.format import format
 from resource_management.core.logger import Logger
 from resource_management.core import shell
 from resource_management.libraries.functions.default import default
-from kms import kms, setup_kms_db, setup_java_patch, enable_kms_plugin, setup_kms_jce
 from kms_service import kms_service
 import upgrade
 
+import kms
+
 class KmsServer(Script):
 
   def install(self, env):
@@ -38,9 +39,9 @@ class KmsServer(Script):
     import params
     env.set_params(params)
 
-    setup_kms_db()
+    kms.setup_kms_db()
     self.configure(env)
-    setup_java_patch()
+    kms.setup_java_patch()
 
   def stop(self, env, upgrade_type=None):
     import params
@@ -57,8 +58,8 @@ class KmsServer(Script):
 
     env.set_params(params)
     self.configure(env)
-    enable_kms_plugin()
-    setup_kms_jce()
+    kms.enable_kms_plugin()
+    kms.setup_kms_jce()
     kms_service(action = 'start', upgrade_type=upgrade_type)
 
   def status(self, env):
@@ -80,15 +81,15 @@ class KmsServer(Script):
     import params
 
     env.set_params(params)
-    kms()
+    kms.kms()
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
     import params
     env.set_params(params)
 
     upgrade.prestart(env)
-    kms(upgrade_type=upgrade_type)
-    setup_java_patch()
+    kms.kms(upgrade_type=upgrade_type)
+    kms.setup_java_patch()
 
   def setup_ranger_kms_database(self, env):
     import params
@@ -100,7 +101,7 @@ class KmsServer(Script):
 
     stack_version = upgrade_stack[1]
     Logger.info(format('Setting Ranger KMS database schema, using version {stack_version}'))
-    setup_kms_db(stack_version=stack_version)
+    kms.setup_kms_db(stack_version=stack_version)
 
   def get_log_folder(self):
     import params


[10/13] ambari git commit: AMBARI-22258. Use correct property attribute setter fn(). while setting 'tez.runtime.io.sort.mb' maximum value.

Posted by rl...@apache.org.
AMBARI-22258. Use correct property attribute setter fn(). while setting 'tez.runtime.io.sort.mb' maximum value.


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b9f26708dd19c444918ea9b21150f66236fcdf2d
Parents: c924ebd
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Tue Oct 17 13:03:31 2017 -0700
Committer: Swapan Shridhar <ss...@hortonworks.com>
Committed: Tue Oct 17 13:04:52 2017 -0700

----------------------------------------------------------------------
 .../src/main/resources/stacks/HDP/2.5/services/stack_advisor.py | 3 ++-
 .../src/test/python/stacks/2.5/common/test_stack_advisor.py     | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b9f26708/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index 92ce9b9..b6f2478 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -860,6 +860,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     putHiveInteractiveEnvProperty = self.putProperty(configurations, "hive-interactive-env", services)
     putHiveInteractiveEnvPropertyAttribute = self.putPropertyAttribute(configurations, "hive-interactive-env")
     putTezInteractiveSiteProperty = self.putProperty(configurations, "tez-interactive-site", services)
+    putTezInteractiveSitePropertyAttribute = self.putPropertyAttribute(configurations, "tez-interactive-site")
     llap_daemon_selected_queue_name = None
     selected_queue_is_ambari_managed_llap = None  # Queue named 'llap' at root level is Ambari managed.
     llap_selected_queue_am_percent = None
@@ -1331,7 +1332,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     putTezInteractiveSiteProperty('tez.runtime.io.sort.mb', tez_runtime_io_sort_mb)
     if "tez-site" in services["configurations"] and "tez.runtime.sorter.class" in services["configurations"]["tez-site"]["properties"]:
       if services["configurations"]["tez-site"]["properties"]["tez.runtime.sorter.class"] == "LEGACY":
-        putTezInteractiveSiteProperty("tez.runtime.io.sort.mb", "maximum", 1800)
+        putTezInteractiveSitePropertyAttribute("tez.runtime.io.sort.mb", "maximum", 1800)
 
     putTezInteractiveSiteProperty('tez.runtime.unordered.output.buffer.size-mb', tez_runtime_unordered_output_buffer_size)
     putHiveInteractiveSiteProperty('hive.auto.convert.join.noconditionaltask.size', hive_auto_convert_join_noconditionaltask_size)

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9f26708/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index cf462de..407e78d 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -4446,7 +4446,8 @@ class TestHDP25StackAdvisor(TestCase):
           },
         "tez-site": {
           "properties": {
-            "tez.am.resource.memory.mb": "1024"
+            "tez.am.resource.memory.mb": "1024",
+            "tez.runtime.sorter.class": "LEGACY"
           }
         },
       }
@@ -4481,6 +4482,8 @@ class TestHDP25StackAdvisor(TestCase):
 
     self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '186368')
     self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '9830')
+    self.assertEqual(configurations['tez-interactive-site']['properties']['tez.runtime.io.sort.mb'], '1092')
+    self.assertEquals(configurations['tez-interactive-site']['property_attributes']['tez.runtime.io.sort.mb'], {'maximum': '1800'})