[Zodb-checkins] SVN: ZODB/trunk/ _restore_index(): No need to use types.DictType anymore.

Tim Peters tim.one at comcast.net
Mon Mar 21 18:46:07 EST 2005


Log message for revision 29635:
  _restore_index():  No need to use types.DictType anymore.
  
  Added news blurbs about fsIndex improvements, and about that
  .index files written by 3.4 won't be readable by earlier ZODBs.
  

Changed:
  U   ZODB/trunk/NEWS.txt
  U   ZODB/trunk/src/ZODB/FileStorage/FileStorage.py

-=-
Modified: ZODB/trunk/NEWS.txt
===================================================================
--- ZODB/trunk/NEWS.txt	2005-03-21 23:15:48 UTC (rev 29634)
+++ ZODB/trunk/NEWS.txt	2005-03-21 23:46:06 UTC (rev 29635)
@@ -49,6 +49,12 @@
 FileStorage
 -----------
 
+- The main part of a ``Data.fs.index`` index file now uses an OOBTree
+  instead of a Python dictionary.  A consequence is that ``.index`` files
+  written by this version of ZODB cannot be read by earlier versions of
+  ZODB.  Older ``.index`` files can be read by this version of ZODB, and
+  are automatically converted to use the new scheme.
+
 - Addded a record iteration protocol to FileStorage.  You can use the
   record iterator to iterate over all current revisions of data
   pickles in the storage.
@@ -81,6 +87,14 @@
 ZODB/test/testfsoids.py is a tutorial doctest.
 
 
+fsIndex
+-------
+
+Efficient, general implementations of ``minKey()`` and ``maxKey()`` methods
+were added.  ``fsIndex`` is a special hybrid kind of BTree used to implement
+FileStorage indices.  Thanks to Chris McDonough for code and tests.
+
+
 What's new in ZODB3 3.3.1a2?
 ============================
 Release date: DD-MMM-2005

Modified: ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2005-03-21 23:15:48 UTC (rev 29634)
+++ ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2005-03-21 23:46:06 UTC (rev 29635)
@@ -23,7 +23,7 @@
 import sys
 import time
 import logging
-from types import StringType, DictType
+from types import StringType
 from struct import pack, unpack
 
 # Not all platforms have fsync
@@ -371,13 +371,12 @@
             return None
         pos = long(pos)
 
-        if (
-            isinstance(index, DictType) or
-            (isinstance(index, fsIndex) and isinstance(index._data, DictType))
-             ):
+        if (isinstance(index, dict) or
+                (isinstance(index, fsIndex) and
+                 isinstance(index._data, dict))):
             # Convert dictionary indexes to fsIndexes *or* convert fsIndexes
-            # which have a DictType `_data` attribute to a new fsIndex (newer
-            # fsIndexes have an OOBTree as `_data`)
+            # which have a dict `_data` attribute to a new fsIndex (newer
+            # fsIndexes have an OOBTree as `_data`).
             newindex = fsIndex()
             newindex.update(index)
             index = newindex



More information about the Zodb-checkins mailing list