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

Because the purpose of an handler is to *handle* (packets), remove the 'handle'

prefix from everywhere.


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1350 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a53b51dd
......@@ -25,7 +25,7 @@ from neo.util import dump
class AdminEventHandler(EventHandler):
"""This class deals with events for administrating cluster."""
def handleAskPartitionList(self, conn, packet, min_offset, max_offset, uuid):
def askPartitionList(self, conn, packet, min_offset, max_offset, uuid):
logging.info("ask partition list from %s to %s for %s" %(min_offset, max_offset, dump(uuid)))
app = self.app
# check we have one pt otherwise ask it to PMN
......@@ -43,7 +43,7 @@ class AdminEventHandler(EventHandler):
app.sendPartitionTable(conn, min_offset, max_offset, uuid, packet.getId())
def handleAskNodeList(self, conn, packet, node_type):
def askNodeList(self, conn, packet, node_type):
logging.info("ask node list for %s" %(node_type))
def node_filter(n):
return n.getType() is node_type
......@@ -52,7 +52,7 @@ class AdminEventHandler(EventHandler):
p = protocol.answerNodeList(node_information_list)
conn.answer(p, packet.getId())
def handleSetNodeState(self, conn, packet, uuid, state, modify_partition_table):
def setNodeState(self, conn, packet, uuid, state, modify_partition_table):
logging.info("set node state for %s-%s" %(dump(uuid), state))
node = self.app.nm.getByUUID(uuid)
if node is None:
......@@ -69,7 +69,7 @@ class AdminEventHandler(EventHandler):
msg_id = self.app.master_conn.ask(p)
self.app.dispatcher.register(msg_id, conn, {'msg_id' : packet.getId()})
def handleSetClusterState(self, conn, packet, state):
def setClusterState(self, conn, packet, state):
# forward to primary
if self.app.master_conn is None:
raise protocol.NotReadyError('Not connected to a primary master.')
......@@ -77,7 +77,7 @@ class AdminEventHandler(EventHandler):
msg_id = self.app.master_conn.ask(p)
self.app.dispatcher.register(msg_id, conn, {'msg_id' : packet.getId()})
def handleAddPendingNodes(self, conn, packet, uuid_list):
def addPendingNodes(self, conn, packet, uuid_list):
if self.app.master_conn is None:
raise protocol.NotReadyError('Not connected to a primary master.')
logging.info('Add nodes %s' % [dump(uuid) for uuid in uuid_list])
......@@ -85,7 +85,7 @@ class AdminEventHandler(EventHandler):
msg_id = self.app.master_conn.ask(protocol.addPendingNodes(uuid_list))
self.app.dispatcher.register(msg_id, conn, {'msg_id' : packet.getId()})
def handleAskClusterState(self, conn, packet):
def askClusterState(self, conn, packet):
if self.app.cluster_state is None:
if self.app.master_conn is None:
raise protocol.NotReadyError('Not connected to a primary master.')
......@@ -96,7 +96,7 @@ class AdminEventHandler(EventHandler):
conn.answer(protocol.answerClusterState(self.app.cluster_state),
packet.getId())
def handleAskPrimaryMaster(self, conn, packet):
def askPrimaryMaster(self, conn, packet):
if self.app.master_conn is None:
raise protocol.NotReadyError('Not connected to a primary master.')
master_node = self.app.master_node
......@@ -135,17 +135,17 @@ class MasterEventHandler(EventHandler):
# unexpectexd answers and notifications
super(MasterEventHandler, self).dispatch(conn, packet)
def handleAnswerNodeInformation(self, conn, packet, node_list):
def answerNodeInformation(self, conn, packet, node_list):
# XXX: This will no more exists when the initialization module will be
# implemented for factorize code (as done for bootstrap)
logging.debug("handleAnswerNodeInformation")
logging.debug("answerNodeInformation")
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
def answerPartitionTable(self, conn, packet, ptid, row_list):
# XXX: This will no more exists when the initialization module will be
# implemented for factorize code (as done for bootstrap)
logging.debug("handleAnswerPartitionTable")
logging.debug("answerPartitionTable")
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
def notifyPartitionChanges(self, conn, packet, ptid, cell_list):
app = self.app
if ptid < app.ptid:
# Ignore this packet.
......@@ -153,7 +153,7 @@ class MasterEventHandler(EventHandler):
app.ptid = ptid
app.pt.update(ptid, cell_list, app.nm)
def handleSendPartitionTable(self, conn, packet, ptid, row_list):
def sendPartitionTable(self, conn, packet, ptid, row_list):
uuid = conn.getUUID()
app = self.app
nm = app.nm
......@@ -170,10 +170,10 @@ class MasterEventHandler(EventHandler):
pt.setCell(offset, node, state)
pt.log()
def handleNotifyClusterInformation(self, conn, packet, cluster_state):
def notifyClusterInformation(self, conn, packet, cluster_state):
self.app.cluster_state = cluster_state
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
app = self.app
app.nm.update(node_list)
if not app.pt.filled():
......@@ -189,30 +189,30 @@ class MasterRequestEventHandler(EventHandler):
client_conn, kw = self.app.dispatcher.pop(msg_id)
client_conn.answer(packet, kw['msg_id'])
def handleAnswerClusterState(self, conn, packet, state):
logging.info("handleAnswerClusterState for a conn")
def answerClusterState(self, conn, packet, state):
logging.info("answerClusterState for a conn")
self.app.cluster_state = state
self.__answerNeoCTL(packet.getId(),
protocol.answerClusterState(state))
def handleAnswerNewNodes(self, conn, packet, uuid_list):
logging.info("handleAnswerNewNodes for a conn")
def answerNewNodes(self, conn, packet, uuid_list):
logging.info("answerNewNodes for a conn")
self.__answerNeoCTL(packet.getId(),
protocol.answerNewNodes(uuid_list))
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
logging.info("handleAnswerPartitionTable for a conn")
def answerPartitionTable(self, conn, packet, ptid, row_list):
logging.info("answerPartitionTable for a conn")
client_conn, kw = self.app.dispatcher.pop(packet.getId())
# sent client the partition table
self.app.sendPartitionTable(client_conn, **kw)
def handleAnswerNodeState(self, conn, packet, uuid, state):
def answerNodeState(self, conn, packet, uuid, state):
self.__answerNeoCTL(packet.getId(),
protocol.answerNodeState(uuid, state))
def handleNoError(self, conn, packet, msg):
def noError(self, conn, packet, msg):
self.__answerNeoCTL(packet.getId(), protocol.noError(msg))
def handleProtocolError(self, conn, packet, msg):
def protocolError(self, conn, packet, msg):
self.__answerNeoCTL(packet.getId(), protocol.protocolError(msg))
......@@ -52,12 +52,12 @@ class BootstrapManager(EventHandler):
def connectionLost(self, conn, new_state):
self.current = None
def handleNotReady(self, conn, packet, message):
def notReady(self, conn, packet, message):
# master are still electing on of them
self.current = None
conn.close()
def handleAnswerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
def answerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
nm = self.app.nm
# Register new master nodes.
......@@ -81,7 +81,7 @@ class BootstrapManager(EventHandler):
conn.ask(protocol.requestNodeIdentification(self.node_type,
self.uuid, self.server, self.name))
def handleAcceptNodeIdentification(self, conn, packet, node_type,
def acceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions, num_replicas, your_uuid):
self.num_partitions = num_partitions
self.num_replicas = num_replicas
......
......@@ -25,12 +25,12 @@ from neo.util import dump
class PrimaryBootstrapHandler(AnswerBaseHandler):
""" Bootstrap handler used when looking for the primary master """
def handleNotReady(self, conn, packet, message):
def notReady(self, conn, packet, message):
app = self.app
app.trying_master_node = None
app.setNodeNotReady()
def handleAcceptNodeIdentification(self, conn, packet, node_type,
def acceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions, num_replicas, your_uuid):
app = self.app
node = app.nm.getByAddress(conn.getAddress())
......@@ -57,7 +57,7 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
# Always create partition table
app.pt = PartitionTable(num_partitions, num_replicas)
def handleAnswerPrimaryMaster(self, conn, packet, primary_uuid,
def answerPrimaryMaster(self, conn, packet, primary_uuid,
known_master_list):
app = self.app
# Register new master nodes.
......@@ -92,10 +92,10 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
app.trying_master_node = None
conn.close()
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
def answerPartitionTable(self, conn, packet, ptid, row_list):
pass
def handleAnswerNodeInformation(self, conn, packet, node_list):
def answerNodeInformation(self, conn, packet, node_list):
pass
class PrimaryNotificationsHandler(BaseHandler):
......@@ -126,10 +126,10 @@ class PrimaryNotificationsHandler(BaseHandler):
logging.critical("primary master node is broken")
BaseHandler.peerBroken(self, conn)
def handleStopOperation(self, conn, packet):
def stopOperation(self, conn, packet):
logging.critical("master node ask to stop operation")
def handleInvalidateObjects(self, conn, packet, oid_list, tid):
def invalidateObjects(self, conn, packet, oid_list, tid):
app = self.app
app._cache_lock_acquire()
try:
......@@ -151,15 +151,15 @@ class PrimaryNotificationsHandler(BaseHandler):
# to avoid a dead lock. It is safe to not check the master connection
# because it's in the master handler, so the connection is already
# established.
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
def notifyPartitionChanges(self, conn, packet, ptid, cell_list):
pt = self.app.pt
if pt.filled():
pt.update(ptid, cell_list, self.app.nm)
def handleSendPartitionTable(self, conn, packet, ptid, row_list):
def sendPartitionTable(self, conn, packet, ptid, row_list):
self.app.pt.load(ptid, row_list, self.app.nm)
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
app = self.app
self.app.nm.update(node_list)
for node_type, addr, uuid, state in node_list:
......@@ -178,16 +178,16 @@ class PrimaryNotificationsHandler(BaseHandler):
class PrimaryAnswersHandler(AnswerBaseHandler):
""" Handle that process expected packets from the primary master """
def handleAnswerBeginTransaction(self, conn, packet, tid):
def answerBeginTransaction(self, conn, packet, tid):
app = self.app
app.setTID(tid)
def handleAnswerNewOIDs(self, conn, packet, oid_list):
def answerNewOIDs(self, conn, packet, oid_list):
app = self.app
app.new_oid_list = oid_list
app.new_oid_list.reverse()
def handleNotifyTransactionFinished(self, conn, packet, tid):
def notifyTransactionFinished(self, conn, packet, tid):
app = self.app
if tid == app.getTID():
app.setTransactionFinished()
......
......@@ -48,11 +48,11 @@ class StorageEventHandler(BaseHandler):
class StorageBootstrapHandler(AnswerBaseHandler):
""" Handler used when connecting to a storage node """
def handleNotReady(self, conn, packet, message):
def notReady(self, conn, packet, message):
app = self.app
app.setNodeNotReady()
def handleAcceptNodeIdentification(self, conn, packet, node_type,
def acceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions, num_replicas, your_uuid):
app = self.app
node = app.nm.getByAddress(conn.getAddress())
......@@ -75,24 +75,24 @@ class StorageBootstrapHandler(AnswerBaseHandler):
class StorageAnswersHandler(AnswerBaseHandler):
""" Handle all messages related to ZODB operations """
def handleAnswerObject(self, conn, packet, oid, start_serial, end_serial,
def answerObject(self, conn, packet, oid, start_serial, end_serial,
compression, checksum, data):
app = self.app
app.local_var.asked_object = (oid, start_serial, end_serial, compression,
checksum, data)
def handleAnswerStoreObject(self, conn, packet, conflicting, oid, serial):
def answerStoreObject(self, conn, packet, conflicting, oid, serial):
app = self.app
if conflicting:
app.local_var.object_stored = -1, serial
else:
app.local_var.object_stored = oid, serial
def handleAnswerStoreTransaction(self, conn, packet, tid):
def answerStoreTransaction(self, conn, packet, tid):
app = self.app
app.setTransactionVoted()
def handleAnswerTransactionInformation(self, conn, packet, tid,
def answerTransactionInformation(self, conn, packet, tid,
user, desc, ext, oid_list):
app = self.app
# transaction information are returned as a dict
......@@ -104,12 +104,12 @@ class StorageAnswersHandler(AnswerBaseHandler):
info['oids'] = oid_list
app.local_var.txn_info = info
def handleAnswerObjectHistory(self, conn, packet, oid, history_list):
def answerObjectHistory(self, conn, packet, oid, history_list):
app = self.app
# history_list is a list of tuple (serial, size)
app.local_var.history = oid, history_list
def handleOidNotFound(self, conn, packet, message):
def oidNotFound(self, conn, packet, message):
app = self.app
# This can happen either when :
# - loading an object
......@@ -117,12 +117,12 @@ class StorageAnswersHandler(AnswerBaseHandler):
app.local_var.asked_object = -1
app.local_var.history = -1
def handleTidNotFound(self, conn, packet, message):
def tidNotFound(self, conn, packet, message):
app = self.app
# This can happen when requiring txn informations
app.local_var.txn_info = -1
def handleAnswerTIDs(self, conn, packet, tid_list):
def answerTIDs(self, conn, packet, tid_list):
app = self.app
app.local_var.node_tids[conn.getUUID()] = tid_list
This diff is collapsed.
......@@ -24,10 +24,10 @@ from neo.protocol import NodeTypes, NodeStates
class MasterHandler(EventHandler):
"""This class implements a generic part of the event handlers."""
def handleProtocolError(self, conn, packet, message):
def protocolError(self, conn, packet, message):
logging.error('Protocol error %s %s' % (message, conn.getAddress()))
def handleAskPrimaryMaster(self, conn, packet):
def askPrimaryMaster(self, conn, packet):
if conn.getConnector() is None:
# Connection can be closed by peer after he sent AskPrimaryMaster
# if he finds the primary master before we answer him.
......@@ -54,16 +54,16 @@ class MasterHandler(EventHandler):
packet.getId(),
)
def handleAskClusterState(self, conn, packet):
def askClusterState(self, conn, packet):
assert conn.getUUID() is not None
state = self.app.getClusterState()
conn.answer(protocol.answerClusterState(state), packet.getId())
def handleAskNodeInformation(self, conn, packet):
def askNodeInformation(self, conn, packet):
self.app.sendNodesInformations(conn)
conn.answer(protocol.answerNodeInformation([]), packet.getId())
def handleAskPartitionTable(self, conn, packet, offset_list):
def askPartitionTable(self, conn, packet, offset_list):
assert len(offset_list) == 0
app = self.app
app.sendPartitionTable(conn)
......@@ -78,7 +78,7 @@ DISCONNECTED_STATE_DICT = {
class BaseServiceHandler(MasterHandler):
"""This class deals with events for a service phase."""
def handleNodeLost(self, conn, node):
def nodeLost(self, conn, node):
# This method provides a hook point overridable by service classes.
# It is triggered when a connection to a node gets lost.
pass
......@@ -98,13 +98,13 @@ class BaseServiceHandler(MasterHandler):
node.setState(new_state)
self.app.broadcastNodeInformation(node)
# clean node related data in specialized handlers
self.handleNodeLost(conn, node)
self.nodeLost(conn, node)
def handleAskLastIDs(self, conn, packet):
def askLastIDs(self, conn, packet):
app = self.app
conn.answer(protocol.answerLastIDs(app.loid, app.ltid, app.pt.getID()), packet.getId())
def handleAskUnfinishedTransactions(self, conn, packet):
def askUnfinishedTransactions(self, conn, packet):
app = self.app
p = protocol.answerUnfinishedTransactions(app.finishing_transaction_dict.keys())
conn.answer(p, packet.getId())
......
......@@ -29,12 +29,12 @@ class AdministrationHandler(MasterHandler):
node = self.app.nm.getByUUID(conn.getUUID())
self.app.nm.remove(node)
def handleAskPrimaryMaster(self, conn, packet):
def askPrimaryMaster(self, conn, packet):
app = self.app
# I'm the primary
conn.answer(protocol.answerPrimaryMaster(app.uuid, []), packet.getId())
def handleSetClusterState(self, conn, packet, state):
def setClusterState(self, conn, packet, state):
self.app.changeClusterState(state)
p = protocol.noError('cluster state changed')
conn.answer(p, packet.getId())
......@@ -42,7 +42,7 @@ class AdministrationHandler(MasterHandler):
self.app.cluster_state = state
self.app.shutdown()
def handleSetNodeState(self, conn, packet, uuid, state, modify_partition_table):
def setNodeState(self, conn, packet, uuid, state, modify_partition_table):
logging.info("set node state for %s-%s : %s" % (dump(uuid), state, modify_partition_table))
app = self.app
node = app.nm.getByUUID(uuid)
......@@ -92,7 +92,7 @@ class AdministrationHandler(MasterHandler):
conn.answer(p, packet.getId())
app.broadcastNodeInformation(node)
def handleAddPendingNodes(self, conn, packet, uuid_list):
def addPendingNodes(self, conn, packet, uuid_list):
uuids = ', '.join([dump(uuid) for uuid in uuid_list])
logging.debug('Add nodes %s' % uuids)
app, nm, em, pt = self.app, self.app.nm, self.app.em, self.app.pt
......
......@@ -68,19 +68,19 @@ class ClientServiceHandler(BaseServiceHandler):
def connectionCompleted(self, conn):
pass
def handleNodeLost(self, conn, node):
def nodeLost(self, conn, node):
app = self.app
for tid, t in app.finishing_transaction_dict.items():
if t.getConnection() is conn:
del app.finishing_transaction_dict[tid]
def handleAbortTransaction(self, conn, packet, tid):
def abortTransaction(self, conn, packet, tid):
try:
del self.app.finishing_transaction_dict[tid]
except KeyError:
logging.warn('aborting transaction %s does not exist', dump(tid))
def handleAskBeginTransaction(self, conn, packet, tid):
def askBeginTransaction(self, conn, packet, tid):
app = self.app
if tid is not None and tid < app.ltid:
# supplied TID is in the past
......@@ -92,11 +92,11 @@ class ClientServiceHandler(BaseServiceHandler):
app.finishing_transaction_dict[tid] = FinishingTransaction(conn)
conn.answer(protocol.answerBeginTransaction(tid), packet.getId())
def handleAskNewOIDs(self, conn, packet, num_oids):
def askNewOIDs(self, conn, packet, num_oids):
oid_list = self.app.getNewOIDList(num_oids)
conn.answer(protocol.answerNewOIDs(oid_list), packet.getId())
def handleFinishTransaction(self, conn, packet, oid_list, tid):
def finishTransaction(self, conn, packet, oid_list, tid):
app = self.app
# If the given transaction ID is later than the last TID, the peer
# is crazy.
......
......@@ -25,7 +25,7 @@ from neo.exception import ElectionFailure
class ElectionHandler(MasterHandler):
"""This class deals with events for a primary master election."""
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
uuid = conn.getUUID()
if uuid is None:
raise protocol.UnexpectedPacketError
......@@ -110,7 +110,7 @@ class ClientElectionHandler(ElectionHandler):
app.negotiating_master_node_set.discard(addr)
MasterHandler.peerBroken(self, conn)
def handleAcceptNodeIdentification(self, conn, packet, node_type,
def acceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions,
num_replicas, your_uuid):
app = self.app
......@@ -146,7 +146,7 @@ class ClientElectionHandler(ElectionHandler):
app.negotiating_master_node_set.discard(conn.getAddress())
def handleAnswerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
def answerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
if conn.getConnector() is None:
# Connection can be closed by peer after he sent
# AnswerPrimaryMaster if he finds the primary master before we
......@@ -208,7 +208,7 @@ class ClientElectionHandler(ElectionHandler):
class ServerElectionHandler(ElectionHandler):
def handleReelectPrimaryMaster(self, conn, packet):
def reelectPrimaryMaster(self, conn, packet):
raise ElectionFailure, 'reelection requested'
def peerBroken(self, conn):
......@@ -219,7 +219,7 @@ class ServerElectionHandler(ElectionHandler):
node.setBroken()
MasterHandler.peerBroken(self, conn)
def handleRequestNodeIdentification(self, conn, packet, node_type,
def requestNodeIdentification(self, conn, packet, node_type,
uuid, address, name):
if conn.getConnector() is None:
# Connection can be closed by peer after he sent
......@@ -260,7 +260,7 @@ class ServerElectionHandler(ElectionHandler):
)
conn.answer(p, packet.getId())
def handleAnnouncePrimaryMaster(self, conn, packet):
def announcePrimaryMaster(self, conn, packet):
uuid = conn.getUUID()
if uuid is None:
raise protocol.UnexpectedPacketError
......
......@@ -24,10 +24,10 @@ from neo.master.handlers import MasterHandler
class IdentificationHandler(MasterHandler):
"""This class deals with messages from the admin node only"""
def handleNodeLost(self, conn, node):
def nodeLost(self, conn, node):
logging.warning('lost a node in IdentificationHandler : %s' % node)
def handleRequestNodeIdentification(self, conn, packet, node_type,
def requestNodeIdentification(self, conn, packet, node_type,
uuid, address, name):
self.checkClusterName(name)
......
......@@ -28,7 +28,7 @@ class RecoveryHandler(MasterHandler):
# ask the last IDs to perform the recovery
conn.ask(protocol.askLastIDs())
def handleAnswerLastIDs(self, conn, packet, loid, ltid, lptid):
def answerLastIDs(self, conn, packet, loid, ltid, lptid):
app = self.app
pt = app.pt
......@@ -41,7 +41,7 @@ class RecoveryHandler(MasterHandler):
app.pt.setID(lptid)
conn.ask(protocol.askPartitionTable([]))
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
def answerPartitionTable(self, conn, packet, ptid, row_list):
uuid = conn.getUUID()
app = self.app
if uuid != app.target_uuid:
......
......@@ -34,13 +34,13 @@ class SecondaryMasterHandler(MasterHandler):
def connectionCompleted(self, conn):
pass
def handleAnnouncePrimaryMaster(self, conn, packet):
def announcePrimaryMaster(self, conn, packet):
raise ElectionFailure, 'another primary arises'
def handleReelectPrimaryMaster(self, conn, packet):
def reelectPrimaryMaster(self, conn, packet):
raise ElectionFailure, 'reelection requested'
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
logging.error('/!\ NotifyNodeInformation packet from secondary master')
......@@ -58,13 +58,13 @@ class PrimaryMasterHandler(MasterHandler):
self.app.primary_master_node.setDown()
raise PrimaryFailure, 'primary master is dead'
def handleAnnouncePrimaryMaster(self, conn, packet):
def announcePrimaryMaster(self, conn, packet):
raise protocol.UnexpectedPacketError
def handleReelectPrimaryMaster(self, conn, packet):
def reelectPrimaryMaster(self, conn, packet):
raise ElectionFailure, 'reelection requested'
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
app = self.app
for node_type, addr, uuid, state in node_list:
if node_type != NodeTypes.MASTER:
......@@ -86,7 +86,7 @@ class PrimaryMasterHandler(MasterHandler):
if n.getUUID() is None:
n.setUUID(uuid)
def handleAcceptNodeIdentification(self, conn, packet, node_type,
def acceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions,
num_replicas, your_uuid):
app = self.app
......@@ -101,8 +101,8 @@ class PrimaryMasterHandler(MasterHandler):
conn.setUUID(uuid)
node.setUUID(uuid)
def handleAnswerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
def answerPrimaryMaster(self, conn, packet, primary_uuid, known_master_list):
pass
def handleNotifyClusterInformation(self, conn, packet, state):
def notifyClusterInformation(self, conn, packet, state):
pass
......@@ -22,20 +22,20 @@ from neo.master.handlers import BaseServiceHandler
class ShutdownHandler(BaseServiceHandler):
"""This class deals with events for a shutting down phase."""
def handleRequestNodeIdentification(self, conn, packet, node_type,
def requestNodeIdentification(self, conn, packet, node_type,
uuid, address, name):
logging.error('reject any new connection')
raise protocol.ProtocolError('cluster is shutting down')
def handleAskPrimaryMaster(self, conn, packet):
def askPrimaryMaster(self, conn, packet):
logging.error('reject any new demand for primary master')
raise protocol.ProtocolError('cluster is shutting down')
def handleAskBeginTransaction(self, conn, packet, tid):
def askBeginTransaction(self, conn, packet, tid):
logging.error('reject any new demand for new tid')
raise protocol.ProtocolError('cluster is shutting down')
def handleNotifyNodeInformation(self, conn, packet, node_list):
def notifyNodeInformation(self, conn, packet, node_list):
# don't care about notifications since we are shutdowning
pass
......@@ -34,7 +34,7 @@ class StorageServiceHandler(BaseServiceHandler):
conn.notify(protocol.notifyLastOID(self.app.loid))
conn.notify(protocol.startOperation())
def handleNodeLost(self, conn, node):
def nodeLost(self, conn, node):
logging.info('storage node lost')
if not self.app.pt.operational():
raise OperationFailure, 'cannot continue operation'
......@@ -42,7 +42,7 @@ class StorageServiceHandler(BaseServiceHandler):
# partition must not oudated to allows a cluster restart.
self.app.outdateAndBroadcastPartition()
def handleNotifyInformationLocked(self, conn, packet, tid):
def notifyInformationLocked(self, conn, packet, tid):
uuid = conn.getUUID()
app = self.app
node = app.nm.getByUUID(uuid)
......@@ -80,7 +80,7 @@ class StorageServiceHandler(BaseServiceHandler):
# What is this?
pass
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
def notifyPartitionChanges(self, conn, packet, ptid, cell_list):
# This should be sent when a cell becomes up-to-date because
# a replication has finished.
uuid = conn.getUUID()
......
......@@ -27,18 +27,18 @@ class VerificationHandler(MasterHandler):
def connectionCompleted(self, conn):
pass
def handleNodeLost(self, conn, node):
def nodeLost(self, conn, node):
if not self.app.pt.operational():
raise VerificationFailure, 'cannot continue verification'
def handleAnswerLastIDs(self, conn, packet, loid, ltid, lptid):
def answerLastIDs(self, conn, packet, loid, ltid, lptid):
app = self.app
# If I get a bigger value here, it is dangerous.
if app.loid < loid or app.ltid < ltid or app.pt.getID() < lptid:
logging.critical('got later information in verification')
raise VerificationFailure
def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list):
def answerUnfinishedTransactions(self, conn, packet, tid_list):
uuid = conn.getUUID()
logging.info('got unfinished transactions %s from %s:%d',
tid_list, *(conn.getAddress()))
......@@ -49,7 +49,7 @@ class VerificationHandler(MasterHandler):
app.unfinished_tid_set.update(tid_list)
app.asking_uuid_dict[uuid] = True
def handleAnswerTransactionInformation(self, conn, packet, tid,
def answerTransactionInformation(self, conn, packet, tid,
user, desc, ext, oid_list):
uuid = conn.getUUID()
app = self.app
......@@ -67,7 +67,7 @@ class VerificationHandler(MasterHandler):
app.unfinished_oid_set = None
app.asking_uuid_dict[uuid] = True
def handleTidNotFound(self, conn, packet, message):
def tidNotFound(self, conn, packet, message):
uuid = conn.getUUID()
logging.info('TID not found: %s', message)
app = self.app
......@@ -77,7 +77,7 @@ class VerificationHandler(MasterHandler):
app.unfinished_oid_set = None
app.asking_uuid_dict[uuid] = True
def handleAnswerObjectPresent(self, conn, packet, oid, tid):
def answerObjectPresent(self, conn, packet, oid, tid):
uuid = conn.getUUID()
logging.info('object %s:%s found', dump(oid), dump(tid))
app = self.app
......@@ -86,7 +86,7 @@ class VerificationHandler(MasterHandler):
return
app.asking_uuid_dict