ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-12863. RU: Alter service check order (ncole)
Date Mon, 24 Aug 2015 20:59:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 274616eb8 -> fc0078f8f


AMBARI-12863.  RU: Alter service check order (ncole)


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

Branch: refs/heads/trunk
Commit: fc0078f8f30aa1973cea9d697c8fac46b437bc92
Parents: 274616e
Author: Nate Cole <ncole@hortonworks.com>
Authored: Mon Aug 24 07:57:07 2015 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Mon Aug 24 16:57:06 2015 -0400

----------------------------------------------------------------------
 .../stack/upgrade/ServiceCheckGrouping.java     |  9 +++++++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml     |  5 +++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml     |  5 +++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml     |  5 +++-
 .../server/state/stack/UpgradePackTest.java     | 24 ++++++++++++++++++++
 .../HDP/2.1.1/upgrades/upgrade_test_checks.xml  |  1 +
 6 files changed, 45 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
index 4fe5e98..fdf89cc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
@@ -52,7 +52,7 @@ public class ServiceCheckGrouping extends Grouping {
 
   @XmlElementWrapper(name="priority")
   @XmlElement(name="service")
-  private Set<String> priorityServices = new HashSet<String>();
+  private Set<String> priorityServices = new LinkedHashSet<String>();
 
   @XmlElementWrapper(name="exclude")
   @XmlElement(name="service")
@@ -66,6 +66,13 @@ public class ServiceCheckGrouping extends Grouping {
   }
 
   /**
+   * @return the set of service names that should be given priority
+   */
+  public Set<String> getPriorities() {
+    return priorityServices;
+  }
+
+  /**
    * Used to build stages for service check groupings.
    */
   public class ServiceCheckBuilder extends StageWrapperBuilder {

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
index 526efe4..d67671c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
@@ -99,9 +99,10 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
-        <service>MAPREDUCE2</service>
         <service>YARN</service>
+        <service>MAPREDUCE2</service>
         <service>HBASE</service>
       </priority>
       <exclude>
@@ -135,6 +136,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>
@@ -220,6 +222,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index 2aad30b..04befaf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -127,9 +127,10 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
-        <service>MAPREDUCE2</service>
         <service>YARN</service>
+        <service>MAPREDUCE2</service>
         <service>HBASE</service>
       </priority>
       <exclude>
@@ -163,6 +164,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>
@@ -249,6 +251,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
index 38622bd..4719558 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
@@ -122,9 +122,10 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
-        <service>MAPREDUCE2</service>
         <service>YARN</service>
+        <service>MAPREDUCE2</service>
         <service>HBASE</service>
       </priority>
       <exclude>
@@ -160,6 +161,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>
@@ -249,6 +251,7 @@
       <skippable>true</skippable>
       <direction>UPGRADE</direction>
       <priority>
+        <service>ZOOKEEPER</service>
         <service>HDFS</service>
         <service>YARN</service>
         <service>HBASE</service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
index 7a1d522..e073b43 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
@@ -27,6 +27,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Set;
 
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
@@ -39,6 +40,7 @@ import org.apache.ambari.server.state.stack.upgrade.ConfigureTask.Transfer;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.Grouping;
 import org.apache.ambari.server.state.stack.upgrade.RestartTask;
+import org.apache.ambari.server.state.stack.upgrade.ServiceCheckGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.TransferOperation;
 import org.junit.After;
@@ -213,19 +215,41 @@ public class UpgradePackTest {
         "ZOOKEEPER",
         "POST_CLUSTER");
 
+    Grouping serviceCheckGroup = null;
+
     int i = 0;
     List<Grouping> groups = up.getGroups(Direction.UPGRADE);
     for (Grouping g : groups) {
       assertEquals(expected_up.get(i), g.name);
       i++;
+
+      if (g.name.equals("SERVICE_CHECK_1")) {
+        serviceCheckGroup = g;
+      }
     }
 
+    List<String> expected_priority = Arrays.asList("HDFS", "HBASE", "YARN");
+
+    assertNotNull(serviceCheckGroup);
+    assertEquals(ServiceCheckGrouping.class, serviceCheckGroup.getClass());
+    ServiceCheckGrouping scg = (ServiceCheckGrouping) serviceCheckGroup;
+
+    Set<String> priorities = scg.getPriorities();
+    assertEquals(3, priorities.size());
+
+    i = 0;
+    for (String s : priorities) {
+      assertEquals(expected_priority.get(i++), s);
+    }
+
+
     i = 0;
     groups = up.getGroups(Direction.DOWNGRADE);
     for (Grouping g : groups) {
       assertEquals(expected_down.get(i), g.name);
       i++;
     }
+
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc0078f8/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
index b4b6663..7590c5b 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
@@ -57,6 +57,7 @@
     <group name="SERVICE_CHECK_1" title="Post-Master Service Checks" xsi:type="service-check">
       <priority>
         <service>HDFS</service>
+        <service>HBASE</service>
         <service>YARN</service>
       </priority>
     </group>


Mime
View raw message