You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2017/05/19 20:47:41 UTC
[1/6] ambari git commit: AMBARI-21065. Update some YARN settings for
HDP 2.6 stack (Siddharth Seth via smohanty)
Repository: ambari
Updated Branches:
refs/heads/branch-feature-AMBARI-14714 ea3dc9a0d -> 14f60af1b
AMBARI-21065. Update some YARN settings for HDP 2.6 stack (Siddharth Seth via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f7a1d4e7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f7a1d4e7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f7a1d4e7
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: f7a1d4e7e7445eb49cfefabaf92ec518fc44d8ba
Parents: 71ed281
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu May 18 21:46:15 2017 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu May 18 22:32:31 2017 -0700
----------------------------------------------------------------------
.../HDP/2.6/services/YARN/configuration/yarn-site.xml | 10 ++++++++++
.../resources/stacks/HDP/2.6/upgrades/config-upgrade.xml | 5 +++++
.../stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 7 +++++++
.../resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml | 1 +
4 files changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7a1d4e7/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 6aa0bae..754a2c2 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
@@ -110,4 +110,14 @@
</description>
<on-ambari-upgrade add="false"/>
</property>
+ <property>
+ <name>yarn.nodemanager.kill-escape.launch-command-line</name>
+ <value>slider-agent,LLAP</value>
+ <on-ambari-upgrade add="false"/>
+ </property>
+ <property>
+ <name>yarn.nodemanager.kill-escape.user</name>
+ <value>hive</value>
+ <on-ambari-upgrade add="false"/>
+ </property>
</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7a1d4e7/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 628c119..a8ac1bc 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
@@ -123,6 +123,11 @@
<type>yarn-site</type>
<insert key="yarn.nodemanager.admin-env" value=",PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH" insert-type="append" newline-before="false" newline-after="false" />
</definition>
+ <definition xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_llap_mem">
+ <type>yarn-site</type>
+ <set key="yarn.nodemanager.kill-escape.launch-command-line" value="slider-agent,LLAP"/>
+ <set key="yarn.nodemanager.kill-escape.user" value="hive"/>
+ </definition>
</changes>
</component>
</service>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7a1d4e7/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 f844f98..ae7ffc5 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
@@ -334,6 +334,13 @@
</task>
</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">
+ <summary>Updating YARN NodeManager config for LLAP</summary>
+ </task>
+ </execute-stage>
+
<!-- KAFKA -->
<execute-stage service="KAFKA" component="KAFKA_BROKER" title="Apply config changes for Ranger Kafka plugin">
<task xsi:type="configure" id="hdp_2_6_maint_ranger_kafka_plugin_cluster_name"/>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7a1d4e7/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 ceb5b84..c2ae825 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
@@ -697,6 +697,7 @@
<component name="NODEMANAGER">
<pre-upgrade>
<task xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_admin_env"/>
+ <task xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_llap_mem"/>
</pre-upgrade>
<pre-downgrade/> <!-- no-op to prevent config changes on downgrade -->
<upgrade>
[4/6] ambari git commit: AMBARI-21074 - Storm XML File has Invalid
Characters Causing Exceptions on Server Startup (jonathanhurley)
Posted by jl...@apache.org.
AMBARI-21074 - Storm XML File has Invalid Characters Causing Exceptions on Server Startup (jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f952c9ee
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f952c9ee
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f952c9ee
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: f952c9eecdc8cba07117ecb39265f05e6ef47341
Parents: f2bbe47
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri May 19 10:19:49 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri May 19 10:19:49 2017 -0400
----------------------------------------------------------------------
.../common-services/STORM/0.9.1/configuration/storm-env.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f952c9ee/ambari-server/src/main/resources/common-services/STORM/0.9.1/configuration/storm-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/configuration/storm-env.xml b/ambari-server/src/main/resources/common-services/STORM/0.9.1/configuration/storm-env.xml
index cfa33e2..3d4edad 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/configuration/storm-env.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/configuration/storm-env.xml
@@ -128,11 +128,11 @@ export STORM_HOME={{storm_component_home_dir}}
#set storm-auto creds
# check if storm_jaas.conf in config , only enable storm_auto_creds in secure mode.
-STORM_HOME="$(dirname $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))"
+STORM_HOME="$(dirname $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))"
STORM_JAAS_CONF=$STORM_HOME/config/storm_jaas.conf
STORM_AUTOCREDS_LIB_DIR=/usr/hdp/current/storm-client/external/storm-autocreds
-if [ -f $STORM_JAAS_CONF ] && [ -d $STORM_AUTOCREDS_LIB_DIR ]; then
+if [ -f $STORM_JAAS_CONF ] && [ -d $STORM_AUTOCREDS_LIB_DIR ]; then
export STORM_EXT_CLASSPATH=$STORM_AUTOCREDS_LIB_DIR
fi
[6/6] ambari git commit: Merge remote-tracking branch 'origin/trunk'
into branch-feature-AMBARI-14714
Posted by jl...@apache.org.
Merge remote-tracking branch 'origin/trunk' into branch-feature-AMBARI-14714
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/14f60af1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/14f60af1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/14f60af1
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 14f60af1b6f1971f026bcfa209ac75859eb17457
Parents: ea3dc9a ae40bed
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Fri May 19 13:47:24 2017 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Fri May 19 13:47:24 2017 -0700
----------------------------------------------------------------------
.../server/actionmanager/ActionManager.java | 4 +-
.../server/actionmanager/ActionScheduler.java | 25 +++--
.../ambari/server/actionmanager/Request.java | 18 +++-
.../server/actionmanager/RequestFactory.java | 4 +-
.../ambari/server/actionmanager/Stage.java | 14 ---
.../server/actionmanager/StageFactory.java | 1 -
.../server/actionmanager/StageFactoryImpl.java | 4 +-
.../AmbariCustomCommandExecutionHelper.java | 12 ++-
.../AmbariManagementControllerImpl.java | 15 ++-
.../server/controller/KerberosHelperImpl.java | 51 +++++----
.../ClusterStackVersionResourceProvider.java | 3 +-
.../HostStackVersionResourceProvider.java | 4 +-
.../internal/RequestResourceProvider.java | 9 +-
.../internal/RequestStageContainer.java | 11 +-
.../internal/StageResourceProvider.java | 9 +-
.../internal/UpgradeResourceProvider.java | 13 +--
.../server/hooks/users/UserHookService.java | 3 +-
.../apache/ambari/server/orm/DBAccessor.java | 24 +++++
.../ambari/server/orm/DBAccessorImpl.java | 44 ++++++++
.../server/orm/entities/RequestEntity.java | 19 ++++
.../ambari/server/orm/entities/StageEntity.java | 18 ----
.../server/orm/entities/StageEntity_.java | 4 -
.../server/orm/helpers/dbms/DbmsHelper.java | 21 ++++
.../orm/helpers/dbms/GenericDbmsHelper.java | 8 ++
.../server/orm/helpers/dbms/MySqlHelper.java | 12 +++
.../server/orm/helpers/dbms/OracleHelper.java | 12 +++
.../server/orm/helpers/dbms/PostgresHelper.java | 12 +++
.../ambari/server/stageplanner/RoleGraph.java | 2 +-
.../server/upgrade/UpgradeCatalog251.java | 29 +++++
.../apache/ambari/server/utils/StageUtils.java | 8 +-
.../main/resources/Ambari-DDL-Derby-CREATE.sql | 2 +-
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 2 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 2 +-
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 2 +-
.../resources/Ambari-DDL-SQLServer-CREATE.sql | 2 +-
.../STORM/0.9.1/configuration/storm-env.xml | 4 +-
.../src/main/resources/properties.json | 1 +
.../services/YARN/configuration/yarn-site.xml | 10 ++
.../stacks/HDP/2.6/upgrades/config-upgrade.xml | 5 +
.../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 7 ++
.../stacks/HDP/2.6/upgrades/upgrade-2.6.xml | 1 +
.../ExecutionCommandWrapperTest.java | 4 +-
.../ambari/server/actionmanager/StageTest.java | 2 +-
.../actionmanager/TestActionDBAccessorImpl.java | 34 +++---
.../server/actionmanager/TestActionManager.java | 8 +-
.../actionmanager/TestActionScheduler.java | 43 +++++---
.../ambari/server/actionmanager/TestStage.java | 5 +-
.../server/agent/HeartbeatProcessorTest.java | 4 +-
.../server/agent/HeartbeatTestHelper.java | 4 +-
.../server/agent/TestHeartbeatHandler.java | 4 +-
.../AmbariManagementControllerTest.java | 18 ++--
.../server/controller/KerberosHelperTest.java | 105 +++++++++++++++++--
.../internal/CalculatedStatusTest.java | 2 +-
...ClusterStackVersionResourceProviderTest.java | 10 +-
.../internal/RequestStageContainerTest.java | 3 +-
.../server/hooks/users/UserHookServiceTest.java | 4 +-
.../serveraction/ServerActionExecutorTest.java | 9 +-
.../server/stageplanner/TestStagePlanner.java | 2 +-
.../ambari/server/utils/StageUtilsTest.java | 2 +-
ambari-web/app/messages.js | 6 +-
.../wizard/step3/step3_host_warnings_popup.hbs | 4 +-
62 files changed, 520 insertions(+), 206 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/14f60af1/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
[5/6] ambari git commit: AMBARI-20973. Review the use/need of host
clean up script. (Ishan Bhatt via Jaimin)
Posted by jl...@apache.org.
AMBARI-20973. Review the use/need of host clean up script. (Ishan Bhatt via Jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ae40bed9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ae40bed9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ae40bed9
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: ae40bed9fc99965babaf3457bbd04758bba99023
Parents: f952c9e
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri May 19 10:20:48 2017 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri May 19 10:20:48 2017 -0700
----------------------------------------------------------------------
ambari-web/app/messages.js | 6 +-----
.../app/templates/wizard/step3/step3_host_warnings_popup.hbs | 4 +---
2 files changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ae40bed9/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f34cbdc..0c15a19 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -755,11 +755,7 @@ Em.I18n.translations = {
'installer.step3.hostWarningsPopup.report.user': '<br><br>######################################<br># Users<br>#<br># A space delimited list of users who should not exist.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: userdel hdfs<br>######################################<br>USERS<br>',
'installer.step3.hostWarningsPopup.report.folder': '\\ /folder',
'installer.step3.hostWarningsPopup.checks': 'Host Checks found',
- 'installer.step3.hostWarningsPopup.notice.beginning': 'After manually resolving the issues, click <b>Rerun Checks</b>.' +
- '<br>To manually resolve issues on <b>each host</b> run the HostCleanup script (Python 2.6 or greater is required):<br>',
- 'installer.step3.hostWarningsPopup.notice.command': 'python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent --skip=users',
- 'installer.step3.hostWarningsPopup.notice.end': '<div class="alert alert-warning"><b>Note</b>: Clean up of Firewall and Transparent Huge Page issues are not supported by the HostCleanup script.</div>' +
- '<div class="alert alert-warning"><b>Note</b>: To clean up in interactive mode, remove <b>--silent</b> option. To clean up all resources, including <i>users</i>, remove <b>--skip=users</b> option. Use <b>--help</b> for a list of available options.</div>',
+ 'installer.step3.hostWarningsPopup.notice.beginning': 'After manually resolving the issues, click <b>Rerun Checks</b>.',
'installer.step3.hostWarningsPopup.summary':'{0} on {1}',
'installer.step3.hostWarningsPopup.jdk':'JDK Issues',
'installer.step3.hostWarningsPopup.jdk.name':'JDK not found at <i>{0}</i>',
http://git-wip-us.apache.org/repos/asf/ambari/blob/ae40bed9/ambari-web/app/templates/wizard/step3/step3_host_warnings_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step3/step3_host_warnings_popup.hbs b/ambari-web/app/templates/wizard/step3/step3_host_warnings_popup.hbs
index 07ff31b..e234254 100644
--- a/ambari-web/app/templates/wizard/step3/step3_host_warnings_popup.hbs
+++ b/ambari-web/app/templates/wizard/step3/step3_host_warnings_popup.hbs
@@ -20,9 +20,7 @@
<div id="host-warnings">
<div class="notice">
<span>{{t installer.step3.hostWarningsPopup.checks}} <b>{{view.warningsNotice}}</b>.<br>
- {{t installer.step3.hostWarningsPopup.notice.beginning}}
- <div class="code-snippet" {{QAAttr "host-cleanup-script"}}>{{t installer.step3.hostWarningsPopup.notice.command}}</div>
- {{t installer.step3.hostWarningsPopup.notice.end}}</span>
+ {{t installer.step3.hostWarningsPopup.notice.beginning}}</span>
</div>
<div class="row">
<form class="form-horizontal">
[3/6] ambari git commit: AMBARI-21057. Change Storage of Data on
Request/Stage/Task To Reduce Redundency (dgrinenko via dlysnichenko)
Posted by jl...@apache.org.
AMBARI-21057. Change Storage of Data on Request/Stage/Task To Reduce Redundency (dgrinenko via dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f2bbe478
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f2bbe478
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f2bbe478
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: f2bbe4781841b871993b3e8dd88e5f56169cf1b8
Parents: f7a1d4e
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri May 19 11:52:12 2017 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri May 19 11:52:12 2017 +0300
----------------------------------------------------------------------
.../server/actionmanager/ActionManager.java | 4 +-
.../server/actionmanager/ActionScheduler.java | 25 +++--
.../ambari/server/actionmanager/Request.java | 18 +++-
.../server/actionmanager/RequestFactory.java | 4 +-
.../ambari/server/actionmanager/Stage.java | 14 ---
.../server/actionmanager/StageFactory.java | 1 -
.../server/actionmanager/StageFactoryImpl.java | 4 +-
.../AmbariCustomCommandExecutionHelper.java | 12 ++-
.../AmbariManagementControllerImpl.java | 15 ++-
.../server/controller/KerberosHelperImpl.java | 51 +++++----
.../ClusterStackVersionResourceProvider.java | 3 +-
.../HostStackVersionResourceProvider.java | 4 +-
.../internal/RequestResourceProvider.java | 9 +-
.../internal/RequestStageContainer.java | 11 +-
.../internal/StageResourceProvider.java | 9 +-
.../internal/UpgradeResourceProvider.java | 13 +--
.../server/hooks/users/UserHookService.java | 3 +-
.../apache/ambari/server/orm/DBAccessor.java | 24 +++++
.../ambari/server/orm/DBAccessorImpl.java | 44 ++++++++
.../server/orm/entities/RequestEntity.java | 19 ++++
.../ambari/server/orm/entities/StageEntity.java | 18 ----
.../server/orm/entities/StageEntity_.java | 4 -
.../server/orm/helpers/dbms/DbmsHelper.java | 21 ++++
.../orm/helpers/dbms/GenericDbmsHelper.java | 8 ++
.../server/orm/helpers/dbms/MySqlHelper.java | 12 +++
.../server/orm/helpers/dbms/OracleHelper.java | 12 +++
.../server/orm/helpers/dbms/PostgresHelper.java | 12 +++
.../ambari/server/stageplanner/RoleGraph.java | 2 +-
.../server/upgrade/UpgradeCatalog251.java | 29 +++++
.../apache/ambari/server/utils/StageUtils.java | 8 +-
.../main/resources/Ambari-DDL-Derby-CREATE.sql | 2 +-
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 2 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 2 +-
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 2 +-
.../resources/Ambari-DDL-SQLServer-CREATE.sql | 2 +-
.../src/main/resources/properties.json | 1 +
.../ExecutionCommandWrapperTest.java | 4 +-
.../ambari/server/actionmanager/StageTest.java | 2 +-
.../actionmanager/TestActionDBAccessorImpl.java | 34 +++---
.../server/actionmanager/TestActionManager.java | 8 +-
.../actionmanager/TestActionScheduler.java | 43 +++++---
.../ambari/server/actionmanager/TestStage.java | 5 +-
.../server/agent/HeartbeatProcessorTest.java | 4 +-
.../server/agent/HeartbeatTestHelper.java | 4 +-
.../server/agent/TestHeartbeatHandler.java | 4 +-
.../AmbariManagementControllerTest.java | 18 ++--
.../server/controller/KerberosHelperTest.java | 105 +++++++++++++++++--
.../internal/CalculatedStatusTest.java | 2 +-
...ClusterStackVersionResourceProviderTest.java | 10 +-
.../internal/RequestStageContainerTest.java | 3 +-
.../server/hooks/users/UserHookServiceTest.java | 4 +-
.../serveraction/ServerActionExecutorTest.java | 9 +-
.../server/stageplanner/TestStagePlanner.java | 2 +-
.../ambari/server/utils/StageUtilsTest.java | 2 +-
55 files changed, 493 insertions(+), 196 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
index 398bc9d..13cdce1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
@@ -77,8 +77,8 @@ public class ActionManager {
scheduler.stop();
}
- public void sendActions(List<Stage> stages, ExecuteActionRequest actionRequest) throws AmbariException {
- Request request = requestFactory.createNewFromStages(stages, actionRequest);
+ public void sendActions(List<Stage> stages, String clusterHostInfo, ExecuteActionRequest actionRequest) throws AmbariException {
+ Request request = requestFactory.createNewFromStages(stages, clusterHostInfo, actionRequest);
sendActions(request, actionRequest);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index 316f2bd..d3157e2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -465,9 +465,10 @@ class ActionScheduler implements Runnable {
//Schedule what we have so far
+
for (ExecutionCommand cmd : commandsToSchedule) {
ConfigHelper.processHiddenAttribute(cmd.getConfigurations(), cmd.getConfigurationAttributes(), cmd.getRole(), false);
- processHostRole(stage, cmd, commandsToStart, commandsToUpdate);
+ processHostRole(request, stage, cmd, commandsToStart, commandsToUpdate);
}
LOG.debug("==> Commands to start: {}", commandsToStart.size());
@@ -1090,7 +1091,7 @@ class ActionScheduler implements Runnable {
return serviceEventMap;
}
- private void processHostRole(Stage s, ExecutionCommand cmd, List<ExecutionCommand> commandsToStart,
+ private void processHostRole(RequestEntity r, Stage s, ExecutionCommand cmd, List<ExecutionCommand> commandsToStart,
List<ExecutionCommand> commandsToUpdate)
throws AmbariException {
long now = System.currentTimeMillis();
@@ -1106,23 +1107,23 @@ class ActionScheduler implements Runnable {
}
s.setLastAttemptTime(hostname, roleStr, now);
s.incrementAttemptCount(hostname, roleStr);
- /** change the hostname in the command for the host itself **/
- cmd.setHostname(hostsMap.getHostMap(hostname));
- //Try to get clusterHostInfo from cache
+ String requestPK = r.getRequestId().toString();
String stagePk = s.getStageId() + "-" + s.getRequestId();
- Map<String, Set<String>> clusterHostInfo = clusterHostInfoCache.getIfPresent(stagePk);
+
+ // Try to get clusterHostInfo from cache
+ Map<String, Set<String>> clusterHostInfo = clusterHostInfoCache.getIfPresent(requestPK);
if (clusterHostInfo == null) {
Type type = new TypeToken<Map<String, Set<String>>>() {}.getType();
- clusterHostInfo = StageUtils.getGson().fromJson(s.getClusterHostInfo(), type);
- clusterHostInfoCache.put(stagePk, clusterHostInfo);
+ clusterHostInfo = StageUtils.getGson().fromJson(r.getClusterHostInfo(), type);
+ clusterHostInfoCache.put(requestPK, clusterHostInfo);
}
cmd.setClusterHostInfo(clusterHostInfo);
- //Try to get commandParams from cache and merge them with command-level parameters
+ // Try to get commandParams from cache and merge them with command-level parameters
Map<String, String> commandParams = commandParamsStageCache.getIfPresent(stagePk);
if (commandParams == null){
@@ -1143,10 +1144,10 @@ class ActionScheduler implements Runnable {
}
}
} catch (ClusterNotFoundException cnfe) {
- //NOP
+ // NOP
}
- //Try to get hostParams from cache and merge them with command-level parameters
+ // Try to get hostParams from cache and merge them with command-level parameters
Map<String, String> hostParams = hostParamsStageCache.getIfPresent(stagePk);
if (hostParams == null) {
Type type = new TypeToken<Map<String, String>>() {}.getType();
@@ -1157,6 +1158,8 @@ class ActionScheduler implements Runnable {
hostParamsCmd.putAll(hostParams);
cmd.setHostLevelParams(hostParamsCmd);
+ // change the hostname in the command for the host itself
+ cmd.setHostname(hostsMap.getHostMap(hostname));
commandsToUpdate.add(cmd);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
index 10e0d57..baf67fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
@@ -58,6 +58,7 @@ public class Request {
private long createTime;
private long startTime;
private long endTime;
+ private String clusterHostInfo;
/**
* If true, this request can not be executed in parallel with any another
@@ -94,6 +95,7 @@ public class Request {
this.startTime = -1;
this.endTime = -1;
this.exclusive = false;
+ this.clusterHostInfo = "{}";
if (-1L != this.clusterId) {
try {
@@ -110,7 +112,7 @@ public class Request {
* Construct new entity from stages provided
*/
//TODO remove when not needed
- public Request(@Assisted Collection<Stage> stages, Clusters clusters){
+ public Request(@Assisted Collection<Stage> stages, @Assisted String clusterHostInfo, Clusters clusters){
if (stages != null && !stages.isEmpty()) {
this.stages.addAll(stages);
Stage stage = stages.iterator().next();
@@ -129,6 +131,7 @@ public class Request {
this.createTime = System.currentTimeMillis();
this.startTime = -1;
this.endTime = -1;
+ this.clusterHostInfo = clusterHostInfo;
this.requestType = RequestType.INTERNAL_REQUEST;
this.exclusive = false;
} else {
@@ -143,9 +146,9 @@ public class Request {
* Construct new entity from stages provided
*/
//TODO remove when not needed
- public Request(@Assisted Collection<Stage> stages, @Assisted ExecuteActionRequest actionRequest,
+ public Request(@Assisted Collection<Stage> stages, @Assisted String clusterHostInfo, @Assisted ExecuteActionRequest actionRequest,
Clusters clusters, Gson gson) throws AmbariException {
- this(stages, clusters);
+ this(stages, clusterHostInfo, clusters);
if (actionRequest != null) {
this.resourceFilters = actionRequest.getResourceFilters();
this.operationLevel = actionRequest.getOperationLevel();
@@ -183,6 +186,7 @@ public class Request {
this.exclusive = entity.isExclusive();
this.requestContext = entity.getRequestContext();
this.inputs = entity.getInputs();
+ this.clusterHostInfo = entity.getClusterHostInfo();
this.requestType = entity.getRequestType();
this.commandName = entity.getCommandName();
@@ -245,6 +249,7 @@ public class Request {
requestEntity.setRequestScheduleId(requestScheduleId);
requestEntity.setStatus(status);
requestEntity.setDisplayStatus(displayStatus);
+ requestEntity.setClusterHostInfo(clusterHostInfo);
//TODO set all fields
if (resourceFilters != null) {
@@ -281,6 +286,13 @@ public class Request {
return requestEntity;
}
+ public String getClusterHostInfo() {
+ return clusterHostInfo;
+ }
+
+ public void setClusterHostInfo(String clusterHostInfo) {
+ this.clusterHostInfo = clusterHostInfo;
+ }
public Long getClusterId() {
return Long.valueOf(clusterId);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/RequestFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/RequestFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/RequestFactory.java
index bc0223c..8a22796 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/RequestFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/RequestFactory.java
@@ -30,9 +30,9 @@ public interface RequestFactory {
Request createNew(long requestId, @Assisted("clusterId") Long clusterName) throws AmbariException;
- Request createNewFromStages(Collection<Stage> stages);
+ Request createNewFromStages(Collection<Stage> stages, String clusterHostInfo);
- Request createNewFromStages(Collection<Stage> stages, ExecuteActionRequest actionRequest);
+ Request createNewFromStages(Collection<Stage> stages, String clusterHostInfo, ExecuteActionRequest actionRequest);
Request createExisting(RequestEntity entity);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
index 574afa1..5295536 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
@@ -76,7 +76,6 @@ public class Stage {
private final String requestContext;
private HostRoleStatus status = HostRoleStatus.PENDING;
private HostRoleStatus displayStatus = HostRoleStatus.PENDING;
- private String clusterHostInfo;
private String commandParamsStage;
private String hostParamsStage;
@@ -110,7 +109,6 @@ public class Stage {
@Assisted("clusterName") @Nullable String clusterName,
@Assisted("clusterId") long clusterId,
@Assisted("requestContext") @Nullable String requestContext,
- @Assisted("clusterHostInfo") String clusterHostInfo,
@Assisted("commandParamsStage") String commandParamsStage,
@Assisted("hostParamsStage") String hostParamsStage,
HostRoleCommandFactory hostRoleCommandFactory, ExecutionCommandWrapperFactory ecwFactory) {
@@ -120,7 +118,6 @@ public class Stage {
this.clusterName = clusterName;
this.clusterId = clusterId;
this.requestContext = requestContext == null ? "" : requestContext;
- this.clusterHostInfo = clusterHostInfo;
this.commandParamsStage = commandParamsStage;
this.hostParamsStage = hostParamsStage;
@@ -155,7 +152,6 @@ public class Stage {
}
requestContext = stageEntity.getRequestContext();
- clusterHostInfo = stageEntity.getClusterHostInfo();
commandParamsStage = stageEntity.getCommandParamsStage();
hostParamsStage = stageEntity.getHostParamsStage();
commandExecutionType = stageEntity.getCommandExecutionType();
@@ -197,7 +193,6 @@ public class Stage {
stageEntity.setRequestContext(requestContext);
stageEntity.setHostRoleCommands(new ArrayList<HostRoleCommandEntity>());
stageEntity.setRoleSuccessCriterias(new ArrayList<RoleSuccessCriteriaEntity>());
- stageEntity.setClusterHostInfo(clusterHostInfo);
stageEntity.setCommandParamsStage(commandParamsStage);
stageEntity.setHostParamsStage(hostParamsStage);
stageEntity.setCommandExecutionType(commandExecutionType);
@@ -264,14 +259,6 @@ public class Stage {
return commandsToScheduleSet;
}
- public String getClusterHostInfo() {
- return clusterHostInfo;
- }
-
- public void setClusterHostInfo(String clusterHostInfo) {
- this.clusterHostInfo = clusterHostInfo;
- }
-
public String getCommandParamsStage() {
return commandParamsStage;
}
@@ -935,7 +922,6 @@ public class Stage {
builder.append("clusterName=").append(clusterName).append("\n");
builder.append("logDir=").append(logDir).append("\n");
builder.append("requestContext=").append(requestContext).append("\n");
- builder.append("clusterHostInfo=").append(clusterHostInfo).append("\n");
builder.append("commandParamsStage=").append(commandParamsStage).append("\n");
builder.append("hostParamsStage=").append(hostParamsStage).append("\n");
builder.append("status=").append(status).append("\n");
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java
index a88558c..0d1a326 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java
@@ -29,7 +29,6 @@ public interface StageFactory {
@Assisted("clusterName") String clusterName,
@Assisted("clusterId") long clusterId,
@Assisted("requestContext") String requestContext,
- @Assisted("clusterHostInfo") String clusterHostInfo,
@Assisted("commandParamsStage") String commandParamsStage,
@Assisted("hostParamsStage") String hostParamsStage);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactoryImpl.java
index 3cad82d..0827639 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactoryImpl.java
@@ -43,7 +43,6 @@ public class StageFactoryImpl implements StageFactory {
* @param clusterName Cluster name
* @param clusterId Cluster ID
* @param requestContext Information about the context of the request
- * @param clusterHostInfo Information about the host
* @param commandParamsStage Information about the command parameters
* @param hostParamsStage Information about the host parameters for the stage
* @return An instance of a Stage with the provided params.
@@ -54,10 +53,9 @@ public class StageFactoryImpl implements StageFactory {
@Assisted("clusterName") String clusterName,
@Assisted("clusterId") long clusterId,
@Assisted("requestContext") String requestContext,
- @Assisted("clusterHostInfo") String clusterHostInfo,
@Assisted("commandParamsStage") String commandParamsStage,
@Assisted("hostParamsStage") String hostParamsStage) {
- return new Stage(requestId, logDir, clusterName, clusterId, requestContext, clusterHostInfo, commandParamsStage, hostParamsStage,
+ return new Stage(requestId, logDir, clusterName, clusterId, requestContext, commandParamsStage, hostParamsStage,
injector.getInstance(HostRoleCommandFactory.class),
injector.getInstance(ExecutionCommandWrapperFactory.class));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index ab8b659..520dcab 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -75,10 +75,12 @@ import org.apache.ambari.server.controller.spi.Resource;
import org.apache.ambari.server.metadata.ActionMetadata;
import org.apache.ambari.server.orm.dao.ClusterVersionDAO;
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
+import org.apache.ambari.server.orm.dao.RequestDAO;
import org.apache.ambari.server.orm.entities.ClusterVersionEntity;
import org.apache.ambari.server.orm.entities.OperatingSystemEntity;
import org.apache.ambari.server.orm.entities.RepositoryEntity;
import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
+import org.apache.ambari.server.orm.entities.RequestEntity;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.CommandScriptDefinition;
@@ -176,6 +178,9 @@ public class AmbariCustomCommandExecutionHelper {
private ClusterVersionDAO clusterVersionDAO;
@Inject
+ private RequestDAO requestDAO;
+
+ @Inject
private HostRoleCommandDAO hostRoleCommandDAO;
private Map<String, Map<String, Map<String, String>>> configCredentialsForService = new HashMap<>();
@@ -1014,7 +1019,12 @@ public class AmbariCustomCommandExecutionHelper {
StageUtils.getClusterHostInfo(cluster));
// Reset cluster host info as it has changed
- stage.setClusterHostInfo(clusterHostInfoJson);
+ RequestEntity requestEntity = requestDAO.findByPK(stage.getRequestId());
+
+ if (requestEntity != null) {
+ requestEntity.setClusterHostInfo(clusterHostInfoJson);
+ requestDAO.merge(requestEntity);
+ }
Map<String, String> commandParams = new HashMap<>();
if (serviceName.equals(Service.Type.HBASE.name())) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index f9375aa..25b12de 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1042,14 +1042,14 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
}
private Stage createNewStage(long id, Cluster cluster, long requestId,
- String requestContext, String clusterHostInfo,
+ String requestContext,
String commandParamsStage, String hostParamsStage) {
String logDir = BASE_LOG_DIR + File.pathSeparator + requestId;
Stage stage =
stageFactory.createNew(requestId, logDir,
null == cluster ? null : cluster.getClusterName(),
null == cluster ? -1L : cluster.getClusterId(),
- requestContext, clusterHostInfo, commandParamsStage,
+ requestContext, commandParamsStage,
hostParamsStage);
stage.setStageId(id);
return stage;
@@ -2631,8 +2631,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
customCommandExecutionHelper.createDefaultHostParams(cluster));
Stage stage = createNewStage(requestStages.getLastStageId(), cluster,
- requestStages.getId(), requestProperties.get(REQUEST_CONTEXT_PROPERTY),
- clusterHostInfoJson, "{}", hostParamsJson);
+ requestStages.getId(), requestProperties.get(REQUEST_CONTEXT_PROPERTY),"{}", hostParamsJson);
boolean skipFailure = false;
if (requestProperties.containsKey(Setting.SETTING_NAME_SKIP_FAILURE) && requestProperties.get(Setting.SETTING_NAME_SKIP_FAILURE).equalsIgnoreCase("true")) {
skipFailure = true;
@@ -2982,6 +2981,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
rg.setCommandExecutionType(CommandExecutionType.DEPENDENCY_ORDERED);
}
rg.build(stage);
+ requestStages.setClusterHostInfo(clusterHostInfoJson);
requestStages.addStages(rg.getStages());
if (!componentsToEnableKerberos.isEmpty()) {
@@ -3067,9 +3067,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
Map<String, Set<String>> clusterHostInfo = StageUtils.getClusterHostInfo(cluster);
String clusterHostInfoJson = StageUtils.getGson().toJson(clusterHostInfo);
Map<String, String> hostParamsCmd = customCommandExecutionHelper.createDefaultHostParams(cluster);
- Stage stage = createNewStage(0, cluster,
- 1, "",
- clusterHostInfoJson, "{}", "");
+ Stage stage = createNewStage(0, cluster,1, "","{}", "");
Map<String, Map<String, String>> configTags = configHelper.getEffectiveDesiredTags(cluster, scHost.getHostName());
@@ -4037,7 +4035,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
commandParamsForStage = gson.toJson(commandParamsStage);
Stage stage = createNewStage(requestStageContainer.getLastStageId(), cluster, requestId, requestContext,
- jsons.getClusterHostInfo(), commandParamsForStage, jsons.getHostParamsForStage());
+ commandParamsForStage, jsons.getHostParamsForStage());
if (actionRequest.isCommand()) {
customCommandExecutionHelper.addExecutionCommandsToStage(actionExecContext, stage,
@@ -4058,6 +4056,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
List<Stage> stages = rg.getStages();
if (stages != null && !stages.isEmpty()) {
+ requestStageContainer.setClusterHostInfo(jsons.getClusterHostInfo());
requestStageContainer.addStages(stages);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index 6687942..5c4728a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -2186,14 +2186,13 @@ public class KerberosHelperImpl implements KerberosHelper {
* @return a newly created Stage
*/
private Stage createNewStage(long id, Cluster cluster, long requestId,
- String requestContext, String clusterHostInfo,
- String commandParams, String hostParams) {
+ String requestContext, String commandParams, String hostParams) {
+
Stage stage = stageFactory.createNew(requestId,
BASE_LOG_DIR + File.pathSeparator + requestId,
cluster.getClusterName(),
cluster.getClusterId(),
requestContext,
- clusterHostInfo,
commandParams,
hostParams);
@@ -2221,14 +2220,14 @@ public class KerberosHelperImpl implements KerberosHelper {
* @param timeout the timeout for the task/action @return a newly created Stage
*/
private Stage createServerActionStage(long id, Cluster cluster, long requestId,
- String requestContext, String clusterHostInfo,
+ String requestContext,
String commandParams, String hostParams,
Class<? extends ServerAction> actionClass,
ServiceComponentHostServerActionEvent event,
Map<String, String> commandParameters, String commandDetail,
Integer timeout) throws AmbariException {
- Stage stage = createNewStage(id, cluster, requestId, requestContext, clusterHostInfo, commandParams, hostParams);
+ Stage stage = createNewStage(id, cluster, requestId, requestContext, commandParams, hostParams);
stage.addServerActionCommand(actionClass.getName(), null, Role.AMBARI_SERVER_ACTION,
RoleCommand.EXECUTE, cluster.getClusterName(), event, commandParameters, commandDetail,
ambariManagementController.findConfigurationTagsWithOverrides(cluster, null), timeout,
@@ -2769,7 +2768,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Preparing Operations",
- clusterHostInfoJson,
"{}",
hostParamsJson,
PrepareEnableKerberosServerAction.class,
@@ -2780,6 +2778,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2792,7 +2792,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Preparing Operations",
- clusterHostInfoJson,
"{}",
hostParamsJson,
PrepareKerberosIdentitiesServerAction.class,
@@ -2803,6 +2802,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2815,7 +2816,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Preparing Operations",
- clusterHostInfoJson,
"{}",
hostParamsJson,
PrepareDisableKerberosServerAction.class,
@@ -2826,6 +2826,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2838,7 +2840,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Create Principals",
- clusterHostInfoJson,
"{}",
hostParamsJson,
CreatePrincipalsServerAction.class,
@@ -2849,6 +2850,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2861,7 +2864,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Destroy Principals",
- clusterHostInfoJson,
"{}",
hostParamsJson,
DestroyPrincipalsServerAction.class,
@@ -2872,6 +2874,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2884,7 +2888,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Configure Ambari Identity",
- clusterHostInfoJson,
"{}",
hostParamsJson,
ConfigureAmbariIdentitiesServerAction.class,
@@ -2895,6 +2898,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2907,7 +2912,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Create Keytabs",
- clusterHostInfoJson,
"{}",
hostParamsJson,
CreateKeytabFilesServerAction.class,
@@ -2918,6 +2922,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2933,7 +2939,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Distribute Keytabs",
- clusterHostInfoJson,
StageUtils.getGson().toJson(commandParameters),
hostParamsJson);
@@ -2958,6 +2963,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -2999,12 +3006,13 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Disable security",
- clusterHostInfoJson,
StageUtils.getGson().toJson(commandParameters),
hostParamsJson);
addDisableSecurityCommandToAllServices(cluster, stage);
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -3042,7 +3050,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Stopping ZooKeeper",
- clusterHostInfoJson,
StageUtils.getGson().toJson(commandParameters),
hostParamsJson);
for (ServiceComponent component : zookeeper.getServiceComponents().values()) {
@@ -3056,6 +3063,8 @@ public class KerberosHelperImpl implements KerberosHelper {
}
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -3071,7 +3080,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Delete Keytabs",
- clusterHostInfoJson,
StageUtils.getGson().toJson(commandParameters),
hostParamsJson);
@@ -3099,6 +3107,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -3111,7 +3121,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Update Configurations",
- clusterHostInfoJson,
"{}",
hostParamsJson,
UpdateKerberosConfigsServerAction.class,
@@ -3122,6 +3131,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -3145,7 +3156,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Finalize Operations",
- clusterHostInfoJson,
"{}",
hostParamsJson,
FinalizeKerberosServerAction.class,
@@ -3155,6 +3165,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
@@ -3167,7 +3179,6 @@ public class KerberosHelperImpl implements KerberosHelper {
cluster,
requestStageContainer.getId(),
"Kerberization Clean Up",
- clusterHostInfoJson,
"{}",
hostParamsJson,
CleanupServerAction.class,
@@ -3178,6 +3189,8 @@ public class KerberosHelperImpl implements KerberosHelper {
RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
roleGraph.build(stage);
+
+ requestStageContainer.setClusterHostInfo(clusterHostInfoJson);
requestStageContainer.addStages(roleGraph.getStages());
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index a8bb696..f8016a5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -542,7 +542,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
}
Stage stage = stageFactory.createNew(req.getId(), "/tmp/ambari", cluster.getClusterName(),
- cluster.getClusterId(), stageName, clusterHostInfoJson, "{}", hostParamsJson);
+ cluster.getClusterId(), stageName, "{}", hostParamsJson);
// if you have 1000 hosts (10 stages with 100 installs), we want to ensure
// that a single failure doesn't cause all other stages to abort; set the
@@ -590,6 +590,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
repoVersionEnt.getDisplayName()));
}
+ req.setClusterHostInfo(clusterHostInfoJson);
req.addStages(stages);
req.persist();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index 811ce9b..92edeb8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -513,7 +513,6 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
cluster.getClusterName(),
cluster.getClusterId(),
caption,
- clusterHostInfoJson,
"{}",
StageUtils.getGson().toJson(hostLevelParams));
@@ -522,6 +521,7 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
stageId = 1L;
}
stage.setStageId(stageId);
+ req.setClusterHostInfo(clusterHostInfoJson);
req.addStages(Collections.singletonList(stage));
try {
@@ -561,7 +561,6 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
cluster.getClusterName(),
cluster.getClusterId(),
caption,
- clusterHostInfoJson,
StageUtils.getGson().toJson(commandParams),
StageUtils.getGson().toJson(hostLevelParams));
@@ -570,6 +569,7 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
stageId = 1L;
}
stage.setStageId(stageId);
+ req.setClusterHostInfo(clusterHostInfoJson);
req.addStages(Collections.singletonList(stage));
actionContext = new ActionExecutionContext(
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
index c405995..d82ff25 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
@@ -103,6 +103,7 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
public static final String REQUEST_SOURCE_SCHEDULE_HREF = "Requests/request_schedule/href";
protected static final String REQUEST_TYPE_ID = "Requests/type";
protected static final String REQUEST_INPUTS_ID = "Requests/inputs";
+ protected static final String REQUEST_CLUSTER_HOST_INFO_ID = "Requests/cluster_host_info";
protected static final String REQUEST_RESOURCE_FILTER_ID = "Requests/resource_filters";
protected static final String REQUEST_OPERATION_LEVEL_ID = "Requests/operation_level";
protected static final String REQUEST_CREATE_TIME_ID = "Requests/create_time";
@@ -158,7 +159,9 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
REQUEST_QUEUED_TASK_CNT_ID,
REQUEST_PROGRESS_PERCENT_ID,
REQUEST_REMOVE_PENDING_HOST_REQUESTS_ID,
- REQUEST_PENDING_HOST_REQUEST_COUNT_ID);
+ REQUEST_PENDING_HOST_REQUEST_COUNT_ID,
+ REQUEST_CLUSTER_HOST_INFO_ID
+ );
// ----- Constructors ----------------------------------------------------
@@ -752,6 +755,10 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
resource.setProperty(REQUEST_INPUTS_ID, value);
}
+ if (isPropertyRequested(REQUEST_CLUSTER_HOST_INFO_ID, requestedPropertyIds)) {
+ resource.setProperty(REQUEST_CLUSTER_HOST_INFO_ID, entity.getClusterHostInfo());
+ }
+
setResourceProperty(resource, REQUEST_RESOURCE_FILTER_ID,
org.apache.ambari.server.actionmanager.Request.filtersFromEntity(entity),
requestedPropertyIds);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
index c37be91..3f67704 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
@@ -65,6 +65,8 @@ public class RequestStageContainer {
private ExecuteActionRequest actionRequest = null;
+ private String clusterHostInfo = null;
+
/**
* Logger
*/
@@ -99,6 +101,7 @@ public class RequestStageContainer {
this.requestFactory = factory;
this.actionManager = manager;
this.actionRequest = actionRequest;
+ this.clusterHostInfo = "{}";
}
/**
@@ -110,6 +113,10 @@ public class RequestStageContainer {
return id;
}
+ public void setClusterHostInfo(String clusterHostInfo){
+ this.clusterHostInfo = clusterHostInfo;
+ }
+
/**
* Add stages to request.
*
@@ -202,8 +209,8 @@ public class RequestStageContainer {
public void persist() throws AmbariException {
if (!stages.isEmpty()) {
Request request = (null == actionRequest)
- ? requestFactory.createNewFromStages(stages)
- : requestFactory.createNewFromStages(stages, actionRequest);
+ ? requestFactory.createNewFromStages(stages, clusterHostInfo)
+ : requestFactory.createNewFromStages(stages, clusterHostInfo, actionRequest);
if (null != requestContext) {
request.setRequestContext(requestContext);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
index ec3688d..06aa68b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
@@ -47,6 +47,7 @@ import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
import org.apache.ambari.server.controller.utilities.PredicateHelper;
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
+import org.apache.ambari.server.orm.dao.RequestDAO;
import org.apache.ambari.server.orm.dao.StageDAO;
import org.apache.ambari.server.orm.entities.StageEntity;
import org.apache.ambari.server.state.Cluster;
@@ -91,7 +92,6 @@ public class StageResourceProvider extends AbstractControllerResourceProvider im
public static final String STAGE_REQUEST_ID = "Stage/request_id";
public static final String STAGE_LOG_INFO = "Stage/log_info";
public static final String STAGE_CONTEXT = "Stage/context";
- public static final String STAGE_CLUSTER_HOST_INFO = "Stage/cluster_host_info";
public static final String STAGE_COMMAND_PARAMS = "Stage/command_params";
public static final String STAGE_HOST_PARAMS = "Stage/host_params";
public static final String STAGE_SKIPPABLE = "Stage/skippable";
@@ -119,7 +119,6 @@ public class StageResourceProvider extends AbstractControllerResourceProvider im
PROPERTY_IDS.add(STAGE_REQUEST_ID);
PROPERTY_IDS.add(STAGE_LOG_INFO);
PROPERTY_IDS.add(STAGE_CONTEXT);
- PROPERTY_IDS.add(STAGE_CLUSTER_HOST_INFO);
PROPERTY_IDS.add(STAGE_COMMAND_PARAMS);
PROPERTY_IDS.add(STAGE_HOST_PARAMS);
PROPERTY_IDS.add(STAGE_SKIPPABLE);
@@ -307,12 +306,6 @@ public class StageResourceProvider extends AbstractControllerResourceProvider im
setResourceProperty(resource, STAGE_REQUEST_ID, entity.getRequestId(), requestedIds);
setResourceProperty(resource, STAGE_CONTEXT, entity.getRequestContext(), requestedIds);
- // this property is lazy loaded in JPA; don't use it unless requested
- if (isPropertyRequested(STAGE_CLUSTER_HOST_INFO, requestedIds)) {
- resource.setProperty(STAGE_CLUSTER_HOST_INFO, entity.getClusterHostInfo());
- }
-
- // this property is lazy loaded in JPA; don't use it unless requested
if (isPropertyRequested(STAGE_COMMAND_PARAMS, requestedIds)) {
String value = entity.getCommandParamsStage();
if (!StringUtils.isBlank(value)) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 623851a..0ebf3aa 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
@@ -1371,8 +1371,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
cluster, context.getEffectiveStackId());
Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
- cluster.getClusterName(), cluster.getClusterId(), entity.getText(),
- jsons.getClusterHostInfo(), jsons.getCommandParamsForStage(),
+ cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
jsons.getHostParamsForStage());
stage.setSkippable(skippable);
@@ -1454,8 +1453,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
cluster, context.getEffectiveStackId());
Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
- cluster.getClusterName(), cluster.getClusterId(), entity.getText(),
- jsons.getClusterHostInfo(), jsons.getCommandParamsForStage(),
+ cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
jsons.getHostParamsForStage());
stage.setSkippable(skippable);
@@ -1516,8 +1514,7 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
cluster, context.getEffectiveStackId());
Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
- cluster.getClusterName(), cluster.getClusterId(), entity.getText(),
- jsons.getClusterHostInfo(), jsons.getCommandParamsForStage(),
+ cluster.getClusterName(), cluster.getClusterId(), entity.getText(), jsons.getCommandParamsForStage(),
jsons.getHostParamsForStage());
stage.setSkippable(skippable);
@@ -1648,8 +1645,8 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
cluster, context.getEffectiveStackId());
Stage stage = s_stageFactory.get().createNew(request.getId().longValue(), "/tmp/ambari",
- cluster.getClusterName(), cluster.getClusterId(), stageText, jsons.getClusterHostInfo(),
- jsons.getCommandParamsForStage(), jsons.getHostParamsForStage());
+ cluster.getClusterName(), cluster.getClusterId(), stageText, jsons.getCommandParamsForStage(),
+ jsons.getHostParamsForStage());
stage.setSkippable(skippable);
stage.setAutoSkipFailureSupported(supportsAutoSkipOnFailure);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java b/ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java
index 69463ab..149e2f0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java
@@ -139,7 +139,7 @@ public class UserHookService implements HookService {
String stageContextText = String.format(POST_USER_CREATION_REQUEST_CONTEXT, ctx.getUserGroups().size());
Stage stage = stageFactory.createNew(requestStageContainer.getId(), configuration.getServerTempDir() + File.pathSeparatorChar + requestStageContainer.getId(), clsData.getClusterName(),
- clsData.getClusterId(), stageContextText, "{}", "{}", "{}");
+ clsData.getClusterId(), stageContextText, "{}", "{}");
stage.setStageId(requestStageContainer.getLastStageId());
ServiceComponentHostServerActionEvent serverActionEvent = new ServiceComponentHostServerActionEvent("ambari-server-host", System.currentTimeMillis());
@@ -148,6 +148,7 @@ public class UserHookService implements HookService {
stage.addServerActionCommand(PostUserCreationHookServerAction.class.getName(), "ambari", Role.AMBARI_SERVER_ACTION,
RoleCommand.EXECUTE, clsData.getClusterName(), serverActionEvent, commandParams, stageContextText, null, null, false, false);
+ requestStageContainer.setClusterHostInfo("{}");
requestStageContainer.addStages(Collections.singletonList(stage));
requestStageContainer.persist();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java
index bf8ff48..4f29d61 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java
@@ -622,6 +622,30 @@ public interface DBAccessor {
*/
void addDefaultConstraint(String tableName, DBColumnInfo column) throws SQLException;
+ /**
+ * Move column data from {@code sourceTableName} to {@code targetTableName} using {@code sourceIDFieldName} and
+ * {@code targetIDFieldName} keys to match right rows
+ *
+ * @param sourceTableName
+ * the source table name
+ * @param sourceColumn
+ * the source column name
+ * @param sourceIDFieldName
+ * the source id key filed name matched with {@code targetIDFieldName}
+ * @param targetTableName
+ * the target table name
+ * @param targetColumn
+ * the target column name
+ * @param targetIDFieldName
+ * the target id key name matched with {@code sourceIDFieldName}
+ * @param isColumnNullable
+ * should be target column nullable or not
+ *
+ * @throws SQLException
+ */
+ void moveColumnToAnotherTable(String sourceTableName, DBColumnInfo sourceColumn, String sourceIDFieldName,
+ String targetTableName, DBColumnInfo targetColumn, String targetIDFieldName, boolean isColumnNullable) throws SQLException;
+
enum DbType {
ORACLE,
MYSQL,
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index c11589d..9c6425c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -1304,4 +1304,48 @@ public class DBAccessorImpl implements DBAccessor {
return valueString;
}
+
+ /**
+ * Move column data from {@code sourceTableName} to {@code targetTableName} using {@code sourceIDFieldName} and
+ * {@code targetIDFieldName} keys to match right rows
+ *
+ * @param sourceTableName
+ * the source table name
+ * @param sourceColumn
+ * the source column name
+ * @param sourceIDFieldName
+ * the source id key filed name matched with {@code targetIDFieldName}
+ * @param targetTableName
+ * the target table name
+ * @param targetColumn
+ * the target column name
+ * @param targetIDFieldName
+ * the target id key name matched with {@code sourceIDFieldName}
+ * @param isColumnNullable
+ * should be target column nullable or not
+ *
+ * @throws SQLException
+ */
+ @Override
+ public void moveColumnToAnotherTable(String sourceTableName, DBColumnInfo sourceColumn, String sourceIDFieldName,
+ String targetTableName, DBColumnInfo targetColumn, String targetIDFieldName, boolean isColumnNullable) throws SQLException {
+
+ if (this.tableHasColumn(sourceTableName, sourceIDFieldName)) {
+
+ final String moveSQL = dbmsHelper.getCopyColumnToAnotherTableStatement(sourceTableName, sourceColumn.getName(),
+ sourceIDFieldName, targetTableName, targetColumn.getName(),targetIDFieldName);
+
+ targetColumn.setNullable(true); // setting column nullable by default
+
+ this.addColumn(targetTableName, targetColumn);
+ this.executeUpdate(moveSQL, false);
+
+ if (!isColumnNullable) {
+ // this can will trigger exception if some record is null
+ // ToDo: add default option
+ this.setColumnNullable(targetTableName, targetColumn.getName(), false);
+ }
+ this.dropColumn(sourceTableName, sourceColumn.getName());
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
index 099d08f..adf6647 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
@@ -26,6 +26,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
@@ -67,6 +68,16 @@ public class RequestEntity {
@Basic
private String commandName;
+ /**
+ * On large clusters, this value can be in the 10,000's of kilobytes. During
+ * an upgrade, all stages are loaded in memory for every request, which can
+ * lead to an OOM. As a result, lazy load this since it's barely ever
+ * requested or used.
+ */
+ @Column(name = "cluster_host_info")
+ @Basic(fetch = FetchType.LAZY)
+ private byte[] clusterHostInfo;
+
@Column(name = "inputs")
@Lob
private byte[] inputs = new byte[0];
@@ -151,6 +162,14 @@ public class RequestEntity {
this.stages = stages;
}
+ public String getClusterHostInfo() {
+ return clusterHostInfo == null ? "{}" : new String(clusterHostInfo);
+ }
+
+ public void setClusterHostInfo(String clusterHostInfo) {
+ this.clusterHostInfo = clusterHostInfo.getBytes();
+ }
+
public Long getCreateTime() {
return createTime;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java
index f688412..6ee0a3b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java
@@ -96,16 +96,6 @@ public class StageEntity {
* lead to an OOM. As a result, lazy load this since it's barely ever
* requested or used.
*/
- @Column(name = "cluster_host_info")
- @Basic(fetch = FetchType.LAZY)
- private byte[] clusterHostInfo;
-
- /**
- * On large clusters, this value can be in the 10,000's of kilobytes. During
- * an upgrade, all stages are loaded in memory for every request, which can
- * lead to an OOM. As a result, lazy load this since it's barely ever
- * requested or used.
- */
@Column(name = "command_params")
@Basic(fetch = FetchType.LAZY)
private byte[] commandParamsStage;
@@ -187,14 +177,6 @@ public class StageEntity {
return defaultString(requestContext);
}
- public String getClusterHostInfo() {
- return clusterHostInfo == null ? new String() : new String(clusterHostInfo);
- }
-
- public void setClusterHostInfo(String clusterHostInfo) {
- this.clusterHostInfo = clusterHostInfo.getBytes();
- }
-
public String getCommandParamsStage() {
return commandParamsStage == null ? new String() : new String(commandParamsStage);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity_.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity_.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity_.java
index dc39e55..637a18b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity_.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity_.java
@@ -41,7 +41,6 @@ public class StageEntity_ {
public static volatile SingularAttribute<StageEntity, String> logInfo;
public static volatile SingularAttribute<StageEntity, String> requestContext;
- public static volatile SingularAttribute<StageEntity, byte[]> clusterHostInfo;
public static volatile SingularAttribute<StageEntity, byte[]> commandParamsStage;
public static volatile SingularAttribute<StageEntity, byte[]> hostParamsStage;
@@ -74,9 +73,6 @@ public class StageEntity_ {
mapping.put(StageResourceProvider.STAGE_CONTEXT,
Collections.singletonList(requestContext));
- mapping.put(StageResourceProvider.STAGE_CLUSTER_HOST_INFO,
- Collections.singletonList(clusterHostInfo));
-
mapping.put(StageResourceProvider.STAGE_COMMAND_PARAMS,
Collections.singletonList(commandParamsStage));
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
index d374ddc..7f74bb0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
@@ -127,6 +127,27 @@ public interface DbmsHelper {
String getSetNullableStatement(String tableName, DBAccessor.DBColumnInfo columnInfo, boolean nullable);
/**
+ * Get's the {@code UPDATE} statement for {@code sourceTable} for copy column from {@code targetTable} by matching
+ * table keys {@code sourceIDColumnName} and {@code targetIDColumnName}
+ *
+ * @param sourceTable
+ * the source table name
+ * @param sourceColumnName
+ * the source column name
+ * @param sourceIDColumnName
+ * source key id column which would be used to math right rows for {@code targetTable}
+ * @param targetTable
+ * the destination table name
+ * @param targetColumnName
+ * the destination column name
+ * @param targetIDColumnName
+ * destination key id column name which should math {@code sourceIDColumnName}
+ * @return
+ */
+ String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName, String sourceIDColumnName,
+ String targetTable, String targetColumnName, String targetIDColumnName);
+
+ /**
* Gets whether the database platform supports adding contraints after the
* {@code NULL} constraint. Some database, such as Oracle, don't allow this.
* Unfortunately, EclipsLink hard codes the order of constraints.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
index f60c138..7e3092d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
@@ -78,6 +78,14 @@ public class GenericDbmsHelper implements DbmsHelper {
return stringBuilder.toString();
}
+ /**
+ {@inheritDoc}
+ */
+ @Override
+ public String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName, String sourceIDColumnName, String targetTable, String targetColumnName, String targetIDColumnName) {
+ throw new UnsupportedOperationException("Column copy is not supported for generic DB");
+ }
+
public StringBuilder writeAlterTableClause(StringBuilder builder, String tableName) {
builder.append("ALTER TABLE ").append(tableName).append(" ");
return builder;
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
index c693be5..0daea72 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
@@ -93,4 +93,16 @@ public class MySqlHelper extends GenericDbmsHelper {
}
return defaultWriter;
}
+
+ /**
+ {@inheritDoc}
+ */
+ @Override
+ public String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName,
+ String sourceIDColumnName, String targetTable, String targetColumnName, String targetIDColumnName) {
+
+ return String.format("UPDATE %1$s AS a INNER JOIN %2$s AS b ON a.%5$s = b.%6$s SET a.%3$s = b.%4$s",
+ targetTable, sourceTable, targetColumnName, sourceColumnName, targetIDColumnName, sourceIDColumnName);
+ }
+
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
index b5955b4..73356d1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
@@ -79,4 +79,16 @@ public class OracleHelper extends GenericDbmsHelper {
public boolean isConstraintSupportedAfterNullability() {
return false;
}
+
+ /**
+ {@inheritDoc}
+ */
+ @Override
+ public String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName,
+ String sourceIDColumnName, String targetTable, String targetColumnName, String targetIDColumnName) {
+
+ // sub-query should return only one value, ROWNUM is safe-guard for this
+ return String.format("UPDATE %1$s a SET (a.%3$s) = (SELECT b.%4$s FROM %2$s b WHERE b.%6$s = a.%5$s and ROWNUM < 2)",
+ targetTable, sourceTable, targetColumnName, sourceColumnName, targetIDColumnName, sourceIDColumnName);
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
index 2237f86..37c1184 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
@@ -44,6 +44,18 @@ public class PostgresHelper extends GenericDbmsHelper {
return builder;
}
+ /**
+ {@inheritDoc}
+ */
+ @Override
+ public String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName,
+ String sourceIDColumnName, String targetTable, String targetColumnName, String targetIDColumnName) {
+
+ return String.format("UPDATE %1$s AS a SET %3$s = b.%4$s FROM %2$s AS b WHERE a.%5$s = b.%6$s",
+ targetTable, sourceTable, targetColumnName, sourceColumnName, targetIDColumnName, sourceIDColumnName);
+ }
+
+
@Override
public StringBuilder writeSetNullableString(StringBuilder builder,
String tableName, DBAccessor.DBColumnInfo columnInfo, boolean nullable) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
index b54c7c7..b6b756b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
@@ -283,7 +283,7 @@ public class RoleGraph {
Stage newStage = stageFactory.createNew(origStage.getRequestId(),
origStage.getLogDir(), origStage.getClusterName(),
origStage.getClusterId(),
- origStage.getRequestContext(), origStage.getClusterHostInfo(),
+ origStage.getRequestContext(),
origStage.getCommandParamsStage(), origStage.getHostParamsStage());
newStage.setSuccessFactors(origStage.getSuccessFactors());
newStage.setSkippable(origStage.isSkippable());
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
index 745890c..5ed33a8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
@@ -33,6 +33,8 @@ import org.apache.commons.lang.StringUtils;
import com.google.inject.Inject;
import com.google.inject.Injector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The {@link UpgradeCatalog251} upgrades Ambari from 2.5.0 to 2.5.1.
@@ -44,6 +46,17 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
protected static final String KAFKA_BROKER_CONFIG = "kafka-broker";
+ private static final String STAGE_TABLE = "stage";
+ private static final String REQUEST_TABLE = "request";
+ private static final String CLUSTER_HOST_INFO_COLUMN = "cluster_host_info";
+ private static final String REQUEST_ID_COLUMN = "request_id";
+
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(UpgradeCatalog251.class);
+
/**
* Constructor.
*
@@ -76,6 +89,7 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
@Override
protected void executeDDLUpdates() throws AmbariException, SQLException {
addBackgroundColumnToHostRoleCommand();
+ moveClusterHostColumnFromStageToRequest();
}
/**
@@ -136,4 +150,19 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
dbAccessor.addColumn(HOST_ROLE_COMMAND_TABLE,
new DBColumnInfo(HRC_IS_BACKGROUND_COLUMN, Short.class, null, 0, false));
}
+
+ /**
+ * Moves the {@value #CLUSTER_HOST_INFO_COLUMN} column from {@value #STAGE_TABLE} table to the
+ * {@value #REQUEST_TABLE} table
+ *
+ *
+ * @throws SQLException
+ */
+ private void moveClusterHostColumnFromStageToRequest() throws SQLException {
+ DBColumnInfo sourceColumn = new DBColumnInfo(CLUSTER_HOST_INFO_COLUMN, byte[].class, null, null, false);
+ DBColumnInfo targetColumn = new DBColumnInfo(CLUSTER_HOST_INFO_COLUMN, byte[].class, null, null, false);
+
+ dbAccessor.moveColumnToAnotherTable(STAGE_TABLE, sourceColumn, REQUEST_ID_COLUMN, REQUEST_TABLE, targetColumn,
+ REQUEST_ID_COLUMN, false);
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
index 6a88aea..f184f37 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
@@ -194,20 +194,20 @@ public class StageUtils {
return requestStageIds;
}
- public static Stage getATestStage(long requestId, long stageId, String clusterHostInfo, String commandParamsStage, String hostParamsStage) {
+ public static Stage getATestStage(long requestId, long stageId, String commandParamsStage, String hostParamsStage) {
String hostname;
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostname = "host-dummy";
}
- return getATestStage(requestId, stageId, hostname, clusterHostInfo, commandParamsStage, hostParamsStage);
+ return getATestStage(requestId, stageId, hostname, commandParamsStage, hostParamsStage);
}
//For testing only
@Inject
- public static Stage getATestStage(long requestId, long stageId, String hostname, String clusterHostInfo, String commandParamsStage, String hostParamsStage) {
- Stage s = stageFactory.createNew(requestId, "/tmp", "cluster1", 1L, "context", clusterHostInfo, commandParamsStage, hostParamsStage);
+ public static Stage getATestStage(long requestId, long stageId, String hostname, String commandParamsStage, String hostParamsStage) {
+ Stage s = stageFactory.createNew(requestId, "/tmp", "cluster1", 1L, "context", commandParamsStage, hostParamsStage);
s.setStageId(stageId);
long now = System.currentTimeMillis();
s.addHostRoleExecutionCommand(hostname, Role.NAMENODE, RoleCommand.INSTALL,
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index ece6600..15670f3 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -341,6 +341,7 @@ CREATE TABLE request (
start_time BIGINT NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info BLOB NOT NULL,
CONSTRAINT PK_request PRIMARY KEY (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -352,7 +353,6 @@ CREATE TABLE stage (
supports_auto_skip_failure SMALLINT DEFAULT 0 NOT NULL,
log_info VARCHAR(255) NOT NULL,
request_context VARCHAR(255),
- cluster_host_info BLOB NOT NULL,
command_params BLOB,
host_params BLOB,
command_execution_type VARCHAR(32) NOT NULL DEFAULT 'STAGE',
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 e0f2ef9..7e41399 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -362,6 +362,7 @@ CREATE TABLE request (
start_time BIGINT NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info LONGBLOB,
CONSTRAINT PK_request PRIMARY KEY (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -373,7 +374,6 @@ CREATE TABLE stage (
supports_auto_skip_failure SMALLINT DEFAULT 0 NOT NULL,
log_info VARCHAR(255) NOT NULL,
request_context VARCHAR(255),
- cluster_host_info LONGBLOB,
command_params LONGBLOB,
host_params LONGBLOB,
command_execution_type VARCHAR(32) NOT NULL DEFAULT 'STAGE',
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 6d0f856..4d0274f 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -342,6 +342,7 @@ CREATE TABLE request (
start_time NUMBER(19) NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info BLOB NOT NULL,
CONSTRAINT PK_request PRIMARY KEY (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -353,7 +354,6 @@ CREATE TABLE stage (
supports_auto_skip_failure NUMBER(1) DEFAULT 0 NOT NULL,
log_info VARCHAR2(255) NULL,
request_context VARCHAR2(255) NULL,
- cluster_host_info BLOB NOT NULL,
command_params BLOB,
host_params BLOB,
command_execution_type VARCHAR2(32) DEFAULT 'STAGE' NOT NULL,
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 49b956b..cc933fa 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -341,6 +341,7 @@ CREATE TABLE request (
start_time BIGINT NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info BYTEA NOT NULL,
CONSTRAINT PK_request PRIMARY KEY (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -352,7 +353,6 @@ CREATE TABLE stage (
supports_auto_skip_failure SMALLINT DEFAULT 0 NOT NULL,
log_info VARCHAR(255) NOT NULL,
request_context VARCHAR(255),
- cluster_host_info BYTEA NOT NULL,
command_params BYTEA,
host_params BYTEA,
command_execution_type VARCHAR(32) DEFAULT 'STAGE' NOT NULL,
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 c594a2e..5fc14d4 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -340,6 +340,7 @@ CREATE TABLE request (
start_time NUMERIC(19) NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info IMAGE,
CONSTRAINT PK_request PRIMARY KEY (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -351,7 +352,6 @@ CREATE TABLE stage (
supports_auto_skip_failure SMALLINT DEFAULT 0 NOT NULL,
log_info VARCHAR(255) NOT NULL,
request_context VARCHAR(255),
- cluster_host_info IMAGE,
command_params IMAGE,
host_params IMAGE,
command_execution_type VARCHAR(32) NOT NULL DEFAULT 'STAGE',
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 77459a6..12e66f9 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -346,6 +346,7 @@ CREATE TABLE request (
start_time BIGINT NOT NULL,
status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
display_status VARCHAR(255) NOT NULL DEFAULT 'PENDING',
+ cluster_host_info VARBINARY(MAX) NOT NULL,
CONSTRAINT PK_request PRIMARY KEY CLUSTERED (request_id),
CONSTRAINT FK_request_schedule_id FOREIGN KEY (request_schedule_id) REFERENCES requestschedule (schedule_id));
@@ -357,7 +358,6 @@ CREATE TABLE stage (
supports_auto_skip_failure SMALLINT DEFAULT 0 NOT NULL,
log_info VARCHAR(255) NOT NULL,
request_context VARCHAR(255),
- cluster_host_info VARBINARY(MAX) NOT NULL,
command_params VARBINARY(MAX),
host_params VARBINARY(MAX),
command_execution_type VARCHAR(32) NOT NULL DEFAULT 'STAGE',
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index e536d05..e0f81e6 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -139,6 +139,7 @@
"Requests/abort_reason",
"Requests/remove_pending_host_requests",
"Requests/pending_host_request_count",
+ "Requests/cluster_host_info",
"_"
],
"RequestSchedule" : [
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
index 89ec32b..8165da5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
@@ -149,7 +149,7 @@ public class ExecutionCommandWrapperTest {
private static void createTask(ActionDBAccessor db, long requestId, long stageId, String hostName, String clusterName) throws AmbariException {
- Stage s = stageFactory.createNew(requestId, "/var/log", clusterName, 1L, "execution command wrapper test", "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ Stage s = stageFactory.createNew(requestId, "/var/log", clusterName, 1L, "execution command wrapper test", "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(hostName, Role.NAMENODE,
RoleCommand.START,
@@ -157,7 +157,7 @@ public class ExecutionCommandWrapperTest {
hostName, System.currentTimeMillis()), clusterName, "HDFS", false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
db.persistActions(request);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
index 89627f7..214aee1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageTest.java
@@ -66,7 +66,7 @@ public class StageTest {
@Test
public void testAddServerActionCommand_userName() throws Exception {
- final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 978, "context", CLUSTER_HOST_INFO,
+ final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 978, "context",
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
stage.addServerActionCommand(ConfigureAction.class.getName(),
[2/6] ambari git commit: AMBARI-21057. Change Storage of Data on
Request/Stage/Task To Reduce Redundency (dgrinenko via dlysnichenko)
Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
index c1056dd..75ad9ab 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
@@ -193,7 +193,7 @@ public class TestActionDBAccessorImpl {
List<Stage> stages = new ArrayList<>();
stages.add(createStubStage(hostName, requestId, stageId));
stages.add(createStubStage(hostName, requestId, stageId + 1));
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
db.persistActions(request);
assertEquals(2, stages.size());
}
@@ -539,7 +539,7 @@ public class TestActionDBAccessorImpl {
@Test
public void testAbortRequest() throws AmbariException {
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action db accessor test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
clusters.addHost("host2");
@@ -576,7 +576,8 @@ public class TestActionDBAccessorImpl {
String hostName = cmd.getHostName();
cmd.setStatus(HostRoleStatus.COMPLETED);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
+ request.setClusterHostInfo("clusterHostInfo");
db.persistActions(request);
db.abortOperation(requestId);
@@ -620,7 +621,7 @@ public class TestActionDBAccessorImpl {
stages.add(stage);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
// persist entities
db.persistActions(request);
@@ -668,7 +669,7 @@ public class TestActionDBAccessorImpl {
@Test
public void testGet1000TasksFromOracleDB() throws Exception {
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action db accessor test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
for (int i = 1000; i < 2002; i++) {
String host = "host" + i;
@@ -681,7 +682,8 @@ public class TestActionDBAccessorImpl {
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
+ request.setClusterHostInfo("clusterHostInfo");
db.persistActions(request);
List<HostRoleCommandEntity> entities =
@@ -709,7 +711,7 @@ public class TestActionDBAccessorImpl {
Stage s = createStubStage(hostname, requestId, stageId);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
db.persistActions(request);
}
@@ -723,7 +725,7 @@ public class TestActionDBAccessorImpl {
stages.add(stage);
}
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
db.persistActions(request);
}
@@ -733,7 +735,7 @@ public class TestActionDBAccessorImpl {
Stage s = createStubStage(hostname, requestId, stageId);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
s.setHostRoleStatus(hostname, Role.HBASE_REGIONSERVER.name(), HostRoleStatus.COMPLETED);
s.setHostRoleStatus(hostname, Role.HBASE_MASTER.name(), HostRoleStatus.COMPLETED);
@@ -747,7 +749,7 @@ public class TestActionDBAccessorImpl {
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
s.setHostRoleStatus(hostname, Role.HBASE_REGIONSERVER.name(), HostRoleStatus.PENDING);
s.setHostRoleStatus(hostname, Role.HBASE_MASTER.name(), HostRoleStatus.COMPLETED);
@@ -756,7 +758,7 @@ public class TestActionDBAccessorImpl {
private Stage createStubStage(String hostname, long requestId, long stageId) {
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action db accessor test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(hostname, Role.HBASE_MASTER,
RoleCommand.START,
@@ -774,7 +776,7 @@ public class TestActionDBAccessorImpl {
private void populateActionDBWithCustomAction(ActionDBAccessor db, String hostname,
long requestId, long stageId) throws AmbariException {
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action db accessor test",
- "", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(hostname, Role.valueOf(actionName),
RoleCommand.ACTIONEXECUTE,
@@ -785,20 +787,22 @@ public class TestActionDBAccessorImpl {
final RequestResourceFilter resourceFilter = new RequestResourceFilter("HBASE", "HBASE_MASTER", null);
List<RequestResourceFilter> resourceFilters = new
ArrayList<RequestResourceFilter>() {{ add(resourceFilter); }};
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
+ request.setClusterHostInfo("");
db.persistActions(request);
}
private void populateActionDBWithServerAction(ActionDBAccessor db, String hostname,
long requestId, long stageId) throws AmbariException {
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action db accessor test",
- "", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addServerActionCommand(serverActionName, null, Role.AMBARI_SERVER_ACTION,
RoleCommand.ACTIONEXECUTE, clusterName, null, null, "command details", null, 300, false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
+ request.setClusterHostInfo("");
db.persistActions(request);
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
index fbd7c4e..410de80 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
@@ -220,7 +220,7 @@ public class TestActionManager {
}
private void populateActionDB(ActionDBAccessor db, String hostname) throws AmbariException {
- Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action manager test", "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action manager test", "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(hostname, Role.HBASE_MASTER,
RoleCommand.START,
@@ -228,12 +228,12 @@ public class TestActionManager {
hostname, System.currentTimeMillis()), "cluster1", "HBASE", false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
db.persistActions(request);
}
private void populateActionDBWithTwoCommands(ActionDBAccessor db, String hostname) throws AmbariException {
- Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action manager test", "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action manager test", "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(hostname, Role.HBASE_MASTER,
RoleCommand.START,
@@ -245,7 +245,7 @@ public class TestActionManager {
hostname, System.currentTimeMillis()), "cluster1", "HBASE", false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
db.persistActions(request);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index b1a7524..869234b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -210,7 +210,7 @@ public class TestActionScheduler {
ActionDBAccessor db = mock(ActionDBAccessorImpl.class);
HostRoleCommandDAO hostRoleCommandDAOMock = mock(HostRoleCommandDAO.class);
Mockito.doNothing().when(hostRoleCommandDAOMock).publishTaskCreateEvent(anyListOf(HostRoleCommand.class));
- Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO,
+ Stage s = StageUtils.getATestStage(1, 977, hostname,
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
List<Stage> stages = Collections.singletonList(s);
@@ -219,8 +219,10 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
+
//Keep large number of attempts so that the task is not expired finally
//Small action timeout to test rescheduling
ActionScheduler scheduler = new ActionScheduler(100, 5, db, aq, fsm,
@@ -306,7 +308,7 @@ public class TestActionScheduler {
hostEntity.setHostName(hostname);
hostDAO.create(hostEntity);
- final Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO,
+ final Stage s = StageUtils.getATestStage(1, 977, hostname,
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
s.addHostRoleExecutionCommand(hostname, Role.SECONDARY_NAMENODE, RoleCommand.INSTALL,
new ServiceComponentHostInstallEvent("SECONDARY_NAMENODE", hostname, System.currentTimeMillis(), "HDP-1.2.0"),
@@ -322,6 +324,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
doAnswer(new Answer<Void>() {
@@ -395,7 +398,7 @@ public class TestActionScheduler {
when(host.getState()).thenReturn(HostState.HEARTBEAT_LOST);
when(host.getHostName()).thenReturn(hostname);
- final Stage s = StageUtils.getATestStage(1, 977, hostname, CLUSTER_HOST_INFO,
+ final Stage s = StageUtils.getATestStage(1, 977, hostname,
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
List<Stage> stages = Collections.singletonList(s);
@@ -483,7 +486,7 @@ public class TestActionScheduler {
when(serviceObj.getCluster()).thenReturn(oneClusterMock);
final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L, "stageWith2Tasks",
- CLUSTER_HOST_INFO, "{\"command_param\":\"param_value\"}", "{\"host_param\":\"param_value\"}");
+ "{\"command_param\":\"param_value\"}", "{\"host_param\":\"param_value\"}");
addInstallTaskToStage(stage, hostname1, "cluster1", Role.DATANODE,
RoleCommand.INSTALL, Service.Type.HDFS, 1);
addInstallTaskToStage(stage, hostname2, "cluster1", Role.NAMENODE,
@@ -613,6 +616,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -730,6 +734,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -773,6 +778,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -987,6 +993,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -1053,7 +1060,7 @@ public class TestActionScheduler {
String requestContext, int timeout, boolean stageSupportsAutoSkip,
boolean autoSkipFailedTask) {
- Stage stage = stageFactory.createNew(requestId, "/tmp", "cluster1", 1L, requestContext, CLUSTER_HOST_INFO,
+ Stage stage = stageFactory.createNew(requestId, "/tmp", "cluster1", 1L, requestContext,
"{}", "{}");
stage.setStageId(stageId);
@@ -1141,6 +1148,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(firstStageInProgressPerRequest.size());
@@ -1232,6 +1240,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -1309,6 +1318,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -1374,6 +1384,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stages.size());
@@ -1520,7 +1531,7 @@ public class TestActionScheduler {
long now = System.currentTimeMillis();
Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L,
- "testRequestFailureBasedOnSuccessFactor", CLUSTER_HOST_INFO, "", "");
+ "testRequestFailureBasedOnSuccessFactor", "", "");
stage.setStageId(1);
addHostRoleExecutionCommand(now, stage, Role.SQOOP, Service.Type.SQOOP,
@@ -1720,7 +1731,7 @@ public class TestActionScheduler {
long now = System.currentTimeMillis();
Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L, "testRequestFailureBasedOnSuccessFactor",
- CLUSTER_HOST_INFO, "", "");
+ "", "");
stage.setStageId(1);
stage.addHostRoleExecutionCommand("host1", Role.DATANODE, RoleCommand.UPGRADE,
new ServiceComponentHostUpgradeEvent(Role.DATANODE.toString(), "host1", now, "HDP-0.2"),
@@ -1871,7 +1882,7 @@ public class TestActionScheduler {
private Stage createStage(String clusterName, int stageId, int requestId) {
Stage stage = stageFactory.createNew(requestId, "/tmp", clusterName, 1L, "getStageWithSingleTask",
- CLUSTER_HOST_INFO, "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
+ "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
stage.setStageId(stageId);
return stage;
}
@@ -1971,7 +1982,6 @@ public class TestActionScheduler {
//Data for stages
Map<String, Set<String>> clusterHostInfo1 = StageUtils.getGson().fromJson(CLUSTER_HOST_INFO, type);
- Map<String, Set<String>> clusterHostInfo2 = StageUtils.getGson().fromJson(CLUSTER_HOST_INFO_UPDATED, type);
int stageId = 1;
int requestId1 = 1;
int requestId2 = 2;
@@ -2006,11 +2016,12 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
- Stage s1 = StageUtils.getATestStage(requestId1, stageId, hostname, CLUSTER_HOST_INFO,
+ Stage s1 = StageUtils.getATestStage(requestId1, stageId, hostname,
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
- Stage s2 = StageUtils.getATestStage(requestId2, stageId, hostname, CLUSTER_HOST_INFO_UPDATED,
+ Stage s2 = StageUtils.getATestStage(requestId2, stageId, hostname,
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
when(db.getCommandsInProgressCount()).thenReturn(1);
@@ -2037,7 +2048,7 @@ public class TestActionScheduler {
ac = waitForQueueSize(hostname, aq, 1, scheduler);
assertTrue(ac.get(0) instanceof ExecutionCommand);
assertEquals(String.valueOf(requestId2) + "-" + stageId, ((ExecutionCommand) (ac.get(0))).getCommandId());
- assertEquals(clusterHostInfo2, ((ExecutionCommand) (ac.get(0))).getClusterHostInfo());
+ assertEquals(clusterHostInfo1, ((ExecutionCommand) (ac.get(0))).getClusterHostInfo());
}
@@ -2087,7 +2098,7 @@ public class TestActionScheduler {
when(serviceObj.getCluster()).thenReturn(oneClusterMock);
Stage stage1 = stageFactory.createNew(1, "/tmp", "cluster1", 1L, "stageWith2Tasks",
- CLUSTER_HOST_INFO, "", "");
+ "", "");
addInstallTaskToStage(stage1, hostname1, "cluster1", Role.HBASE_MASTER,
RoleCommand.INSTALL, Service.Type.HBASE, 1);
addInstallTaskToStage(stage1, hostname1, "cluster1", Role.HBASE_REGIONSERVER,
@@ -2166,6 +2177,7 @@ public class TestActionScheduler {
Mockito.doNothing().when(hostRoleCommandDAOMock).publishTaskCreateEvent(anyListOf(HostRoleCommand.class));
RequestEntity request = mock(RequestEntity.class);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(request.isExclusive()).thenReturn(false);
when(db.getRequestEntity(anyLong())).thenReturn(request);
@@ -2319,6 +2331,7 @@ public class TestActionScheduler {
RequestEntity request = mock(RequestEntity.class);
when(request.isExclusive()).thenReturn(false);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(anyLong())).thenReturn(request);
when(db.getCommandsInProgressCount()).thenReturn(stagesInProgress.size());
@@ -2569,10 +2582,13 @@ public class TestActionScheduler {
RequestEntity request1 = mock(RequestEntity.class);
when(request1.isExclusive()).thenReturn(false);
+ when(request1.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
RequestEntity request2 = mock(RequestEntity.class);
when(request2.isExclusive()).thenReturn(true);
+ when(request2.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
RequestEntity request3 = mock(RequestEntity.class);
when(request3.isExclusive()).thenReturn(false);
+ when(request3.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(db.getRequestEntity(requestId1)).thenReturn(request1);
when(db.getRequestEntity(requestId2)).thenReturn(request2);
@@ -2764,6 +2780,7 @@ public class TestActionScheduler {
Mockito.doNothing().when(hostRoleCommandDAOMock).publishTaskCreateEvent(anyListOf(HostRoleCommand.class));
RequestEntity request = mock(RequestEntity.class);
+ when(request.getClusterHostInfo()).thenReturn(CLUSTER_HOST_INFO);
when(request.isExclusive()).thenReturn(false);
when(db.getRequestEntity(anyLong())).thenReturn(request);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
index b76e41e..82db6e1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
@@ -60,7 +60,7 @@ public class TestStage {
@Test
public void testTaskTimeout() {
- Stage s = StageUtils.getATestStage(1, 1, "h1", CLUSTER_HOST_INFO, "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
+ Stage s = StageUtils.getATestStage(1, 1, "h1", "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
s.addHostRoleExecutionCommand("h1", Role.DATANODE, RoleCommand.INSTALL,
null, "c1", "HDFS", false, false);
s.addHostRoleExecutionCommand("h1", Role.HBASE_MASTER, RoleCommand.INSTALL,
@@ -75,9 +75,8 @@ public class TestStage {
@Test
public void testGetRequestContext() {
- Stage stage = stageFactory.createNew(1, "/logDir", "c1", 1L, "My Context", CLUSTER_HOST_INFO, "", "");
+ Stage stage = stageFactory.createNew(1, "/logDir", "c1", 1L, "My Context", "", "");
assertEquals("My Context", stage.getRequestContext());
- assertEquals(CLUSTER_HOST_INFO, stage.getClusterHostInfo());
}
@After
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
index 2dd91c0..ceda927 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
@@ -987,7 +987,7 @@ public class HeartbeatProcessorTest {
serviceComponentHost2.setStackVersion(stack120);
Stage s = stageFactory.createNew(requestId, "/a/b", "cluster1", 1L, "action manager test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
s.addHostRoleExecutionCommand(DummyHostname1, Role.DATANODE, RoleCommand.UPGRADE,
new ServiceComponentHostUpgradeEvent(Role.DATANODE.toString(),
@@ -999,7 +999,7 @@ public class HeartbeatProcessorTest {
DummyCluster, "HDFS", false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
actionDBAccessor.persistActions(request);
CommandReport cr = new CommandReport();
cr.setActionId(StageUtils.getActionId(requestId, stageId));
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
index 2e65e8d..a13053c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
@@ -223,7 +223,7 @@ public class HeartbeatTestHelper {
public void populateActionDB(ActionDBAccessor db, String DummyHostname1, long requestId, long stageId) throws AmbariException {
Stage s = stageFactory.createNew(requestId, "/a/b", DummyCluster, 1L, "heartbeat handler test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(stageId);
String filename = null;
s.addHostRoleExecutionCommand(DummyHostname1, Role.HBASE_MASTER,
@@ -232,7 +232,7 @@ public class HeartbeatTestHelper {
DummyHostname1, System.currentTimeMillis()), DummyCluster, HBASE, false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
db.persistActions(request);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
index 909bf69..5ced924 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
@@ -864,7 +864,7 @@ public class TestHeartbeatHandler {
serviceComponentHost1.setState(State.INSTALLING);
Stage s = stageFactory.createNew(1, "/a/b", "cluster1", 1L, "action manager test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
s.setStageId(1);
s.addHostRoleExecutionCommand(DummyHostname1, Role.DATANODE, RoleCommand.INSTALL,
new ServiceComponentHostInstallEvent(Role.DATANODE.toString(),
@@ -872,7 +872,7 @@ public class TestHeartbeatHandler {
DummyCluster, "HDFS", false, false);
List<Stage> stages = new ArrayList<>();
stages.add(s);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "clusterHostInfo", clusters);
actionDBAccessor.persistActions(request);
actionDBAccessor.abortHostRole(DummyHostname1, 1, 1, Role.DATANODE.name());
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/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 628a56f..cbd5de3 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
@@ -8272,7 +8272,7 @@ public class AmbariManagementControllerTest {
List<Stage> stages = new ArrayList<>();
stages.add(stageFactory.createNew(requestId1, "/a1", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(0).setStageId(1);
stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_MASTER,
RoleCommand.START,
@@ -8281,7 +8281,7 @@ public class AmbariManagementControllerTest {
cluster1, "HBASE", false, false);
stages.add(stageFactory.createNew(requestId1, "/a2", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(1).setStageId(2);
stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
RoleCommand.START,
@@ -8289,19 +8289,19 @@ public class AmbariManagementControllerTest {
hostName1, System.currentTimeMillis()), cluster1, "HBASE", false, false);
stages.add(stageFactory.createNew(requestId1, "/a3", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(2).setStageId(3);
stages.get(2).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
RoleCommand.START,
new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
hostName1, System.currentTimeMillis()), cluster1, "HBASE", false, false);
- Request request = new Request(stages, clusters);
+ Request request = new Request(stages, "", clusters);
actionDB.persistActions(request);
stages.clear();
stages.add(stageFactory.createNew(requestId2, "/a4", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(0).setStageId(4);
stages.get(0).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
RoleCommand.START,
@@ -8309,14 +8309,14 @@ public class AmbariManagementControllerTest {
hostName1, System.currentTimeMillis()), cluster1, "HBASE", false, false);
stages.add(stageFactory.createNew(requestId2, "/a5", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(1).setStageId(5);
stages.get(1).addHostRoleExecutionCommand(hostName1, Role.HBASE_CLIENT,
RoleCommand.START,
new ServiceComponentHostStartEvent(Role.HBASE_CLIENT.toString(),
hostName1, System.currentTimeMillis()), cluster1, "HBASE", false, false);
- request = new Request(stages, clusters);
+ request = new Request(stages, "", clusters);
actionDB.persistActions(request);
// Add a stage to execute a task as server-side action on the Ambari server
@@ -8324,12 +8324,12 @@ public class AmbariManagementControllerTest {
new ServiceComponentHostServerActionEvent(Role.AMBARI_SERVER_ACTION.toString(), null, System.currentTimeMillis());
stages.clear();
stages.add(stageFactory.createNew(requestId3, "/a6", cluster1, clusterId, context,
- CLUSTER_HOST_INFO, "", ""));
+ "", ""));
stages.get(0).setStageId(6);
stages.get(0).addServerActionCommand("some.action.class.name", null, Role.AMBARI_SERVER_ACTION,
RoleCommand.EXECUTE, cluster1, serviceComponentHostServerActionEvent, null, null, null, null, false, false);
assertEquals("_internal_ambari", stages.get(0).getOrderedHostRoleCommands().get(0).getHostName());
- request = new Request(stages, clusters);
+ request = new Request(stages, "", clusters);
actionDB.persistActions(request);
org.apache.ambari.server.controller.spi.Request spiRequest = PropertyHelper.getReadRequest(
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
index 5275580..e654c72 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
@@ -1103,6 +1103,8 @@ public class KerberosHelperTest extends EasyMockSupport {
// Create Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
@@ -1110,28 +1112,38 @@ public class KerberosHelperTest extends EasyMockSupport {
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(0L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
}
// Update Configs Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// TODO: Add more of these when more stages are added.
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
@@ -1294,36 +1306,50 @@ public class KerberosHelperTest extends EasyMockSupport {
// Create Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
if (identitiesManaged) {
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(0L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
}
// Update Configs Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// TODO: Add more of these when more stages are added.
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
- requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
+
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+
+ requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
replayAll();
@@ -1479,42 +1505,58 @@ public class KerberosHelperTest extends EasyMockSupport {
// Hook Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// StopZk Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Update Configs Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Destroy Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Delete Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(2L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Cleanup Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
@@ -1687,31 +1729,43 @@ public class KerberosHelperTest extends EasyMockSupport {
// Create Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(0L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Update Configurations Stage
expect(requestStageContainer.getLastStageId()).andReturn(1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
} else {
@@ -2809,7 +2863,7 @@ public class KerberosHelperTest extends EasyMockSupport {
private void setupStageFactory() {
final StageFactory stageFactory = injector.getInstance(StageFactory.class);
expect(stageFactory.createNew(anyLong(), anyObject(String.class), anyObject(String.class),
- anyLong(), anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyLong(), anyObject(String.class), anyObject(String.class),
anyObject(String.class)))
.andAnswer(new IAnswer<Stage>() {
@Override
@@ -3061,26 +3115,36 @@ public class KerberosHelperTest extends EasyMockSupport {
// Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
@@ -3253,21 +3317,29 @@ public class KerberosHelperTest extends EasyMockSupport {
// Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Delete Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Delete Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
@@ -3420,26 +3492,37 @@ public class KerberosHelperTest extends EasyMockSupport {
// Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
+
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
}
@@ -3582,21 +3665,29 @@ public class KerberosHelperTest extends EasyMockSupport {
// Preparation Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Delete Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Delete Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
+ requestStageContainer.setClusterHostInfo(anyString());
+ expectLastCall().once();
requestStageContainer.addStages(EasyMock.<List<Stage>>anyObject());
expectLastCall().once();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
index c399a4c..a0ec67f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
@@ -743,7 +743,7 @@ public class CalculatedStatusTest {
private final List<HostRoleCommand> hostRoleCommands = new LinkedList<>();
private TestStage() {
- super(1L, "", "", 1L, "", "", "", "", hostRoleCommandFactory, ecwFactory);
+ super(1L, "", "", 1L, "", "", "", hostRoleCommandFactory, ecwFactory);
}
void setHostRoleCommands(Collection<HostRoleCommandEntity> tasks) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
index 8f7b31d..eaf54c3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
@@ -337,7 +337,7 @@ public class ClusterStackVersionResourceProviderTest {
// Check that we create proper stage count
expect(stageFactory.createNew(anyLong(), anyObject(String.class),
anyObject(String.class), anyLong(),
- anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyObject(String.class), anyObject(String.class),
anyObject(String.class))).andReturn(stage).
times((int) Math.ceil(hostCount / MAX_TASKS_PER_STAGE));
@@ -555,7 +555,7 @@ public class ClusterStackVersionResourceProviderTest {
// Check that we create proper stage count
expect(stageFactory.createNew(anyLong(), anyObject(String.class),
anyObject(String.class), anyLong(),
- anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyObject(String.class), anyObject(String.class),
anyObject(String.class))).andReturn(stage).
times((int) Math.ceil(hostCount / MAX_TASKS_PER_STAGE));
@@ -784,7 +784,7 @@ public class ClusterStackVersionResourceProviderTest {
// Check that we create proper stage count
expect(stageFactory.createNew(anyLong(), anyObject(String.class),
anyObject(String.class), anyLong(),
- anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyObject(String.class), anyObject(String.class),
anyObject(String.class))).andReturn(stage).
times((int) Math.ceil(hostCount / MAX_TASKS_PER_STAGE));
@@ -1027,7 +1027,7 @@ public class ClusterStackVersionResourceProviderTest {
// Check that we create proper stage count
expect(stageFactory.createNew(anyLong(), anyObject(String.class),
anyObject(String.class), anyLong(),
- anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyObject(String.class), anyObject(String.class),
anyObject(String.class))).andReturn(stage).
times((int) Math.ceil(hostCount / MAX_TASKS_PER_STAGE));
@@ -1557,7 +1557,7 @@ public class ClusterStackVersionResourceProviderTest {
// Check that we create proper stage count
expect(stageFactory.createNew(anyLong(), anyObject(String.class),
anyObject(String.class), anyLong(),
- anyObject(String.class), anyObject(String.class), anyObject(String.class),
+ anyObject(String.class), anyObject(String.class),
anyObject(String.class))).andReturn(stage).
times((int) Math.ceil(hostCount / MAX_TASKS_PER_STAGE));
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStageContainerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStageContainerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStageContainerTest.java
index f60915c..4fcc814 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStageContainerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStageContainerTest.java
@@ -18,6 +18,7 @@
package org.apache.ambari.server.controller.internal;
+import static org.easymock.EasyMock.anyString;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.expect;
@@ -143,7 +144,7 @@ public class RequestStageContainerTest {
stages.add(stage2);
//expectations
- expect(requestFactory.createNewFromStages(stages)).andReturn(request);
+ expect(requestFactory.createNewFromStages(stages, "{}")).andReturn(request);
expect(request.getStages()).andReturn(stages).anyTimes();
actionManager.sendActions(request, null);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/hooks/users/UserHookServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/hooks/users/UserHookServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/hooks/users/UserHookServiceTest.java
index e8eb3e8..56dd1e2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/hooks/users/UserHookServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/hooks/users/UserHookServiceTest.java
@@ -217,8 +217,8 @@ public class UserHookServiceTest extends EasyMockSupport {
// TBD refine expectations to validate the logic / eg capture arguments
stageMock.addServerActionCommand(EasyMock.anyString(), EasyMock.anyString(), EasyMock.anyObject(Role.class), EasyMock.anyObject(RoleCommand.class), EasyMock.anyString(), EasyMock.anyObject(ServiceComponentHostServerActionEvent.class),
EasyMock.<Map<String, String>>anyObject(), EasyMock.anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject(), EasyMock.anyInt(), EasyMock.anyBoolean(), EasyMock.anyBoolean());
- EasyMock.expect(requestFactoryMock.createNewFromStages(Arrays.asList(stageMock))).andReturn(null);
- EasyMock.expect(stageFactoryMock.createNew(1, "/var/lib/ambari-server/tmp:1", "test-cluster", 1, "Post user creation hook for [ 1 ] users", "{}", "{}", "{}")).andReturn(stageMock);
+ EasyMock.expect(requestFactoryMock.createNewFromStages(Arrays.asList(stageMock), "{}")).andReturn(null);
+ EasyMock.expect(stageFactoryMock.createNew(1, "/var/lib/ambari-server/tmp:1", "test-cluster", 1, "Post user creation hook for [ 1 ] users", "{}", "{}")).andReturn(stageMock);
replayAll();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
index 2feef41..4d1b48b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
@@ -127,7 +127,7 @@ public class ServerActionExecutorTest {
final Request request = createMockRequest();
stageFactory = createNiceMock(StageFactory.class);
- final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 978, "context", CLUSTER_HOST_INFO,
+ final Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 978, "context",
"{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
stage.addServerActionCommand(ManualStageAction.class.getName(),
@@ -318,14 +318,13 @@ public class ServerActionExecutorTest {
final int timeout) {
stageFactory = createNiceMock(StageFactory.class);
expect(stageFactory.createNew(anyLong(), anyObject(String.class), anyObject(String.class),
- anyLong(), anyObject(String.class), anyObject(String.class),
- anyObject(String.class), anyObject(String.class))).
+ anyLong(), anyObject(String.class), anyObject(String.class), anyObject(String.class))).
andAnswer(new IAnswer<Stage>() {
@Override
public Stage answer() throws Throwable {
Stage stage = stageFactory.createNew(requestId, "/tmp", "cluster1",
- 1L, requestContext, CLUSTER_HOST_INFO, "{}", "{}");
+ 1L, requestContext, "{}", "{}");
stage.setStageId(stageId);
stage.addServerActionCommand(MockServerAction.class.getName(), null,
@@ -338,7 +337,7 @@ public class ServerActionExecutorTest {
}
});
- Stage stage = stageFactory.createNew(requestId, "", "", 1L, "", "", "", "");
+ Stage stage = stageFactory.createNew(requestId, "", "", 1L, "", "", "");
return stage;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
index 7063147..3e592b2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
@@ -126,7 +126,7 @@ public class TestStagePlanner {
RoleGraph rg = roleGraphFactory.createNew(rco);
long now = System.currentTimeMillis();
Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L, "execution command wrapper test",
- "clusterHostInfo", "commandParamsStage", "hostParamsStage");
+ "commandParamsStage", "hostParamsStage");
stage.setStageId(1);
stage.addServerActionCommand("RESTART", null, Role.HIVE_METASTORE,
RoleCommand.CUSTOM_COMMAND, "cluster1",
http://git-wip-us.apache.org/repos/asf/ambari/blob/f2bbe478/ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java
index e9bd27c..5b39086 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java
@@ -194,7 +194,7 @@ public class StageUtilsTest extends EasyMockSupport {
JsonMappingException, JAXBException, IOException {
StageUtils stageUtils = new StageUtils(injector.getInstance(StageFactory.class));
Stage s = StageUtils.getATestStage(1, 2, "host1", "clusterHostInfo", "hostParamsStage");
- ExecutionCommand cmd = s.getExecutionCommands(getHostName()).get(0).getExecutionCommand();
+ ExecutionCommand cmd = s.getExecutionCommands("host1").get(0).getExecutionCommand();
HashMap<String, Map<String, String>> configTags = new HashMap<>();
Map<String, String> globalTag = new HashMap<>();
globalTag.put("tag", "version1");