[Zope-CVS] CVS: Products/AdaptableStorage/zodb - ASConnection.py:1.6 ASStorage.py:1.6 consts.py:1.4
Shane Hathaway
shane@zope.com
Mon, 9 Dec 2002 13:25:30 -0500
Update of /cvs-repository/Products/AdaptableStorage/zodb
In directory cvs.zope.org:/tmp/cvs-serv24698/zodb
Modified Files:
ASConnection.py ASStorage.py consts.py
Log Message:
More sanitization and documentation:
- Renamed RecordSchema to FieldSchema and made the simpler schema classes
usable. This removed the need to always work with record sets when all
that is needed is a single value.
- Finally successfully abstracted away keychain generation. Now gateways
and serializers don't have to duplicate logic.
- Renamed IEventBase to IMapperEvent, created a derivative IAspectEvent, and
moved some of the methods of IMapperEvent to IAspectEvent.
ISerializationEvent and IDeserializationEvent now derive from IAspectEvent.
- Changed IGateways to expect IMapperEvents instead of a (mapper, keychain)
pair.
=== Products/AdaptableStorage/zodb/ASConnection.py 1.5 => 1.6 ===
--- Products/AdaptableStorage/zodb/ASConnection.py:1.5 Mon Dec 9 10:57:24 2002
+++ Products/AdaptableStorage/zodb/ASConnection.py Mon Dec 9 13:25:29 2002
@@ -247,7 +247,7 @@
ser = mapper.getSerializer()
if DEBUG:
print 'serializing', repr(oid), repr(serial)
- state, ext_refs = ser.serialize(mapper, keychain, object, self)
+ state, ext_refs = ser.serialize(self, mapper, keychain, object)
if ext_refs:
for (ext_keychain, ext_ref) in ext_refs:
if (not ext_ref._p_serial
@@ -339,7 +339,7 @@
ser = mapper.getSerializer()
if DEBUG:
print 'deserializing', repr(oid), repr(serial)
- ser.deserialize(mapper, keychain, object, self, state)
+ ser.deserialize(self, mapper, keychain, object, state)
if mapper.isVolatile():
v = self._volatile
=== Products/AdaptableStorage/zodb/ASStorage.py 1.5 => 1.6 ===
--- Products/AdaptableStorage/zodb/ASStorage.py:1.5 Mon Dec 9 10:57:24 2002
+++ Products/AdaptableStorage/zodb/ASStorage.py Mon Dec 9 13:25:29 2002
@@ -21,8 +21,9 @@
from cStringIO import StringIO
from ZODB import POSException, BaseStorage
+from serial_public import MapperEvent
-from consts import VERIFY_CLASSES, SERIAL0, SERIAL1, DEBUG
+from consts import SERIAL0, SERIAL1, DEBUG
from OIDEncoder import OIDEncoder
@@ -72,10 +73,12 @@
k = keychain[:i + 1]
cfr = mapper.getClassifier()
assert cfr is not None, keychain
- classification, sub_mapper_name = cfr.classifyState(mapper, k)
+ event = MapperEvent(mapper, k)
+ classification, sub_mapper_name = cfr.classifyState(event)
mapper_names.append(sub_mapper_name)
mapper = mapper.getSubMapper(sub_mapper_name)
- full_state, serial = mapper.getGateway().load(mapper, keychain)
+ event = MapperEvent(mapper, keychain)
+ full_state, serial = mapper.getGateway().load(event)
return full_state, serial, classification, mapper_names
@@ -136,9 +139,10 @@
for mapper_name in mapper_names:
cfr = mapper.getClassifier()
mapper = mapper.getSubMapper(mapper_name)
- new_serial = mapper.getGateway().store(mapper, keychain, state)
+ event = MapperEvent(mapper, keychain)
+ new_serial = mapper.getGateway().store(event, state)
if cfr is not None:
- cfr.store(mapper, keychain, classification)
+ cfr.store(event, classification)
new_hash = self.hashSerial(new_serial)
finally:
self._lock_release()
=== Products/AdaptableStorage/zodb/consts.py 1.3 => 1.4 ===
--- Products/AdaptableStorage/zodb/consts.py:1.3 Thu Dec 5 12:38:47 2002
+++ Products/AdaptableStorage/zodb/consts.py Mon Dec 9 13:25:29 2002
@@ -17,10 +17,6 @@
"""
DEBUG = 0
-VERIFY_CLASSES = 0
-VERIFY_SCHEMAS = 0
-VERIFY_COMPUTED_OIDS = 0
-VERIFY_CREATED_OIDS = 0
SERIAL0 = '\0' * 8
SERIAL1 = '\0' * 7 + '\001'