[Zope3-checkins] CVS: ZODB4/src/zodb/zeo - cache.py:1.2.12.4 client.py:1.4.4.4 commitlog.py:1.2.12.1 server.py:1.6.4.5 stubs.py:1.4.4.2 tbuf.py:1.2.12.1

Barry Warsaw barry@wooz.org
Thu, 13 Mar 2003 14:40:15 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	cache.py client.py commitlog.py server.py stubs.py tbuf.py 
Log Message:
> Next step: get rid of the tuple in the argument list.

Completed.

Also, reorder the arguments to restore() so that data and refs are
buddies again, just like in the store() call.

I believe we're ready to merge back to the head.


=== ZODB4/src/zodb/zeo/cache.py 1.2.12.3 => 1.2.12.4 ===
--- ZODB4/src/zodb/zeo/cache.py:1.2.12.3	Wed Mar 12 16:41:25 2003
+++ ZODB4/src/zodb/zeo/cache.py	Thu Mar 13 14:39:44 2003
@@ -449,9 +449,7 @@
         self._trace(0x6A, header[:8], vlen and vheader[:-4] or '',
                     vlen and vserial or header[-8:], dlen)
 
-    def update(self, oid, serial, version, data):
-        # XXX Fixme
-        data, refs = data
+    def update(self, oid, serial, version, data, refs):
         self._acquire()
         try:
             self._trace(0x3A, oid, version, serial, len(data))


=== ZODB4/src/zodb/zeo/client.py 1.4.4.3 => 1.4.4.4 ===
--- ZODB4/src/zodb/zeo/client.py:1.4.4.3	Wed Mar 12 16:41:25 2003
+++ ZODB4/src/zodb/zeo/client.py	Thu Mar 13 14:39:44 2003
@@ -681,11 +681,11 @@
                 self._seriald[oid] = s
             return r
 
-    def store(self, oid, serial, data, version, transaction):
+    def store(self, oid, serial, data, refs, version, transaction):
         """Storage API: store data for an object."""
         self._check_trans(transaction)
-        self._server.storea(oid, serial, data, version, self._serial)
-        self._tbuf.store(oid, version, data)
+        self._server.storea(oid, serial, data, refs, version, self._serial)
+        self._tbuf.store(oid, version, data, refs)
         return self._check_serials()
 
     def tpcVote(self, transaction):
@@ -804,7 +804,7 @@
                     "client storage: %s" % msg)
             if t is None:
                 break
-            oid, v, p = t
+            oid, v, p, refs = t
             if p is None: # an invalidation
                 s = None
             else:
@@ -812,7 +812,7 @@
             if s == ResolvedSerial or s is None:
                 self._cache.invalidate(oid, v)
             else:
-                self._cache.update(oid, s, v, p)
+                self._cache.update(oid, s, v, p, refs)
         self._tbuf.clear()
 
     def undo(self, trans_id, trans):


=== ZODB4/src/zodb/zeo/commitlog.py 1.2 => 1.2.12.1 ===
--- ZODB4/src/zodb/zeo/commitlog.py:1.2	Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/commitlog.py	Thu Mar 13 14:39:44 2003
@@ -31,8 +31,8 @@
         self.stores = 0
         self.read = 0
 
-    def store(self, oid, serial, data, version):
-        self.pickler.dump((oid, serial, data, version))
+    def store(self, oid, serial, data, refs, version):
+        self.pickler.dump((oid, serial, data, refs, version))
         self.stores += 1
 
     def get_loader(self):


=== ZODB4/src/zodb/zeo/server.py 1.6.4.4 => 1.6.4.5 ===
--- ZODB4/src/zodb/zeo/server.py:1.6.4.4	Wed Mar 12 18:23:44 2003
+++ ZODB4/src/zodb/zeo/server.py	Thu Mar 13 14:39:44 2003
@@ -376,10 +376,10 @@
     # Most of the real implementations are in methods beginning with
     # an _.
 
-    def storea(self, oid, serial, data, version, id):
+    def storea(self, oid, serial, data, refs, version, id):
         self._check_tid(id, exc=StorageTransactionError)
         self.stats.stores += 1
-        self.txnlog.store(oid, serial, data, version)
+        self.txnlog.store(oid, serial, data, refs, version)
 
     # The following four methods return values, so they must acquire
     # the storage lock and begin the transaction before returning.
@@ -418,10 +418,10 @@
         self.stats.lock_time = time.time()
         self.storage.tpcBegin(txn, tid, status)
 
-    def _store(self, oid, serial, data, version):
+    def _store(self, oid, serial, data, refs, version):
         try:
-            newserial = self.storage.store(oid, serial, data, version,
-                                           self.transaction)
+            newserial = self.storage.store(oid, serial, data, refs,
+                                           version, self.transaction)
         except (SystemExit, KeyboardInterrupt):
             raise
         except Exception, err:


=== ZODB4/src/zodb/zeo/stubs.py 1.4.4.1 => 1.4.4.2 ===
--- ZODB4/src/zodb/zeo/stubs.py:1.4.4.1	Wed Mar 12 16:41:25 2003
+++ ZODB4/src/zodb/zeo/stubs.py	Thu Mar 13 14:39:44 2003
@@ -124,8 +124,8 @@
     def zeoLoad(self, oid):
         return self.rpc.call('zeoLoad', oid)
 
-    def storea(self, oid, serial, data, version, id):
-        self.rpc.callAsync('storea', oid, serial, data, version, id)
+    def storea(self, oid, serial, data, refs, version, id):
+        self.rpc.callAsync('storea', oid, serial, data, refs, version, id)
 
     def tpcBegin(self, id, user, descr, ext, tid, status):
         return self.rpc.call('tpcBegin', id, user, descr, ext, tid, status)
@@ -175,8 +175,8 @@
     def lastTransaction(self):
         return self.rpc.call('lastTransaction')
 
-    def store(self, oid, serial, data, version, trans):
-        return self.rpc.call('store', oid, serial, data, version, trans)
+    def store(self, oid, serial, data, refs, version, trans):
+        return self.rpc.call('store', oid, serial, data, refs, version, trans)
 
     def undo(self, trans_id, trans):
         return self.rpc.call('undo', trans_id, trans)


=== ZODB4/src/zodb/zeo/tbuf.py 1.2 => 1.2.12.1 ===
--- ZODB4/src/zodb/zeo/tbuf.py:1.2	Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/tbuf.py	Thu Mar 13 14:39:44 2003
@@ -75,31 +75,32 @@
         finally:
             self.lock.release()
 
-    def store(self, oid, version, data):
+    def store(self, oid, version, data, refs):
         self.lock.acquire()
         try:
-            self._store(oid, version, data)
+            self._store(oid, version, data, refs)
         finally:
             self.lock.release()
 
-    def _store(self, oid, version, data):
-        """Store oid, version, data for later retrieval"""
+    def _store(self, oid, version, data, refs):
+        """Store oid, version, data, refs for later retrieval"""
         if self.closed:
             return
-        self.pickler.dump((oid, version, data))
+        self.pickler.dump((oid, version, data, refs))
         self.count += 1
         # Estimate per-record cache size
         self.size = self.size + len(data) + 31
         if version:
             # Assume version data has same size as non-version data
-            self.size = self.size + len(version) + len(data) + 12
+            refslen = len(''.join(refs))
+            self.size = self.size + len(version) + len(data) + refslen + 12
 
     def invalidate(self, oid, version):
         self.lock.acquire()
         try:
             if self.closed:
                 return
-            self.pickler.dump((oid, version, None))
+            self.pickler.dump((oid, version, None, []))
             self.count += 1
         finally:
             self.lock.release()