[Zodb-checkins] CVS: ZODB4/src/zodb/storage - bdbminimal.py:1.11.4.3

Barry Warsaw barry@wooz.org
Wed, 12 Mar 2003 12:26:41 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	bdbminimal.py 
Log Message:
Rename the table from _referents to _references for consistency.


=== ZODB4/src/zodb/storage/bdbminimal.py 1.11.4.2 => 1.11.4.3 ===
--- ZODB4/src/zodb/storage/bdbminimal.py:1.11.4.2	Mon Mar 10 14:41:17 2003
+++ ZODB4/src/zodb/storage/bdbminimal.py	Wed Mar 12 12:26:39 2003
@@ -80,7 +80,7 @@
         #     reference count is updated during the _finish() call.  When it
         #     goes to zero, the object is automatically deleted.
         #
-        # referents -- {oid+tid -> oid+oid+...}
+        # references -- {oid+tid -> oid+oid+...}
         #     For each revision of the object, these are the oids of the
         #     objects referred to in the data record, as a list of 8-byte
         #     oids, concatenated together.
@@ -159,8 +159,8 @@
                 # Clean up revision-indexed tables
                 revid = oid+tid
                 self._pickles.delete(revid, txn=txn)
-                if self._referents.has_key(revid):
-                    self._referents.delete(revid, txn=txn)
+                if self._references.has_key(revid):
+                    self._references.delete(revid, txn=txn)
         finally:
             # There's a small window of opportunity for leaking a cursor here,
             # if co.close() were to fail.  In practice this shouldn't happen.
@@ -197,20 +197,20 @@
                     if stid <> tid:
                         revid = oid+stid
                         # This is the previous revision of the object, so
-                        # decref its referents and clean up its pickles.
+                        # decref its references and clean up its pickles.
                         cs.delete()
-                        referents = self._referents.get(revid, txn=txn)
-                        if referents:
-                            self._update(deltas, referents, -1)
+                        references = self._references.get(revid, txn=txn)
+                        if references:
+                            self._update(deltas, references, -1)
                         self._pickles.delete(revid, txn=txn)
-                        if self._referents.has_key(revid):
-                            self._referents.delete(revid, txn=txn)
+                        if self._references.has_key(revid):
+                            self._references.delete(revid, txn=txn)
                     srec = cs.next_dup()
                 # Now add incref deltas for all objects referenced by the new
                 # revision of this object.
-                referents = self._referents.get(oid+tid, txn=txn)
-                if referents:
-                    self._update(deltas, referents, 1)
+                references = self._references.get(oid+tid, txn=txn)
+                if references:
+                    self._update(deltas, references, 1)
         finally:
             # There's a small window of opportunity for leaking a cursor here,
             # if co.close() were to fail.  In practice this shouldn't happen.
@@ -244,9 +244,9 @@
                 # pickles and refcounts table.  Note that before we remove its
                 # pickle, we need to decref all the objects referenced by it.
                 current = self._getCurrentSerial(oid)
-                referents = self._referents.get(oid+current, txn=txn)
-                if referents:
-                    self._update(newdeltas, referents, -1)
+                references = self._references.get(oid+current, txn=txn)
+                if references:
+                    self._update(newdeltas, references, -1)
                 # And delete the serials, pickle and refcount entries.  At
                 # this point, I believe we should have just one serial entry.
                 self._serials.delete(oid, txn=txn)
@@ -288,9 +288,9 @@
         self._serials.put(oid, newserial, txn=txn)
         self._pickles.put(revid, data, txn=txn)
         if refs:
-            referents = EMPTYSTRING.join(refs)
-            assert len(referents) % 8 == 0
-            self._referents.put(revid, referents, txn=txn)
+            references = EMPTYSTRING.join(refs)
+            assert len(references) % 8 == 0
+            self._references.put(revid, references, txn=txn)
         self._oids.put(oid, PRESENT, txn=txn)
         # If we're in the middle of a pack, we need to add these objects to
         # the packmark, so a specific race condition won't collect them.
@@ -455,9 +455,9 @@
                 if tid is not None:
                     # Now get the oids of all the objects referenced by this
                     # object revision
-                    referents = self._referents.get(oid+tid)
-                    if referents:
-                        for oid in splitrefs(referents):
+                    references = self._references.get(oid+tid)
+                    if references:
+                        for oid in splitrefs(references):
                             self._oidqueue.append(oid, txn)
             # Pop the next oid off the queue and do it all again
             rec = self._oidqueue.consume(txn)
@@ -523,8 +523,8 @@
                     rec = c.next()
             finally:
                 c.close()
-            # Collect referents and do reference counting
-            c = self._referents.cursor(txn)
+            # Collect references and do reference counting
+            c = self._references.cursor(txn)
             try:
                 try:
                     rec = c.set_range(oid)
@@ -533,10 +533,10 @@
                 while rec and rec[0][:8] == oid:
                     if self._stop:
                         raise PackStop, 'stopped in _collect_objs() loop 3'
-                    referents = rec[1]
-                    if referents:
+                    references = rec[1]
+                    if references:
                         deltas = {}
-                        self._update(deltas, referents, -1)
+                        self._update(deltas, references, -1)
                         for oid, delta in deltas.items():
                             rc = u64(self._refcounts.get(oid, ZERO)) + delta
                             if rc <= 0: