Commit 9f15936c authored by Tim Peters's avatar Tim Peters

Decoy dematerialization: removed the cacheStatistics, cacheMeanAge,

cacheMeanDeal, and cacheMeanDeac methods from the DB class.  They
were untested, undocumented, unused, and did nothing of use (the
first always returned an empty tuple, the rest always returned None).
parent 1e666d23
...@@ -11,6 +11,11 @@ iteration to return each item twice. ...@@ -11,6 +11,11 @@ iteration to return each item twice.
ZODB ZODB
---- ----
Methods removed from the database (ZODB.DB.DB) class: cacheStatistics(),
cacheMeanAge(), cacheMeanDeac(), and cacheMeanDeal(). These were
undocumented, untested, and unused. The first always returned an empty
tuple, and the rest always returned None.
When trying to do recovery to a time earlier than that of the most recent When trying to do recovery to a time earlier than that of the most recent
full backup, repozo.py failed to find the appropriate files, erroneously full backup, repozo.py failed to find the appropriate files, erroneously
claiming "No files in repository before <specified time>". This has claiming "No files in repository before <specified time>". This has
......
...@@ -66,10 +66,9 @@ class DB(object): ...@@ -66,10 +66,9 @@ class DB(object):
- `Version Methods`: modifiedInVersion, abortVersion, commitVersion, - `Version Methods`: modifiedInVersion, abortVersion, commitVersion,
versionEmpty versionEmpty
- `Cache Inspection Methods`: cacheDetail, cacheExtremeDetail, - `Cache Inspection Methods`: cacheDetail, cacheExtremeDetail,
cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheMeanAge, cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheSize,
cacheMeanDeac, cacheMeanDeal, cacheSize, cacheDetailSize, cacheDetailSize, getCacheSize, getVersionCacheSize, setCacheSize,
getCacheSize, getVersionCacheSize, setCacheSize, setVersionCacheSize, setVersionCacheSize
cacheStatistics
- `Deprecated Methods`: getCacheDeactivateAfter, - `Deprecated Methods`: getCacheDeactivateAfter,
setCacheDeactivateAfter, setCacheDeactivateAfter,
getVersionCacheDeactivateAfter, setVersionCacheDeactivateAfter getVersionCacheDeactivateAfter, setVersionCacheDeactivateAfter
...@@ -151,22 +150,6 @@ class DB(object): ...@@ -151,22 +150,6 @@ class DB(object):
if hasattr(storage, 'undoInfo'): if hasattr(storage, 'undoInfo'):
self.undoInfo = storage.undoInfo self.undoInfo = storage.undoInfo
def _cacheMean(self, attr):
# XXX this method doesn't work
m = [0, 0]
def f(con, m=m, attr=attr):
t = getattr(con._cache, attr)
m[0] += t
m[1] += 1
self._connectionMap(f)
if m[1]:
m = m[0] / m[1] # XXX should this be // ?
else:
m = None
return m
def _closeConnection(self, connection): def _closeConnection(self, connection):
"""Return a connection to the pool. """Return a connection to the pool.
...@@ -304,13 +287,6 @@ class DB(object): ...@@ -304,13 +287,6 @@ class DB(object):
def cacheMinimize(self): def cacheMinimize(self):
self._connectionMap(lambda c: c._cache.minimize()) self._connectionMap(lambda c: c._cache.minimize())
def cacheMeanAge(self):
return self._cacheMean('cache_mean_age')
def cacheMeanDeac(self):
return self._cacheMean('cache_mean_deac')
def cacheMeanDeal(self):
return self._cacheMean('cache_mean_deal')
def cacheSize(self): def cacheSize(self):
m=[0] m=[0]
def f(con, m=m): def f(con, m=m):
...@@ -674,9 +650,6 @@ class DB(object): ...@@ -674,9 +650,6 @@ class DB(object):
def setVersionPoolSize(self, v): def setVersionPoolSize(self, v):
self._version_pool_size=v self._version_pool_size=v
def cacheStatistics(self):
return () # :(
def undo(self, id, txn=None): def undo(self, id, txn=None):
"""Undo a transaction identified by id. """Undo a transaction identified by id.
......
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