[Zope3-checkins] CVS: ZODB4/src/zodb/storage - mapping.py:1.3.4.1

Barry Warsaw barry@wooz.org
Mon, 10 Feb 2003 18:14:44 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	mapping.py 
Log Message:
The start of opaque pickles (from the p.o.v. of the storages).  This
will eventually allow us to pass compressed pickles to the storage if
we want.

The approach basically changes store() so that the data argument is a
2-tuple of the pickle and the list of oids referenced in the pickle.
This is the first step in the changes, but currently, only Berkeley
storages natively store the refs included in the store() API call.

Changes here include:

- store(): split the data argument 2-tuple into the data and the refs,
  throwing away the latter for now.

- Use ZERO from zodb.interfaces instead of z64


=== ZODB4/src/zodb/storage/mapping.py 1.3 => 1.3.4.1 ===
--- ZODB4/src/zodb/storage/mapping.py:1.3	Wed Feb  5 18:28:32 2003
+++ ZODB4/src/zodb/storage/mapping.py	Mon Feb 10 18:14:37 2003
@@ -91,11 +91,11 @@
 
 import zodb.db
 from zodb import interfaces, utils
+from zodb.interfaces import ZERO
 from zodb.storage import base
 from zodb.storage.interfaces import *
 from zodb.serialize import findrefs
 from zodb.timestamp import TimeStamp
-from zodb.utils import z64
 
 def DB(name="Mapping Storage",
        pool_size=7, cache_size=400):
@@ -133,6 +133,8 @@
         if version:
             raise NotImplementedError
 
+        # XXX Store the refs natively
+        data, refs = data
         self._lock_acquire()
         try:
             if self._index.has_key(oid):
@@ -161,7 +163,7 @@
             # Build an index of *only* those objects reachable
             # from the root.
             index=self._index
-            rootl = [z64]
+            rootl = [ZERO]
             pop=rootl.pop
             pindex={}
             referenced=pindex.has_key