ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [30/50] ambari git commit: AMBARI-14670 - Express Upgrade failed during restart of STORM components (jonathanhurley)
Date Fri, 15 Jan 2016 18:52:25 GMT
AMBARI-14670 - Express Upgrade failed during restart of STORM components (jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7d07b6bac86e67b24d471083ad2fafa9b2554940
Parents: 5289cb6
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Thu Jan 14 12:10:52 2016 -0500
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Thu Jan 14 13:18:14 2016 -0500

----------------------------------------------------------------------
 .../internal/UpgradeResourceProvider.java       | 12 ++++---
 .../ambari/server/state/stack/UpgradePack.java  | 14 ++++++--
 .../state/stack/upgrade/ConfigureTask.java      | 38 ++++++++++++++------
 .../ambari/server/state/stack/upgrade/Task.java |  9 +++++
 .../HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml |  1 +
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml |  7 ++++
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml     |  6 ++++
 7 files changed, 70 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/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 d0f226f..9fde9dd 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
@@ -769,7 +769,9 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     // Resolve or build a proper config upgrade pack
     List<UpgradePack.IntermediateStack> intermediateStacks = pack.getIntermediateStacks();
     ConfigUpgradePack configUpgradePack;
-    if (intermediateStacks == null || intermediateStacks.isEmpty()) { // No intermediate
stacks
+
+    // No intermediate stacks
+    if (intermediateStacks == null || intermediateStacks.isEmpty()) {
       configUpgradePack = s_metaProvider.get().getConfigUpgradePack(
               targetStackId.getStackName(), targetStackId.getStackVersion());
     } else {
@@ -1447,13 +1449,15 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
         if (null != configType) {
           itemDetail = String.format("Updating configuration %s", configType);
         } else {
-          itemDetail = "Skipping Configuration Task";
+          itemDetail = "Skipping Configuration Task "
+              + StringUtils.defaultString(ct.id, "(missing id)");
         }
 
         entity.setText(itemDetail);
 
-        if (null != ct.summary) {
-          stageText = ct.summary;
+        String configureTaskSummary = ct.getSummary(configUpgradePack);
+        if (null != configureTaskSummary) {
+          stageText = configureTaskSummary;
         } else {
           stageText = itemDetail;
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
index e3155ba..b860731 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
@@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlValue;
 
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.Grouping;
@@ -153,7 +154,16 @@ public class UpgradePack {
   }
 
   /**
-   * @return a list for intermediate stacks for cross-stack upgrade, or null if no any
+   * Gets a list of stacks which are between the current stack version and the
+   * target stack version inclusive. For example, if upgrading from HDP-2.2 to
+   * HDP-2.4, this should include HDP-2.3 and HDP-2.4.
+   * <p/>
+   * This method is used to combine the correct configuration packs for a
+   * specific upgrade from
+   * {@link AmbariMetaInfo#getConfigUpgradePack(String, String)}.
+   *
+   * @return a list of intermediate stacks (target stack inclusive) or
+   *         {@code null} if none.
    */
   public List<IntermediateStack> getIntermediateStacks() {
     return intermediateStacks;
@@ -188,7 +198,7 @@ public class UpgradePack {
   /**
    * Gets the groups defined for the upgrade pack. If a direction is defined for
    * a group, it must match the supplied direction to be returned
-   * 
+   *
    * @param direction
    *          the direction to return the ordered groups
    * @return the list of groups

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
index f196e0b..6b22f58 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
@@ -28,20 +28,20 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.ambari.server.state.stack.ConfigUpgradePack;
-import org.apache.commons.lang.StringUtils;
 import org.apache.ambari.server.serveraction.upgrades.ConfigureAction;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.DesiredConfig;
-
-import com.google.gson.Gson;
+import org.apache.ambari.server.state.stack.ConfigUpgradePack;
+import org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Condition;
+import org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.ConfigurationKeyValue;
+import org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Replace;
+import org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Transfer;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import static org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Transfer;
-import static org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Replace;
-import static org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Condition;
-import static org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.ConfigurationKeyValue;
+
+import com.google.gson.Gson;
 
 /**
  * The {@link ConfigureTask} represents a configuration change. This task
@@ -134,6 +134,22 @@ public class ConfigureTask extends ServerSideActionTask {
   }
 
   /**
+   * Gets the summary of the task or {@code null}.
+   *
+   * @return the task summary or {@code null}.
+   */
+  public String getSummary(ConfigUpgradePack configUpgradePack) {
+    if(StringUtils.isNotBlank(id) && null != configUpgradePack){
+      ConfigUpgradeChangeDefinition definition = configUpgradePack.enumerateConfigChangesByID().get(id);
+      if (null != definition && StringUtils.isNotBlank(definition.summary)) {
+          return definition.summary;
+      }
+    }
+
+    return super.getSummary();
+  }
+
+  /**
    * Gets a map containing the following properties pertaining to the
    * configuration value to change:
    * <ul>
@@ -158,7 +174,7 @@ public class ConfigureTask extends ServerSideActionTask {
                                                      ConfigUpgradePack configUpgradePack)
{
     Map<String, String> configParameters = new HashMap<>();
 
-    if (this.id == null || this.id.isEmpty()) {
+    if (id == null || id.isEmpty()) {
       LOG.warn("Config task id is not defined, skipping config change");
       return configParameters;
     }
@@ -169,10 +185,10 @@ public class ConfigureTask extends ServerSideActionTask {
     }
 
     // extract config change definition, referenced by current ConfigureTask
-    ConfigUpgradeChangeDefinition definition = configUpgradePack.enumerateConfigChangesByID().get(this.id);
+    ConfigUpgradeChangeDefinition definition = configUpgradePack.enumerateConfigChangesByID().get(id);
     if (definition == null) {
       LOG.warn(String.format("Can not resolve config change definition by id %s, " +
-              "skipping config change", this.id));
+              "skipping config change", id));
       return configParameters;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Task.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Task.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Task.java
index 60091a6..980f88e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Task.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Task.java
@@ -54,6 +54,15 @@ public abstract class Task {
   }
 
   /**
+   * Gets the summary of the task or {@code null}.
+   *
+   * @return the task summary or {@code null}.
+   */
+  public String getSummary() {
+    return summary;
+  }
+
+  /**
    * Identifies the type of task.
    */
   public enum Type {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
index ec95ef8..2cf9da9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
@@ -34,6 +34,7 @@
     </configuration>
   </prerequisite-checks>
 
+  <!-- Instructs the upgrade pack how to build the configuration pack -->
   <upgrade-path>
     <intermediate-stack version="2.2"/>
     <intermediate-stack version="2.3"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml
index 012c629..1efeb6c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml
@@ -29,6 +29,13 @@
       </check-properties>
     </configuration>
   </prerequisite-checks>
+
+  <!-- Instructs the upgrade pack how to build the configuration pack -->
+  <upgrade-path>
+    <intermediate-stack version="2.3"/>
+    <intermediate-stack version="2.4"/>
+  </upgrade-path>
+
   <order>
     <group xsi:type="cluster" name="PRE_CLUSTER" title="Prepare Upgrade">
       <direction>UPGRADE</direction>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d07b6ba/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
index 5aee69d..acebdd8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
@@ -43,6 +43,12 @@
     </configuration>
   </prerequisite-checks>
 
+  <!-- Instructs the upgrade pack how to build the configuration pack -->
+  <upgrade-path>
+    <intermediate-stack version="2.3"/>
+    <intermediate-stack version="2.4"/>
+  </upgrade-path>
+
   <skip-failures>false</skip-failures>
   <skip-service-check-failures>false</skip-service-check-failures>
 


Mime
View raw message