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.
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
full backup, repozo.py failed to find the appropriate files, erroneously
claiming "No files in repository before <specified time>". This has
......
......@@ -66,10 +66,9 @@ class DB(object):
- `Version Methods`: modifiedInVersion, abortVersion, commitVersion,
versionEmpty
- `Cache Inspection Methods`: cacheDetail, cacheExtremeDetail,
cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheMeanAge,
cacheMeanDeac, cacheMeanDeal, cacheSize, cacheDetailSize,
getCacheSize, getVersionCacheSize, setCacheSize, setVersionCacheSize,
cacheStatistics
cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheSize,
cacheDetailSize, getCacheSize, getVersionCacheSize, setCacheSize,
setVersionCacheSize
- `Deprecated Methods`: getCacheDeactivateAfter,
setCacheDeactivateAfter,
getVersionCacheDeactivateAfter, setVersionCacheDeactivateAfter
......@@ -151,22 +150,6 @@ class DB(object):
if hasattr(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):
"""Return a connection to the pool.
......@@ -304,13 +287,6 @@ class DB(object):
def cacheMinimize(self):
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):
m=[0]
def f(con, m=m):
......@@ -674,9 +650,6 @@ class DB(object):
def setVersionPoolSize(self, v):
self._version_pool_size=v
def cacheStatistics(self):
return () # :(
def undo(self, id, txn=None):
"""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