Commit e0296439 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove unused parameter.

Store does not handle conflicts (for reliability, it can only be done once
all store responses are received), so this parameter must go away.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1859 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6b5e0210
...@@ -69,8 +69,7 @@ class Storage(BaseStorage.BaseStorage, ...@@ -69,8 +69,7 @@ class Storage(BaseStorage.BaseStorage,
@check_read_only @check_read_only
def store(self, oid, serial, data, version, transaction): def store(self, oid, serial, data, version, transaction):
return self.app.store(oid=oid, serial=serial, return self.app.store(oid=oid, serial=serial,
data=data, version=version, transaction=transaction, data=data, version=version, transaction=transaction)
tryToResolveConflict=self.tryToResolveConflict)
def getSerial(self, oid): def getSerial(self, oid):
try: try:
......
...@@ -544,8 +544,7 @@ class Application(object): ...@@ -544,8 +544,7 @@ class Application(object):
self.local_var.txn = transaction self.local_var.txn = transaction
def store(self, oid, serial, data, version, transaction, def store(self, oid, serial, data, version, transaction):
tryToResolveConflict):
"""Store object.""" """Store object."""
if transaction is not self.local_var.txn: if transaction is not self.local_var.txn:
raise StorageTransactionError(self, transaction) raise StorageTransactionError(self, transaction)
...@@ -608,7 +607,7 @@ class Application(object): ...@@ -608,7 +607,7 @@ class Application(object):
del local_var.conflict_serial_dict[oid] del local_var.conflict_serial_dict[oid]
# Try to store again # Try to store again
self.store(oid, conflict_serial, new_data, version, self.store(oid, conflict_serial, new_data, version,
local_var.txn, tryToResolveConflict) local_var.txn)
append(oid) append(oid)
resolved = True resolved = True
if not resolved: if not resolved:
...@@ -820,8 +819,7 @@ class Application(object): ...@@ -820,8 +819,7 @@ class Application(object):
# Third do transaction with old data # Third do transaction with old data
for oid, data in data_dict.iteritems(): for oid, data in data_dict.iteritems():
self.store(oid, transaction_id, data, None, txn, self.store(oid, transaction_id, data, None, txn)
tryToResolveConflict)
self.waitStoreResponses(tryToResolveConflict) self.waitStoreResponses(tryToResolveConflict)
return self.local_var.tid, oid_list return self.local_var.tid, oid_list
......
...@@ -412,7 +412,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -412,7 +412,7 @@ class ClientApplicationTests(NeoTestBase):
app.local_var.txn = old_txn = object() app.local_var.txn = old_txn = object()
self.assertTrue(app.local_var.txn is not txn) self.assertTrue(app.local_var.txn is not txn)
self.assertRaises(StorageTransactionError, app.store, oid, tid, '', self.assertRaises(StorageTransactionError, app.store, oid, tid, '',
None, txn, resolving_tryToResolveConflict) None, txn)
self.assertEquals(app.local_var.txn, old_txn) self.assertEquals(app.local_var.txn, old_txn)
# check partition_id and an empty cell list -> NEOStorageError # check partition_id and an empty cell list -> NEOStorageError
app.local_var.txn = txn app.local_var.txn = txn
...@@ -420,7 +420,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -420,7 +420,7 @@ class ClientApplicationTests(NeoTestBase):
app.pt = Mock({ 'getCellListForOID': (), }) app.pt = Mock({ 'getCellListForOID': (), })
app.num_partitions = 2 app.num_partitions = 2
self.assertRaises(NEOStorageError, app.store, oid, tid, '', None, self.assertRaises(NEOStorageError, app.store, oid, tid, '', None,
txn, resolving_tryToResolveConflict) txn)
calls = app.pt.mockGetNamedCalls('getCellListForOID') calls = app.pt.mockGetNamedCalls('getCellListForOID')
self.assertEquals(len(calls), 1) self.assertEquals(len(calls), 1)
self.assertEquals(calls[0].getParam(0), oid) # oid=11 self.assertEquals(calls[0].getParam(0), oid) # oid=11
...@@ -453,7 +453,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -453,7 +453,7 @@ class ClientApplicationTests(NeoTestBase):
app.nm.createStorage(address=storage_address) app.nm.createStorage(address=storage_address)
app.local_var.object_stored = (oid, tid) app.local_var.object_stored = (oid, tid)
app.local_var.data_dict[oid] = 'BEFORE' app.local_var.data_dict[oid] = 'BEFORE'
app.store(oid, tid, '', None, txn, failing_tryToResolveConflict) app.store(oid, tid, '', None, txn)
app.local_var.queue.put((conn, packet)) app.local_var.queue.put((conn, packet))
self.assertRaises(ConflictError, app.waitStoreResponses, self.assertRaises(ConflictError, app.waitStoreResponses,
failing_tryToResolveConflict) failing_tryToResolveConflict)
...@@ -488,7 +488,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -488,7 +488,7 @@ class ClientApplicationTests(NeoTestBase):
return not queue.empty() return not queue.empty()
app.dispatcher = Dispatcher() app.dispatcher = Dispatcher()
app.nm.createStorage(address=storage_address) app.nm.createStorage(address=storage_address)
app.store(oid, tid, 'DATA', None, txn, resolving_tryToResolveConflict) app.store(oid, tid, 'DATA', None, txn)
self.checkAskStoreObject(conn) self.checkAskStoreObject(conn)
app.local_var.queue.put((conn, packet)) app.local_var.queue.put((conn, packet))
app.waitStoreResponses(resolving_tryToResolveConflict) app.waitStoreResponses(resolving_tryToResolveConflict)
......
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