[Zope3-checkins] CVS: Zope3/src/zodb/storage - file.py:1.21

Barry Warsaw barry@wooz.org
Mon, 17 Mar 2003 15:23:48 -0500


Update of /cvs-repository/Zope3/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv24284

Modified Files:
	file.py 
Log Message:
pack(): Add the optional gc flag, which FileStorage ignores.


=== Zope3/src/zodb/storage/file.py 1.20 => 1.21 ===
--- Zope3/src/zodb/storage/file.py:1.20	Fri Mar 14 16:56:48 2003
+++ Zope3/src/zodb/storage/file.py	Mon Mar 17 15:23:47 2003
@@ -1408,16 +1408,19 @@
         return [version for version in self._vindex.keys()
                 if not self.versionEmpty(version)]
 
-    def pack(self, t):
-        """Copy data from the current database file to a packed file
+    def pack(self, t, gc=True):
+        """Perform a pack on the storage.
 
-        Non-current records from transactions with time-stamp strings less
-        than packtss are ommitted. As are all undone records.
+        There are two forms of packing: incremental and full gc.  In an
+        incremental pack, only old object revisions are removed.  In a full gc
+        pack, cyclic garbage detection and removal is also performed.
 
-        Also, data back pointers that point before packtss are resolved and
-        the associated data are copied, since the old records are not copied.
-        """
+        t is the pack time.  All non-current object revisions older than t
+        will be removed in an incremental pack.
 
+        FileStorage ignores the gc flag.  Every pack does both incremental and
+        full gc packing.
+        """
         if self._is_read_only:
             raise ReadOnlyError()