[ZODB-Dev] Can ZEO serve Ape storage?

Shane Hathaway shane at zope.com
Thu Jun 5 11:02:03 EDT 2003


zhimin at iss.nus.edu.sg wrote:
> Hi, I woud like to have the ZEO patch and try it out. Could you please
> email to me?
> Thanks a lot!

Ok, here you go.  This quick and dirty patch disables most interactions 
with the ZEO cache.  It is meant to be apply against the current HEAD.

Shane
-------------- next part --------------
Index: ClientStorage.py
===================================================================
RCS file: /cvs-repository/ZEO/ZEO/ClientStorage.py,v
retrieving revision 1.100
diff -u -u -r1.100 ClientStorage.py
--- ClientStorage.py	30 May 2003 19:20:57 -0000	1.100
+++ ClientStorage.py	5 Jun 2003 13:56:51 -0000
@@ -688,14 +688,14 @@
         specified by the given object id and version, if they exist;
         otherwise a KeyError is raised.
         """
-        p = self._cache.load(oid, version)
-        if p:
-            return p
+##        p = self._cache.load(oid, version)
+##        if p:
+##            return p
         if self._server is None:
             raise ClientDisconnected()
         p, s, v, pv, sv = self._server.zeoLoad(oid)
-        self._cache.checkSize(0)
-        self._cache.store(oid, p, s, v, pv, sv)
+##        self._cache.checkSize(0)
+##        self._cache.store(oid, p, s, v, pv, sv)
         if v and version and v == version:
             return pv, sv
         else:
@@ -708,9 +708,9 @@
 
         If no version modified the object, return an empty string.
         """
-        v = self._cache.modifiedInVersion(oid)
-        if v is not None:
-            return v
+##        v = self._cache.modifiedInVersion(oid)
+##        if v is not None:
+##            return v
         return self._server.modifiedInVersion(oid)
 
     def new_oid(self):
@@ -866,7 +866,7 @@
         This iterates over the objects in the transaction buffer and
         update or invalidate the cache.
         """
-        self._cache.checkSize(self._tbuf.get_size())
+##        self._cache.checkSize(self._tbuf.get_size())
         try:
             self._tbuf.begin_iterate()
         except ValueError, msg:
@@ -887,10 +887,10 @@
                 s = None
             else:
                 s = self._seriald[oid]
-            if s == ResolvedSerial or s is None:
-                self._cache.invalidate(oid, v)
-            else:
-                self._cache.update(oid, s, v, p)
+##            if s == ResolvedSerial or s is None:
+##                self._cache.invalidate(oid, v)
+##            else:
+##                self._cache.update(oid, s, v, p)
         self._tbuf.clear()
 
     def transactionalUndo(self, trans_id, trans):
@@ -914,8 +914,8 @@
             raise POSException.ReadOnlyError()
         # XXX what are the sync issues here?
         oids = self._server.undo(transaction_id)
-        for oid in oids:
-            self._cache.invalidate(oid, '')
+##        for oid in oids:
+##            self._cache.invalidate(oid, '')
         return oids
 
     def undoInfo(self, first=0, last=-20, specification=None):
@@ -973,7 +973,7 @@
         versions = {}
         for oid, version in invs:
             d = versions.setdefault(version, {})
-            self._cache.invalidate(oid, version=version)
+##            self._cache.invalidate(oid, version=version)
             d[oid] = 1
         if self._db is not None:
             for v, d in versions.items():


More information about the ZODB-Dev mailing list