Commit 466c5df2 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Any change on cells return the diff applied on the partition table.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2430 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 17692b76
...@@ -137,15 +137,14 @@ class PartitionTable(neo.pt.PartitionTable): ...@@ -137,15 +137,14 @@ class PartitionTable(neo.pt.PartitionTable):
raise PartitionTableException('Non-assigned partition') raise PartitionTableException('Non-assigned partition')
# update the partition table # update the partition table
self.setCell(offset, node, CellStates.UP_TO_DATE) cell_list = [self.setCell(offset, node, CellStates.UP_TO_DATE)]
cell_list = [(offset, uuid, CellStates.UP_TO_DATE)] cell_list = [(offset, uuid, CellStates.UP_TO_DATE)]
# If the partition contains a feeding cell, drop it now. # If the partition contains a feeding cell, drop it now.
for feeding_cell in self.getCellList(offset): for feeding_cell in self.getCellList(offset):
if feeding_cell.isFeeding(): if feeding_cell.isFeeding():
self.removeCell(offset, feeding_cell.getNode()) cell_list.append(self.removeCell(offset,
cell = (offset, feeding_cell.getUUID(), CellStates.DISCARDED) feeding_cell.getNode()))
cell_list.append(cell)
break break
return cell_list return cell_list
......
...@@ -183,6 +183,7 @@ class PartitionTable(object): ...@@ -183,6 +183,7 @@ class PartitionTable(object):
row.append(Cell(node, state)) row.append(Cell(node, state))
if state != CellStates.FEEDING: if state != CellStates.FEEDING:
self.count_dict[node] += 1 self.count_dict[node] += 1
return (offset, node.getUUID(), state)
def removeCell(self, offset, node): def removeCell(self, offset, node):
row = self.partition_list[offset] row = self.partition_list[offset]
...@@ -193,6 +194,7 @@ class PartitionTable(object): ...@@ -193,6 +194,7 @@ class PartitionTable(object):
if not cell.isFeeding(): if not cell.isFeeding():
self.count_dict[node] -= 1 self.count_dict[node] -= 1
break break
return (offset, node.getUUID(), CellStates.DISCARDED)
def load(self, ptid, row_list, nm): def load(self, ptid, row_list, nm):
""" """
......
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