incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1177132 - in /incubator/ambari/trunk/agent/src/main/python/ambari_agent: ActionQueue.py Heartbeat.py
Date Thu, 29 Sep 2011 00:49:13 GMT
Author: eyang
Date: Thu Sep 29 00:49:12 2011
New Revision: 1177132

URL: http://svn.apache.org/viewvc?rev=1177132&view=rev
Log:
AMBARI-17. Added idle state check in agent heartbeat. (Eric Yang)

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

Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py?rev=1177132&r1=1177131&r2=1177132&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py Thu Sep 29 00:49:12
2011
@@ -123,3 +123,7 @@ class ActionQueue(threading.Thread):
     logger.error('Unknown action: %s' % action['id'])
     result = { 'id': action['id'] }
     return result
+
+  # Discover agent idle state
+  def isIdle(self):
+    return q.empty()

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=1177132&r1=1177131&r2=1177132&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 Thu Sep 29 00:49:12
2011
@@ -40,7 +40,8 @@ class Heartbeat:
                   'hostname' : socket.gethostname(),
                   'hardwareProfile' : hardware.get(),
                   'actionResults' : self.actionQueue.result(),
-                  'serversStatus' : serverStatus.build()
+                  'serversStatus' : serverStatus.build(),
+                  'idle' : self.actionQueue.isIdle()
                 }
     return heartbeat
 



Mime
View raw message