[Zope-CVS] CVS: Products/Ape/lib/apelib/core - events.py:1.4.4.1 interfaces.py:1.7.4.1 io.py:1.4.2.1
Shane Hathaway
shane@zope.com
Wed, 23 Jul 2003 00:13:18 -0400
Update of /cvs-repository/Products/Ape/lib/apelib/core
In directory cvs.zope.org:/tmp/cvs-serv21220/lib/apelib/core
Modified Files:
Tag: ape-scan-branch
events.py interfaces.py io.py
Log Message:
Rough implementation of cache freshness scanning.
This will hopefully enable smoother filesystem storage.
=== Products/Ape/lib/apelib/core/events.py 1.4 => 1.4.4.1 ===
--- Products/Ape/lib/apelib/core/events.py:1.4 Mon May 26 15:33:15 2003
+++ Products/Ape/lib/apelib/core/events.py Wed Jul 23 00:12:41 2003
@@ -79,10 +79,20 @@
def __init__(self, mapper, keychain, connections):
MapperEvent.__init__(self, mapper, keychain)
self._connections = connections
+ self._sources = []
def getConnection(self, name):
"""Returns the named connection."""
return self._connections[name]
+
+ def addSources(self, sources):
+ """Connects sources with the object being loaded/stored.
+ """
+ self._sources.extend(sources)
+
+ def getSources(self):
+ """Returns [source]."""
+ return self._sources
class LoadEvent (GatewayEvent):
=== Products/Ape/lib/apelib/core/interfaces.py 1.7 => 1.7.4.1 ===
--- Products/Ape/lib/apelib/core/interfaces.py:1.7 Mon May 26 15:33:15 2003
+++ Products/Ape/lib/apelib/core/interfaces.py Wed Jul 23 00:12:41 2003
@@ -143,6 +143,17 @@
def getConnection(name):
"""Returns the named connection."""
+ def addSources(sources):
+ """Connects sources with the object being loaded/stored.
+
+ A source is a (repository, location) pair. The repository
+ defines the meaning of the location. Both the repository
+ and source must be hashable.
+ """
+
+ def getSources():
+ """Returns [source]."""
+
class ILoadEvent (IGatewayEvent):
"""Interface for events involved in loading objects."""
=== Products/Ape/lib/apelib/core/io.py 1.4 => 1.4.2.1 ===
--- Products/Ape/lib/apelib/core/io.py:1.4 Mon Jun 23 22:50:05 2003
+++ Products/Ape/lib/apelib/core/io.py Wed Jul 23 00:12:41 2003
@@ -117,7 +117,7 @@
event.hash_only = 1
state, hash_value = mapper.getGateway().load(event)
cs = ClassifiedState(state, classification, mapper_names)
- return cs, hash_value
+ return event, cs, hash_value
def store(self, keychain, classified_state):
@@ -132,7 +132,7 @@
new_hash = mapper.getGateway().store(event, classified_state.state)
if cfr is not None:
cfr.store(event, classified_state.classification)
- return new_hash
+ return event, new_hash
def newKeychain(self):
@@ -269,7 +269,7 @@
todo = [(keychain, obj)]
while todo:
keychain, obj = todo.pop()
- classified_state, hash_value = self.gw_io.load(keychain)
+ e, classified_state, hash_value = self.gw_io.load(keychain)
event = self.obj_io.deserialize(keychain, obj, classified_state)
if self._incomplete.has_key(keychain):
del self._incomplete[keychain]
@@ -301,7 +301,7 @@
return self._objects[keychain]
except KeyError:
# This object has not been loaded yet. Make a stub.
- classified_state, hash_value = self.gw_io.load(keychain)
+ e, classified_state, hash_value = self.gw_io.load(keychain)
obj = self.obj_io.newObject(classified_state)
# Don't fill in the state yet, to avoid infinite
# recursion. Just register it.