You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by hi...@apache.org on 2012/10/10 04:27:20 UTC

svn commit: r1396448 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-server/src/main/java/org/apache/ambari/server/controller/ ambari-server/src/main/java/org/apache/ambari/server/state/ ambari-server/src/main/java/org/apache/ambari/server/state/...

Author: hitesh
Date: Wed Oct 10 02:27:20 2012
New Revision: 1396448

URL: http://svn.apache.org/viewvc?rev=1396448&view=rev
Log:
AMBARI-842. Fix null point exception during adding of hosts to cluster. (Contributed by hitesh)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
    incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1396448&r1=1396447&r2=1396448&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Oct 10 02:27:20 2012
@@ -227,6 +227,8 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-842. Fix null point exception during adding of hosts to cluster. (hitesh)
+
   AMBARI-839. Temporary fix for server start order. (hitesh)
 
   AMBARI-837. Fix basic injection issues for controller impl. (hitesh)

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1396448&r1=1396447&r2=1396448&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java Wed Oct 10 02:27:20 2012
@@ -43,6 +43,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
+import com.google.inject.Singleton;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -52,6 +53,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 
+@Singleton
 public class AmbariManagementControllerImpl implements
     AmbariManagementController {
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java?rev=1396448&r1=1396447&r2=1396448&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java Wed Oct 10 02:27:20 2012
@@ -146,7 +146,7 @@ public class ServiceComponentImpl implem
   @Override
   public synchronized void setDesiredState(State state) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting DesiredState of Service"
+      LOG.debug("Setting DesiredState of ServiceComponent"
           + ", clusterName=" + service.getCluster().getClusterName()
           + ", clusterId=" + service.getCluster().getClusterId()
           + ", serviceName=" + service.getName()
@@ -175,7 +175,7 @@ public class ServiceComponentImpl implem
   @Override
   public synchronized void setDesiredStackVersion(StackVersion stackVersion) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting DesiredStackVersion of Service"
+      LOG.debug("Setting DesiredStackVersion of ServiceComponent"
           + ", clusterName=" + service.getCluster().getClusterName()
           + ", clusterId=" + service.getCluster().getClusterId()
           + ", serviceName=" + service.getName()

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java?rev=1396448&r1=1396447&r2=1396448&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java Wed Oct 10 02:27:20 2012
@@ -19,7 +19,9 @@
 
 package org.apache.ambari.server.state.host;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.locks.Lock;
@@ -218,6 +220,20 @@ public class HostImpl implements Host {
     this.readLock = rwLock.readLock();
     this.writeLock = rwLock.writeLock();
     this.healthStatus = new HostHealthStatus(HealthStatus.UNKNOWN, "");
+    this.ipv4 = "";
+    this.ipv6 = "";
+    this.cpuCount = 0;
+    this.osArch = "";
+    this.osType = "";
+    this.osInfo = "";
+    this.availableMemBytes = 0;
+    this.totalMemBytes = 0;
+    this.disksInfo = new ArrayList<DiskInfo>();
+    this.lastHeartbeatTime = 0;
+    this.lastRegistrationTime = 0;
+    this.rackInfo = "";
+    this.hostAttributes = new HashMap<String, String>();
+    this.agentVersion = new AgentVersion("");
   }
 
   static class HostRegistrationReceived

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java?rev=1396448&r1=1396447&r2=1396448&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java Wed Oct 10 02:27:20 2012
@@ -47,6 +47,8 @@ public class ServiceComponentHostImpl im
   private static final Logger LOG =
       LoggerFactory.getLogger(ServiceComponentHostImpl.class);
 
+  // FIXME need more debug logs
+
   private final Lock readLock;
   private final Lock writeLock;