[Checkins] SVN: gocept.zeoraid/trunk/src/gocept/zeoraid/ snapshot of temporary sketches (will be transformed into using the iterator()

Christian Theune ct at gocept.com
Tue Feb 12 03:17:27 EST 2008


Log message for revision 83758:
  snapshot of temporary sketches (will be transformed into using the iterator()
  API)
  

Changed:
  A   gocept.zeoraid/trunk/src/gocept/zeoraid/filestorage.py
  U   gocept.zeoraid/trunk/src/gocept/zeoraid/interfaces.py
  U   gocept.zeoraid/trunk/src/gocept/zeoraid/recovery.py

-=-
Added: gocept.zeoraid/trunk/src/gocept/zeoraid/filestorage.py
===================================================================
--- gocept.zeoraid/trunk/src/gocept/zeoraid/filestorage.py	                        (rev 0)
+++ gocept.zeoraid/trunk/src/gocept/zeoraid/filestorage.py	2008-02-12 08:17:26 UTC (rev 83758)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Zope Foundation and contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""An extended file storage that supports the transaction inspection API."""
+
+import zope.interface
+
+import ZODB.FileStorage
+
+import gocept.zeoraid.interfaces
+
+
+class FileStorage(ZODB.FileStorage.FileStorage):
+    """An extended file storage that supports the transaction inspection API."""
+
+    zope.interface.implements(
+        gocept.zeoraid.interfaces.ITransactionInspection)
+
+    def transaction_log(transaction_index, count=1):
+        """Return information about `count` transactions starting with the Nth
+        transaction given by `transaction_index`.
+        """
+
+    def transaction_oids(tid):
+        """Return a list of OIDs of the objects that were changed in the given
+        transaction.
+        """


Property changes on: gocept.zeoraid/trunk/src/gocept/zeoraid/filestorage.py
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: gocept.zeoraid/trunk/src/gocept/zeoraid/interfaces.py
===================================================================
--- gocept.zeoraid/trunk/src/gocept/zeoraid/interfaces.py	2008-02-12 07:29:40 UTC (rev 83757)
+++ gocept.zeoraid/trunk/src/gocept/zeoraid/interfaces.py	2008-02-12 08:17:26 UTC (rev 83758)
@@ -41,3 +41,25 @@
 
     def raid_recover(name):
         pass
+
+
+class ITransactionInspection(zope.interface.Interface):
+    """Storage API extension to allow inspecting historical transactions."""
+
+    def transaction_log(transaction_index, count=1):
+        """Return information about `count` transactions starting with the Nth
+        transaction given by `transaction_index`.
+
+        Counting starts with the oldest transaction known.
+
+        Return a list of `UndoInfo` records.
+
+        If transactions are requested that do not exist, the returned list may
+        be shorter than `count`.
+
+        """
+
+    def transaction_oids(tid):
+        """Return a list of OIDs of the objects that were changed in the given
+        transaction.
+        """

Modified: gocept.zeoraid/trunk/src/gocept/zeoraid/recovery.py
===================================================================
--- gocept.zeoraid/trunk/src/gocept/zeoraid/recovery.py	2008-02-12 07:29:40 UTC (rev 83757)
+++ gocept.zeoraid/trunk/src/gocept/zeoraid/recovery.py	2008-02-12 08:17:26 UTC (rev 83758)
@@ -29,8 +29,6 @@
         self.target_transaction_count = ...
         # initialize counting up self.raid_transaction_count
 
-    # transaction_log(offset, length) -> [undo_info, ...]
-    # transaction_details(tid) -> [oid, ...]
 
     def get_raid_transaction_info(self, n):
         """Retrieves the n-th transaction info from the RAID, counting from



More information about the Checkins mailing list