[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Autopack.py:1.4 BerkeleyBase.py:1.17
Barry Warsaw
barry@wooz.org
Fri, 19 Jul 2002 12:42:37 -0400
Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv24538
Modified Files:
Autopack.py BerkeleyBase.py
Log Message:
getSize(): Seems appropriate to move this from the Autopack storage
into the BerkeleyBase class so all the derived storages (which all
share the zodb_pickles table) can benefit.
This makes loadmail.py work for any of the derived storages.
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Autopack.py 1.3 => 1.4 ===
def iterator(self):
raise NotImplementedError
- def getSize(self):
- # Return the size of the pickles table as a rough estimate
- filename = os.path.join(self._env.db_home, 'zodb_pickles')
- return os.path.getsize(filename)
-
# Not part of the storage API
def autopack(self):
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/BerkeleyBase.py 1.16 => 1.17 ===
def getSize(self):
"""Return the size of the database."""
- # TBD: this is expensive to calculate and many not be necessary.
- return 'too hard to determine'
+ # Return the size of the pickles table as a rough estimate
+ filename = os.path.join(self._env.db_home, 'zodb_pickles')
+ return os.path.getsize(filename)
# BAW: this overrides BaseStorage.tpc_vote() with exactly the same
# implementation. This is so Zope 2.3.1, which doesn't include the change