Commit 4cad5560 authored by Vincent Pelletier's avatar Vincent Pelletier

Export a method to compute a partition number from a OID or TID.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2275 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 18283487
...@@ -136,11 +136,11 @@ class PartitionTable(object): ...@@ -136,11 +136,11 @@ class PartitionTable(object):
return [] return []
def getCellListForTID(self, tid, readable=False, writable=False): def getCellListForTID(self, tid, readable=False, writable=False):
return self.getCellList(self._getPartitionFromIndex(u64(tid)), return self.getCellList(self.getPartitionFromIndex(tid),
readable, writable) readable, writable)
def getCellListForOID(self, oid, readable=False, writable=False): def getCellListForOID(self, oid, readable=False, writable=False):
return self.getCellList(self._getPartitionFromIndex(u64(oid)), return self.getCellList(self.getPartitionFromIndex(oid),
readable, writable) readable, writable)
def isAssigned(self, oid, uuid): def isAssigned(self, oid, uuid):
...@@ -150,6 +150,9 @@ class PartitionTable(object): ...@@ -150,6 +150,9 @@ class PartitionTable(object):
return True return True
return False return False
def getPartitionFromIndex(self, index):
return self._getPartitionFromIndex(u64(index))
def _getPartitionFromIndex(self, index): def _getPartitionFromIndex(self, index):
return index % self.np return index % self.np
......
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