[Zodb-checkins] SVN: ZODB/branches/ctheune-bushy-directory/src/ZODB/blob.py Remove size Computation for now but leave a comment that we should provide an

Christian Theune ct at gocept.com
Thu Jun 26 13:53:59 EDT 2008


Log message for revision 87807:
  Remove size Computation for now but leave a comment that we should provide an
  estimation function, eventually.
  

Changed:
  U   ZODB/branches/ctheune-bushy-directory/src/ZODB/blob.py

-=-
Modified: ZODB/branches/ctheune-bushy-directory/src/ZODB/blob.py
===================================================================
--- ZODB/branches/ctheune-bushy-directory/src/ZODB/blob.py	2008-06-26 16:32:30 UTC (rev 87806)
+++ ZODB/branches/ctheune-bushy-directory/src/ZODB/blob.py	2008-06-26 17:53:57 UTC (rev 87807)
@@ -682,17 +682,10 @@
     @non_overridable
     def getSize(self):
         """Return the size of the database in bytes."""
-        orig_size = getProxiedObject(self).getSize()
-        blob_size = 0
-        for oid, path in self.fshelper.listOIDs():
-            for serial in os.listdir(path):
-                if not serial.endswith(BLOB_SUFFIX):
-                    continue
-                file_path = os.path.join(path, serial)
-                blob_size += os.stat(file_path).st_size
+        # XXX The old way of computing is way to resource hungry. We need to
+        # do some kind of estimation instead.
+        return getProxiedObject(self).getSize()
 
-        return orig_size + blob_size
-
     @non_overridable
     def undo(self, serial_id, transaction):
         undo_serial, keys = getProxiedObject(self).undo(serial_id, transaction)



More information about the Zodb-checkins mailing list