[Zodb-checkins] CVS: Zope3/src/zodb/storage/file - pack.py:1.1.2.5

Jeremy Hylton jeremy at zope.com
Thu Apr 17 20:05:02 EDT 2003


Update of /cvs-repository/Zope3/src/zodb/storage/file
In directory cvs.zope.org:/tmp/cvs-serv25459/file

Modified Files:
      Tag: jeremy-new-pack-branch
	pack.py 
Log Message:
Remove unused methods.


=== Zope3/src/zodb/storage/file/pack.py 1.1.2.4 => 1.1.2.5 ===
--- Zope3/src/zodb/storage/file/pack.py:1.1.2.4	Thu Apr 17 18:50:56 2003
+++ Zope3/src/zodb/storage/file/pack.py	Thu Apr 17 19:05:01 2003
@@ -204,28 +204,6 @@
         # to reduce I/O during packing
         self.nvindex = fsIndex()
 
-    def _loada(self, oid, _index):
-        """Read any version and return the version"""
-        try:
-            pos = _index[oid]
-        except KeyError:
-            raise POSKeyError(oid)
-        h = self._read_data_header(pos)
-        refs = splitrefs(self._file.read(h.nrefs * 8))
-        if h.plen:
-            data = self._file.read(h.plen)
-        else:
-            # _loadBack() leaves the file position sitting at the right place
-            data = self._loadBack(oid, h.back)[0]
-        return data, refs, h.version
-
-    def _redundant_pack(self, pos):
-        assert pos > 8, pos
-        self._file.seek(pos - 8)
-        p = u64(self._file.read(8))
-        self._file.seek(pos - p + 8)
-        return self._file.read(1) != ' ' # XXX or == "p"?
-
     def pack(self):
         # Pack copies all data reachable at the pack time or later.
         #
@@ -269,34 +247,6 @@
 
         return pos
 
-    def isCurNonversion(self, h, nvpos, curpos):
-        """Return True if h is current non-version data,
-
-        where the current data is at curpos.  Always restores the file
-        to the position it was at before the call.
-        """
-        if not curpos:
-            return False
-        pos = self._file.tell()
-        try:
-            # XXX probably don't want to read this data everytime.
-            # instead, keep a cache of whether curpos is in a version.
-            # note that entries can be thrown out after passing curpos.
-            cur = self._read_data_header(curpos)
-            assert cur.oid == h.oid
-            if not cur.version:
-                return False
-            # If cur has a pnv, we need to chase backpointers until
-            # we get to the actual data.
-            self._file.read(cur.nrefs * 8)
-            if not cur.pnv:
-                # The object was created in a version.
-                return False
-            pnv = self._loadBackPOS(cur.oid, cur.pnv)
-            return pnv == nvpos
-        finally:
-            self._file.seek(pos)
-
     def copyToPacktime(self):
         offset = 0L  # the amount of space freed by packing
         pos = self._metadata_size
@@ -433,14 +383,7 @@
                                   prev_txn, pos, self._tfile.tell())
 
             tlen = self._tfile.tell() - pos
-            if tlen != th.tlen:
-                # Copying the data records changed their sizes, so we
-                # need to patch up the tlen in the header.
-                p = self._tfile.tell()
-                self._tfile.seek(pos)
-                th.tlen = tlen
-                self._tfile.write(th.asString())
-                self._tfile.seek(p)
+            assert tlen == th.tlen
             self._tfile.write(p64(tlen))
             ipos += 8
 




More information about the Zodb-checkins mailing list