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

Use methods and properties of PartitionTable.

Remove admin's app.ptid attribute, use pt.load() and pt.update() instead
of copy/paste the code.

git-svn-id: 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 0d14fa9f
......@@ -69,7 +69,6 @@ class Application(object): = None
self.uuid = config.getUUID()
self.primary_master_node = None
self.ptid = None
self.request_handler = MasterRequestEventHandler(self)
self.master_event_handler = MasterEventHandler(self)
self.dispatcher = Dispatcher()
......@@ -162,5 +161,5 @@ class Application(object):
p = Errors.ProtocolError('invalid partition table offset')
p = Packets.AnswerPartitionList(self.ptid, row_list)
p = Packets.AnswerPartitionList(, row_list)
......@@ -152,29 +152,12 @@ class MasterEventHandler(EventHandler):
def notifyPartitionChanges(self, conn, ptid, cell_list):
app =
if ptid < app.ptid:
# Ignore this packet.
app.ptid = ptid, cell_list, app.nm), cell_list,
def sendPartitionTable(self, conn, ptid, row_list):
uuid = conn.getUUID()
app =
nm = app.nm
pt =
node = app.nm.getByUUID(uuid)
if app.ptid != ptid:
app.ptid = ptid
for offset, row in row_list:
for uuid, state in row:
node = nm.getByUUID(uuid)
if node is None:
node = nm.createStorage(uuid=uuid)
pt.setCell(offset, node, state)
pt.log(), row_list,
def notifyClusterInformation(self, conn, cluster_state): = cluster_state
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