Commit 0a511052 authored by Julien Muchembled's avatar Julien Muchembled

storage: code simplication, dead code removal

parent 900d4908
......@@ -76,8 +76,6 @@ class Application(object):
# ready is True when operational and got all informations
self.ready = False
self.has_node_information = False
self.has_partition_table = False
self.dm.setup(reset=config.getReset())
self.loadConfiguration()
......@@ -278,15 +276,11 @@ class Application(object):
self.master_conn.setHandler(handler)
# ask node list and partition table
self.has_node_information = False
self.has_partition_table = False
self.has_last_ids = False
self.pt.clear()
self.master_conn.ask(Packets.AskLastIDs())
self.master_conn.ask(Packets.AskNodeInformation())
self.master_conn.ask(Packets.AskPartitionTable())
while not self.has_node_information or not self.has_partition_table \
or not self.has_last_ids:
while self.master_conn.isPending():
_poll()
self.ready = True
self.replicator.populate()
......
......@@ -23,7 +23,7 @@ from neo.lib import protocol
class InitializationHandler(BaseMasterHandler):
def answerNodeInformation(self, conn):
self.app.has_node_information = True
pass
def notifyNodeInformation(self, conn, node_list):
# the whole node list is received here
......@@ -53,11 +53,9 @@ class InitializationHandler(BaseMasterHandler):
app.dm.dropPartitions(num_partitions, unassigned_set)
app.dm.setPartitionTable(ptid, cell_list)
self.app.has_partition_table = True
def answerLastIDs(self, conn, loid, ltid, lptid):
self.app.dm.setLastOID(loid)
self.app.has_last_ids = True
def notifyPartitionChanges(self, conn, ptid, cell_list):
# XXX: This is safe to ignore those notifications because all of the
......
......@@ -24,9 +24,6 @@ from . import BaseMasterHandler
class MasterOperationHandler(BaseMasterHandler):
""" This handler is used for the primary master """
def answerLastIDs(self, conn, loid, ltid, lptid):
self.app.replicator.setCriticalTID(ltid)
def answerUnfinishedTransactions(self, conn, max_tid, ttid_list):
self.app.replicator.setUnfinishedTIDList(max_tid, ttid_list)
......
......@@ -164,20 +164,6 @@ class StorageMasterHandlerTests(NeoUnitTestBase):
calls[0].checkArgs(tid)
self.checkNoPacketSent(conn)
def test_30_answerLastIDs(self):
# set critical TID on replicator
conn = self.getFakeConnection()
self.app.replicator = Mock()
self.operation.answerLastIDs(
conn=conn,
loid=INVALID_OID,
ltid=INVALID_TID,
lptid=INVALID_TID,
)
calls = self.app.replicator.mockGetNamedCalls('setCriticalTID')
self.assertEqual(len(calls), 1)
calls[0].checkArgs(INVALID_TID)
def test_31_answerUnfinishedTransactions(self):
# set unfinished TID on replicator
conn = self.getFakeConnection()
......
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