ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [2/2] ambari git commit: AMBARI-14014. Pre-upgrade checks sometimes fail with NullPointerException (dlysnichenko)
Date Tue, 24 Nov 2015 12:02:10 GMT
AMBARI-14014. Pre-upgrade checks sometimes fail with NullPointerException (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: 408edebabaa000c7a5aaa2b68ea474f4da00b8da
Parents: 09826ec
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Tue Nov 24 14:00:25 2015 +0200
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Tue Nov 24 14:02:15 2015 +0200

----------------------------------------------------------------------
 .../apache/ambari/server/state/stack/UpgradePack.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/408edeba/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 bee219a..ab8f53d 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
@@ -40,6 +40,8 @@ import org.apache.ambari.server.state.stack.upgrade.Grouping;
 import org.apache.ambari.server.state.stack.upgrade.ServiceCheckGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Represents an upgrade pack.
@@ -48,6 +50,8 @@ import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class UpgradePack {
 
+  private static Logger LOG = LoggerFactory.getLogger(UpgradePack.class);
+
   /**
    * Name of the file without the extension, such as upgrade-2.2
    */
@@ -314,7 +318,12 @@ public class UpgradePack {
           Map<String, ProcessingComponent> componentMap = m_process.get(svc.name);
 
           for (ProcessingComponent pc : svc.components) {
-            componentMap.put(pc.name, pc);
+            if (pc != null) {
+              componentMap.put(pc.name, pc);
+            } else {
+              LOG.warn("ProcessingService {} has null amongst it's values " +
+                "(total {} components)", svc.name, svc.components.size());
+            }
           }
         }
       }


Mime
View raw message