You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2017/04/24 02:20:46 UTC
[04/45] ambari git commit: AMBARI-20780 - Update HBase Configuration
group is ignored in upgrade.xml
AMBARI-20780 - Update HBase Configuration group is ignored in upgrade.xml
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f92e5f2e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f92e5f2e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f92e5f2e
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: f92e5f2e38e1b4ad0e0fc8dd6728d9cbcbc0dcc2
Parents: c651d6d
Author: Tim Thorpe <tt...@apache.org>
Authored: Wed Apr 19 11:15:09 2017 -0700
Committer: Tim Thorpe <tt...@apache.org>
Committed: Wed Apr 19 11:15:09 2017 -0700
----------------------------------------------------------------------
.../stacks/HDP/2.3/upgrades/upgrade-2.4.xml | 2 +-
.../stacks/HDP/2.3/upgrades/upgrade-2.5.xml | 2 +-
.../stacks/HDP/2.3/upgrades/upgrade-2.6.xml | 2 +-
.../ambari/server/state/UpgradeHelperTest.java | 33 ++++++++++++++++----
.../HDP/2.2.0/upgrades/upgrade_test_checks.xml | 21 ++++++++++++-
5 files changed, 50 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f92e5f2e/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 3757121..fd75e49 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -130,7 +130,7 @@
</service>
</group>
- <group name="HBASE" title="Update HBase Configuration">
+ <group xsi:type="cluster" name="HBASE" title="Update HBase Configuration">
<skippable>true</skippable>
<execute-stage service="HBASE" component="HBASE_MASTER" title="Update HBase Configuration">
http://git-wip-us.apache.org/repos/asf/ambari/blob/f92e5f2e/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index f7fd175..5318a51 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -158,7 +158,7 @@
</service>
</group>
- <group name="HBASE" title="Update HBase Configuration">
+ <group xsi:type="cluster" name="HBASE" title="Update HBase Configuration">
<skippable>true</skippable>
<execute-stage service="HBASE" component="HBASE_MASTER" title="Update HBase Configuration">
http://git-wip-us.apache.org/repos/asf/ambari/blob/f92e5f2e/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 78fe831..d2e6288 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -160,7 +160,7 @@
</service>
</group>
- <group name="HBASE" title="Update HBase Configuration">
+ <group xsi:type="cluster" name="HBASE" title="Update HBase Configuration">
<skippable>true</skippable>
<execute-stage service="HBASE" component="HBASE_MASTER" title="Update HBase Configuration">
http://git-wip-us.apache.org/repos/asf/ambari/blob/f92e5f2e/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
index 0dd7f58..d80b03c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
@@ -1039,12 +1039,9 @@ public class UpgradeHelperTest {
UpgradePack upgrade = upgrades.get("upgrade_test_checks");
assertNotNull(upgrade);
- Cluster c = makeCluster();
// HBASE and PIG have service checks, but not TEZ.
Set<String> additionalServices = new HashSet<String>() {{ add("HBASE"); add("PIG"); add("TEZ"); add("AMBARI_METRICS"); }};
- for(String service : additionalServices) {
- c.addService(service);
- }
+ Cluster c = makeCluster(true, additionalServices);
int numServiceChecksExpected = 0;
Collection<Service> services = c.getServices().values();
@@ -1071,9 +1068,9 @@ public class UpgradeHelperTest {
List<UpgradeGroupHolder> groups = m_upgradeHelper.createSequence(upgrade, context);
- assertEquals(7, groups.size());
+ assertEquals(8, groups.size());
- UpgradeGroupHolder holder = groups.get(3);
+ UpgradeGroupHolder holder = groups.get(4);
assertEquals(holder.name, "SERVICE_CHECK_1");
assertEquals(7, holder.items.size());
int numServiceChecksActual = 0;
@@ -1100,6 +1097,13 @@ public class UpgradeHelperTest {
assertEquals(
"This is a manual task with a placeholder of placeholder-rendered-properly",
manualTask.messages.get(0));
+
+ UpgradeGroupHolder clusterGroup = groups.get(3);
+ assertEquals(clusterGroup.name, "HBASE");
+ assertEquals(clusterGroup.title, "Update HBase Configuration");
+ assertEquals(1, clusterGroup.items.size());
+ StageWrapper stage = clusterGroup.items.get(0);
+ assertEquals(stage.getText(), "Update HBase Configuration");
}
@Test
@@ -1225,6 +1229,14 @@ public class UpgradeHelperTest {
* @throws AmbariException
*/
private Cluster makeCluster(boolean clean) throws AmbariException, AuthorizationException {
+ return makeCluster(clean, new HashSet<String>());
+ }
+
+ /**
+ * Create an HA cluster
+ * @throws AmbariException
+ */
+ private Cluster makeCluster(boolean clean, Set<String> additionalServices) throws AmbariException, AuthorizationException {
Clusters clusters = injector.getInstance(Clusters.class);
ServiceFactory serviceFactory = injector.getInstance(ServiceFactory.class);
@@ -1369,6 +1381,15 @@ public class UpgradeHelperTest {
expect(m_masterHostResolver.getCluster()).andReturn(c).anyTimes();
+ for(String service : additionalServices) {
+ c.addService(service);
+ if (service.equals("HBASE")) {
+ type = new HostsType();
+ type.hosts.addAll(Arrays.asList("h1", "h2"));
+ expect(m_masterHostResolver.getMasterAndHosts("HBASE", "HBASE_MASTER")).andReturn(type).anyTimes();
+ }
+ }
+
replay(m_masterHostResolver);
return c;
http://git-wip-us.apache.org/repos/asf/ambari/blob/f92e5f2e/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
index 4d4d972..b7027c5 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
@@ -78,7 +78,16 @@
</service>
<service-check>false</service-check>
</group>
-
+
+ <group xsi:type="cluster" name="HBASE" title="Update HBase Configuration">
+ <skippable>true</skippable>
+ <execute-stage service="HBASE" component="HBASE_MASTER" title="Update HBase Configuration">
+ <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.HBaseEnvMaxDirectMemorySizeAction">
+ <summary>Update HBase Env Configuration</summary>
+ </task>
+ </execute-stage>
+ </group>
+
<group name="SERVICE_CHECK_1" title="Post-Master Service Checks" xsi:type="service-check">
<priority>
<service>HDFS</service>
@@ -108,6 +117,16 @@
<message>Please run additional tests</message>
</batch>
</group>
+
+ <!-- This group will be ignored because it is an invalid syntax. It is not a cluster type but contains an execute-stage -->
+ <group name="HBASE" title="Update HBase Configuration">
+ <skippable>true</skippable>
+ <execute-stage service="HBASE" component="HBASE_MASTER" title="Update HBase Configuration">
+ <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.HBaseEnvMaxDirectMemorySizeAction">
+ <summary>Update HBase Env Configuration</summary>
+ </task>
+ </execute-stage>
+ </group>
<group name="SERVICE_CHECK_2" title="Post-Slave Service Checks" xsi:type="service-check">
<priority>