[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - CommitLog.py:1.10.2.1
Barry Warsaw
barry@wooz.org
Wed, 17 Apr 2002 16:35:38 -0400
Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv23474/bsddb3Storage
Modified Files:
Tag: bsddb3Storage-picklelog-branch
CommitLog.py
Log Message:
write_object(): Change the semantics of the 4th argument (not counting
self). Instead of being the pickle, it's now a list of oids
referenced by that pickle (because the pickle is stored at the time of
the store() call).
write_*(): For all the methods other than write_object(), while the
command can still be `o' for implementation sharing, the refdoids
field is now None instead of the empty string.
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/CommitLog.py 1.10 => 1.10.2.1 ===
# read/write protocol
- def write_object(self, oid, vid, nvrevid, pickle, prevrevid):
+ def write_object(self, oid, vid, nvrevid, refdoids, prevrevid):
# Write an empty lrevid since that will be the same as the transaction
# id at the time of the commit to Berkeley.
- self._append('o', (oid, vid, nvrevid, '', pickle, prevrevid))
+ #
+ # Since we're now writing the pickles directly to Berkeley instead of
+ # logging them, we don't need to store the pickle data here. Instead,
+ # we'll write the list of oids referenced by the data, which will be
+ # useful during _finish()
+ self._append('o', (oid, vid, nvrevid, '', refdoids, prevrevid))
def write_nonversion_object(self, oid, lrevid, prevrevid, zero='\0'*8):
# Write zeros for the vid and nvrevid since we're storing this object
# into version zero (the non-version). Also, write an empty pickle
# since we'll reuse one already in the pickle table.
- self._append('o', (oid, zero, zero, lrevid, '', prevrevid))
+ self._append('o', (oid, zero, zero, lrevid, None, prevrevid))
def write_moved_object(self, oid, vid, nvrevid, lrevid, prevrevid):
# Write an empty pickle since we're just moving the object and we'll
# reuse the pickle already in the database.
- self._append('o', (oid, vid, nvrevid, lrevid, '', prevrevid))
+ self._append('o', (oid, vid, nvrevid, lrevid, None, prevrevid))
def write_object_undo(self, oid, vid, nvrevid, lrevid, prevrevid):
# Identical to write_moved_object() except that we have to keep some
# extra info around. Specifically, it's possible to undo multiple
# transactions in the same transaction.
- self._append('o', (oid, vid, nvrevid, lrevid, '', prevrevid))
+ self._append('o', (oid, vid, nvrevid, lrevid, None, prevrevid))
self.__prevrevids[oid] = prevrevid
def write_new_version(self, version, vid):
@@ -414,6 +419,6 @@
key, data = rec
except ValueError:
raise LogCorruptedError, 'incomplete record'
- if key not in 'ovd':
+ if key not in 'ovdr':
raise LogCorruptedError, 'bad record key: %s' % key
return key, data