You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2012/10/04 01:18:32 UTC
svn commit: r1393810 - in /incubator/ambari/branches/AMBARI-666: ./
ambari-agent/src/main/python/ambari_agent/
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/
Author: mahadev
Date: Wed Oct 3 23:18:31 2012
New Revision: 1393810
URL: http://svn.apache.org/viewvc?rev=1393810&view=rev
Log:
AMBARI-801. Fix heartbeat message from the agent which is causing NPE at the server. (mahadev)
Modified:
incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Controller.py
incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.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=1393810&r1=1393809&r2=1393810&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Oct 3 23:18:31 2012
@@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes)
NEW FEATURES
+ AMBARI-801. Fix heartbeat message from the agent which is causing NPE at the
+ server. (mahadev)
+
AMBARI-778. Ensure data flows across all steps in installer wizard.
(Jaimin Jetly via yusaku)
Modified: incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Controller.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Controller.py?rev=1393810&r1=1393809&r2=1393810&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Controller.py (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Controller.py Wed Oct 3 23:18:31 2012
@@ -107,7 +107,8 @@ class Controller(threading.Thread):
try:
if retry==False:
data = json.dumps(self.heartbeat.build(id))
-
+ pass
+ logger.info("Sending HeartBeat " + pprint.pformat(data))
req = urllib2.Request(self.heartbeatUrl, data, {'Content-Type': 'application/json'})
logger.info(data)
Modified: incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Heartbeat.py?rev=1393810&r1=1393809&r2=1393810&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Heartbeat.py (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-agent/src/main/python/ambari_agent/Heartbeat.py Wed Oct 3 23:18:31 2012
@@ -39,11 +39,15 @@ class Heartbeat:
timestamp = int(time.time()*1000)
queueResult = self.actionQueue.result()
installedRoleStates = serverStatus.build()
+ nodeStatus = { "status" : "HEALTHY",
+ "cause" : "NONE"}
+
heartbeat = { 'responseId' : int(id),
'timestamp' : timestamp,
'hostname' : socket.gethostname(),
- 'reports' : self.reports,
- 'componentStatus' : self.componentStatus
+ # 'reports' : self.reports,
+ # 'componentStatus' : self.componentStatus,
+ 'nodeStatus' : nodeStatus
}
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java?rev=1393810&r1=1393809&r2=1393810&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java Wed Oct 3 23:18:31 2012
@@ -21,8 +21,13 @@ import java.util.List;
import org.apache.ambari.server.agent.ActionQueue;
import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.agent.rest.AgentResource;
import org.apache.ambari.server.state.live.Clusters;
import org.apache.ambari.server.utils.StageUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -38,7 +43,8 @@ public class ActionManager {
private final ActionDBAccessor db;
private final ActionQueue actionQueue;
private final Clusters fsm;
-
+ private static Logger LOG = LoggerFactory.getLogger(ActionManager.class);
+
@Inject
public ActionManager(@Named("schedulerSleeptime") long schedulerSleepTime,
@Named("actionTimeout") long actionTimeout,