Commit 51a63113 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #50 from zopefoundation/asyncio-cleanups

Asyncio cleanups
parents 671a5fb8 dd2d97cd
...@@ -490,7 +490,7 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage): ...@@ -490,7 +490,7 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage):
return self._call('record_iternext', next) return self._call('record_iternext', next)
def getTid(self, oid): def getTid(self, oid):
# XXX deprecated: used by storage server for full cache verification. # XXX deprecated: but ZODB tests use this. They shouldn't
return self._call('getTid', oid) return self._call('getTid', oid)
def loadSerial(self, oid, serial): def loadSerial(self, oid, serial):
......
...@@ -76,10 +76,6 @@ registered_methods = set(( 'get_info', 'lastTransaction', ...@@ -76,10 +76,6 @@ registered_methods = set(( 'get_info', 'lastTransaction',
class ZEOStorage: class ZEOStorage:
"""Proxy to underlying storage for a single remote client.""" """Proxy to underlying storage for a single remote client."""
# A list of extension methods. A subclass with extra methods
# should override.
extensions = []
connected = connection = stats = storage = storage_id = transaction = None connected = connection = stats = storage = storage_id = transaction = None
blob_tempfile = None blob_tempfile = None
log_label = 'unconnected' log_label = 'unconnected'
...@@ -91,10 +87,6 @@ class ZEOStorage: ...@@ -91,10 +87,6 @@ class ZEOStorage:
self.client_conflict_resolution = server.client_conflict_resolution self.client_conflict_resolution = server.client_conflict_resolution
# timeout and stats will be initialized in register() # timeout and stats will be initialized in register()
self.read_only = read_only self.read_only = read_only
# The authentication protocol may define extra methods.
self._extensions = {}
for func in self.extensions:
self._extensions[func.__name__] = None
self._iterators = {} self._iterators = {}
self._iterator_ids = itertools.count() self._iterator_ids = itertools.count()
# Stores the last item that was handed out for a # Stores the last item that was handed out for a
...@@ -148,23 +140,13 @@ class ZEOStorage: ...@@ -148,23 +140,13 @@ class ZEOStorage:
if not info['supportsUndo']: if not info['supportsUndo']:
self.undoLog = self.undoInfo = lambda *a,**k: () self.undoLog = self.undoInfo = lambda *a,**k: ()
# XXX deprecated: but ZODB tests use getTid. They shouldn't
self.getTid = storage.getTid self.getTid = storage.getTid
self.load = storage.load
self.loadSerial = storage.loadSerial self.loadSerial = storage.loadSerial
record_iternext = getattr(storage, 'record_iternext', None) record_iternext = getattr(storage, 'record_iternext', None)
if record_iternext is not None: if record_iternext is not None:
self.record_iternext = record_iternext self.record_iternext = record_iternext
try:
fn = storage.getExtensionMethods
except AttributeError:
pass # no extension methods
else:
d = fn()
self._extensions.update(d)
for name in d:
assert not hasattr(self, name)
setattr(self, name, getattr(storage, name))
self.lastTransaction = storage.lastTransaction self.lastTransaction = storage.lastTransaction
try: try:
...@@ -250,7 +232,6 @@ class ZEOStorage: ...@@ -250,7 +232,6 @@ class ZEOStorage:
'size': storage.getSize(), 'size': storage.getSize(),
'name': storage.getName(), 'name': storage.getName(),
'supportsUndo': supportsUndo, 'supportsUndo': supportsUndo,
'extensionMethods': self.getExtensionMethods(),
'supports_record_iternext': hasattr(self, 'record_iternext'), 'supports_record_iternext': hasattr(self, 'record_iternext'),
'interfaces': tuple(interfaces), 'interfaces': tuple(interfaces),
} }
...@@ -260,13 +241,6 @@ class ZEOStorage: ...@@ -260,13 +241,6 @@ class ZEOStorage:
'size': self.storage.getSize(), 'size': self.storage.getSize(),
} }
def getExtensionMethods(self):
return self._extensions
def loadEx(self, oid):
self.stats.loads += 1
return self.storage.load(oid, '')
def loadBefore(self, oid, tid): def loadBefore(self, oid, tid):
self.stats.loads += 1 self.stats.loads += 1
return self.storage.loadBefore(oid, tid) return self.storage.loadBefore(oid, tid)
......
...@@ -90,14 +90,6 @@ class IServeable(zope.interface.Interface): ...@@ -90,14 +90,6 @@ class IServeable(zope.interface.Interface):
"""Interface provided by storages that can be served by ZEO """Interface provided by storages that can be served by ZEO
""" """
def getTid(oid):
"""The last transaction to change an object
Return the transaction id of the last transaction that committed a
change to an object with the given object id.
"""
def tpc_transaction(): def tpc_transaction():
"""The current transaction being committed. """The current transaction being committed.
......
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