Commit 11c428e0 authored by Julien Muchembled's avatar Julien Muchembled

Code cleanup

parent 7834ef10
......@@ -67,8 +67,6 @@ class Storage(BaseStorage.BaseStorage,
'deleteObject',
'undo',
'undoLog',
'abortVersion',
'commitVersion',
):
setattr(self, method_id, raiseReadOnlyError)
if _app is None:
......@@ -156,12 +154,6 @@ class Storage(BaseStorage.BaseStorage,
def supportsTransactionalUndo(self):
return True
def abortVersion(self, src, transaction):
return self.app.abortVersion(src, transaction)
def commitVersion(self, src, dest, transaction):
return self.app.commitVersion(src, dest, transaction)
def loadEx(self, oid, version):
try:
data, serial, _ = self.app.load(oid)
......
......@@ -465,7 +465,6 @@ class Application(object):
if answer_ttid is None:
raise NEOStorageError('tpc_begin failed')
assert tid in (None, answer_ttid), (tid, answer_ttid)
txn_context['txn'] = transaction
txn_context['ttid'] = answer_ttid
def store(self, oid, serial, data, version, transaction):
......@@ -475,7 +474,6 @@ class Application(object):
raise StorageTransactionError(self, transaction)
logging.debug('storing oid %s serial %s', dump(oid), dump(serial))
self._store(txn_context, oid, serial, data)
return None
def _store(self, txn_context, oid, serial, data, data_serial=None,
unlock=False):
......@@ -984,16 +982,6 @@ class Application(object):
self._askPrimary(Packets.AskLastTransaction())
return self.last_tid
def abortVersion(self, src, transaction):
if self._txn_container.get(transaction) is None:
raise StorageTransactionError(self, transaction)
return '', []
def commitVersion(self, src, dest, transaction):
if self._txn_container.get(transaction) is None:
raise StorageTransactionError(self, transaction)
return '', []
def __del__(self):
"""Clear all connection."""
# Due to bug in ZODB, close is not always called when shutting
......
......@@ -114,7 +114,7 @@ class ConnectionPool(object):
if not cell_list:
raise NEOStorageError('no storage available')
getConnForNode = self.getConnForNode
while cell_list:
while 1:
new_cell_list = []
# Shuffle to randomise node to access...
shuffle(cell_list)
......@@ -131,10 +131,11 @@ class ConnectionPool(object):
# state can have changed during connection attempt.
elif node.isRunning():
new_cell_list.append(cell)
if not new_cell_list:
break
cell_list = new_cell_list
if new_cell_list:
# wait a bit to avoid a busy loop
time.sleep(1)
# wait a bit to avoid a busy loop
time.sleep(1)
def getConnForNode(self, node):
"""Return a locked connection object to a given node
......
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