Commit 895d7801 authored by Julien Muchembled's avatar Julien Muchembled

Fix PartitionTable.filled()

parent 95fecbfb
...@@ -194,6 +194,7 @@ class PartitionTable(object): ...@@ -194,6 +194,7 @@ class PartitionTable(object):
for cell in row: for cell in row:
if cell.getNode() == node: if cell.getNode() == node:
row.remove(cell) row.remove(cell)
self.num_filled_rows -= not row
if not cell.isFeeding(): if not cell.isFeeding():
self.count_dict[node] -= 1 self.count_dict[node] -= 1
break break
......
...@@ -136,6 +136,7 @@ class PartitionTable(neo.lib.pt.PartitionTable): ...@@ -136,6 +136,7 @@ class PartitionTable(neo.lib.pt.PartitionTable):
self.count_dict[cell.getNode()] += 1 self.count_dict[cell.getNode()] += 1
for node in node_list: for node in node_list:
self.count_dict.pop(node, None) self.count_dict.pop(node, None)
self.num_filled_rows = len(filter(None, self.partition_list))
return change_list return change_list
def load(self, ptid, row_list, nm): def load(self, ptid, row_list, nm):
...@@ -278,6 +279,7 @@ class PartitionTable(neo.lib.pt.PartitionTable): ...@@ -278,6 +279,7 @@ class PartitionTable(neo.lib.pt.PartitionTable):
state = CellStates.DISCARDED state = CellStates.DISCARDED
row.remove(cell) row.remove(cell)
changed_list.append((offset, cell.getUUID(), state)) changed_list.append((offset, cell.getUUID(), state))
assert self.num_filled_rows == len(filter(None, self.partition_list))
return changed_list return changed_list
def outdate(self, lost_node=None): def outdate(self, lost_node=None):
......
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