incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1188971 - in /incubator/ambari/trunk: CHANGES.txt agent/src/main/python/ambari_agent/Heartbeat.py
Date Tue, 25 Oct 2011 23:37:02 GMT
Author: eyang
Date: Tue Oct 25 23:37:02 2011
New Revision: 1188971

URL: http://svn.apache.org/viewvc?rev=1188971&view=rev
Log:
AMBARI-102. Reduce heartbeat message content, when installedRoleState
is empty. (Eric Yang)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/agent/src/main/python/ambari_agent/Heartbeat.py

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1188971&r1=1188970&r2=1188971&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Oct 25 23:37:02 2011
@@ -2,6 +2,9 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-102. Reduce heartbeat message content, when installedRoleState
+  is empty. (Eric Yang)
+
   AMBARI-101. Remove clusterID and use cluster name as unique ID for the cluster(vgogate)
 
   AMBARI-100. Fixes the heartbeat to take into account install/uninstall 

Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/Heartbeat.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/Heartbeat.py?rev=1188971&r1=1188970&r2=1188971&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/Heartbeat.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/Heartbeat.py Tue Oct 25 23:37:02
2011
@@ -35,14 +35,18 @@ class Heartbeat:
     global clusterId, clusterDefinitionRevision
     serverStatus = ServerStatus()
     timestamp = int(time.time()*1000)
+    queueResult = self.actionQueue.result()
+    installedRoleStates = serverStatus.build()
     heartbeat = { 'responseId'          : int(id),
                   'timestamp'           : timestamp,
                   'hostname'            : socket.gethostname(),
                   'hardwareProfile'     : self.hardware.get(),
-                  'actionResults'       : self.actionQueue.result(),
-                  'installedRoleStates' : serverStatus.build(),
                   'idle'                : self.actionQueue.isIdle()
                 }
+    if len(queueResult)!=0:
+      heartbeat['actionResults'] = queueResult
+    if len(installedRoleStates)!=0:
+      heartbeat['installedRoleStates'] = installedRoleStates
     return heartbeat
 
 def main(argv=None):



Mime
View raw message