Commit a29f63a8 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Admin node handle answers to askPartitionTable and askNodeInformation into base

handler instead of monitoring handler for name consistency. 


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@884 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5203461f
......@@ -136,12 +136,25 @@ class MasterEventHandler(EventHandler):
EventHandler.peerBroken(self, conn)
def dispatch(self, conn, packet):
if self.app.dispatcher.registered(packet.getId()):
# answer to a request
if not packet.isResponse():
# not an answer
self.app.monitoring_handler.dispatch(conn, packet)
elif self.app.dispatcher.registered(packet.getId()):
# expected answer
self.app.request_handler.dispatch(conn, packet)
else:
# monitoring phase
self.app.monitoring_handler.dispatch(conn, packet)
# unexpectexd answer, this should be answerNodeInformation or
# answerPartitionTable from the master node during initialization.
# This will no more exists when the initialization module will be
# implemented for factorize code (as done for bootstrap)
EventHandler.dispatch(self, conn, packet)
def handleAnswerNodeInformation(self, conn, packet, node_list):
logging.info("handleAnswerNodeInformation")
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
logging.info("handleAnswerPartitionTable")
class MasterBaseEventHandler(EventHandler):
......@@ -250,12 +263,6 @@ class MasterRequestEventHandler(MasterBaseEventHandler):
class MasterMonitoringEventHandler(MasterBaseEventHandler):
"""This class deals with events for monitoring cluster."""
def handleAnswerNodeInformation(self, conn, packet, node_list):
logging.info("handleAnswerNodeInformation")
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
logging.info("handleAnswerPartitionTable")
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
app = self.app
nm = app.nm
......@@ -306,3 +313,4 @@ class MasterMonitoringEventHandler(MasterBaseEventHandler):
pt.setCell(offset, node, state)
pt.log()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment