[Zodb-checkins] CVS: Zope/lib/python/ZODB - ActivityMonitor.py:1.3.4.1 BaseStorage.py:1.20.4.7 Connection.py:1.72.4.6 DemoStorage.py:1.12.4.7 FileStorage.py:1.95.4.6 POSException.py:1.12.4.9 TimeStamp.c:1.15.58.3 Transaction.py:1.37.4.5 cPersistence.c:1.62.8.3 fsdump.py:1.3.68.1
Chris McDonough
chrism@zope.com
Sat, 26 Oct 2002 15:52:21 -0400
Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv31373/lib/python/ZODB
Modified Files:
Tag: chrism-install-branch
ActivityMonitor.py BaseStorage.py Connection.py DemoStorage.py
FileStorage.py POSException.py TimeStamp.c Transaction.py
cPersistence.c fsdump.py
Log Message:
Merge with HEAD. Again, sorry for the spew (what's left of it... someone seems to have filtered some of this branch's checkins out).
=== Zope/lib/python/ZODB/ActivityMonitor.py 1.3 => 1.3.4.1 ===
--- Zope/lib/python/ZODB/ActivityMonitor.py:1.3 Wed Aug 14 18:07:09 2002
+++ Zope/lib/python/ZODB/ActivityMonitor.py Sat Oct 26 15:51:49 2002
@@ -72,12 +72,14 @@
'end': start + (end - start) * (n + 1) / divisions,
'loads': 0,
'stores': 0,
+ 'connections': 0,
})
div = res[0]
div_start = div['start']
div_end = div['end']
div_index = 0
+ connections = 0
total_loads = 0
total_stores = 0
for t, loads, stores in self.log:
@@ -90,17 +92,21 @@
while t > div_end:
div['loads'] = total_loads
div['stores'] = total_stores
+ div['connections'] = connections
total_loads = 0
total_stores = 0
+ connections = 0
div_index = div_index + 1
if div_index < divisions:
div = res[div_index]
div_start = div['start']
div_end = div['end']
+ connections = connections + 1
total_loads = total_loads + loads
total_stores = total_stores + stores
div['stores'] = div['stores'] + total_stores
div['loads'] = div['loads'] + total_loads
+ div['connections'] = div['connections'] + connections
return res
=== Zope/lib/python/ZODB/BaseStorage.py 1.20.4.6 => 1.20.4.7 ===
--- Zope/lib/python/ZODB/BaseStorage.py:1.20.4.6 Tue Oct 8 17:45:54 2002
+++ Zope/lib/python/ZODB/BaseStorage.py Sat Oct 26 15:51:49 2002
@@ -281,7 +281,8 @@
oid=r.oid
if verbose: print `oid`, r.version, len(r.data)
if restoring:
- self.restore(oid, r.serial, r.data, r.version, transaction)
+ self.restore(oid, r.serial, r.data, r.version,
+ r.data_txn, transaction)
else:
pre=preget(oid, None)
s=self.store(oid, pre, r.data, r.version, transaction)
=== Zope/lib/python/ZODB/Connection.py 1.72.4.5 => 1.72.4.6 ===
=== Zope/lib/python/ZODB/DemoStorage.py 1.12.4.6 => 1.12.4.7 ===
=== Zope/lib/python/ZODB/FileStorage.py 1.95.4.5 => 1.95.4.6 === (531/631 lines abridged)
--- Zope/lib/python/ZODB/FileStorage.py:1.95.4.5 Tue Oct 8 17:45:54 2002
+++ Zope/lib/python/ZODB/FileStorage.py Sat Oct 26 15:51:49 2002
@@ -148,11 +148,17 @@
register_subsystem('ZODB FS')
z64='\0'*8
+# the struct formats for the headers
+TRANS_HDR = ">8s8scHHH"
+DATA_HDR = ">8s8s8s8sH8s"
# constants to support various header sizes
TRANS_HDR_LEN = 23
DATA_HDR_LEN = 42
DATA_VERSION_HDR_LEN = 58
+assert struct.calcsize(TRANS_HDR) == TRANS_HDR_LEN
+assert struct.calcsize(DATA_HDR) == DATA_HDR_LEN
+
def warn(message, *data):
LOG('ZODB FS', WARNING, "%s warn: %s\n" % (packed_version,
(message % data)))
@@ -175,21 +181,19 @@
class FileStorageFormatError(FileStorageError):
"""Invalid file format
- The format of the given file is not valid
+ The format of the given file is not valid.
"""
class CorruptedFileStorageError(FileStorageError,
POSException.StorageSystemError):
- """Corrupted file storage
- """
+ """Corrupted file storage."""
class CorruptedTransactionError(CorruptedFileStorageError): pass
class CorruptedDataError(CorruptedFileStorageError): pass
class FileStorageQuotaError(FileStorageError,
POSException.StorageSystemError):
- """File storage quota exceeded
- """
+ """File storage quota exceeded."""
packed_version='FS21'
@@ -365,7 +369,7 @@
if pos < 4: return 0
seek(pos)
s = read(TRANS_HDR_LEN)
- tid, stl, status, ul, dl, el = unpack(">8s8scHHH", s)
[-=- -=- -=- 531 lines omitted -=- -=- -=-]
warn("%s data record exceeds transaction record at %s",
- name, pos)
+ file.name, pos)
break
- self._pos=pos+dlen
+ self._pos = pos + dlen
+ tid = None
if plen:
- p = read(plen)
+ p = self._file.read(plen)
else:
- p = read(8)
+ p = self._file.read(8)
if p == z64:
# If the backpointer is 0 (encoded as z64), then
# this transaction undoes the object creation. It
@@ -2374,19 +2417,18 @@
# this.
p = None
else:
- p = _loadBack(file, oid, p)[0]
+ p, _s, tid = _loadBackTxn(self._file, oid, p)
- r = Record(oid, serial, version, p)
+ r = Record(oid, serial, version, p, tid)
return r
raise IndexError, index
class Record(BaseStorage.DataRecord):
- """An abstract database record
- """
+ """An abstract database record."""
def __init__(self, *args):
- self.oid, self.serial, self.version, self.data = args
+ self.oid, self.serial, self.version, self.data, self.data_txn = args
class UndoSearch:
@@ -2420,7 +2462,7 @@
self.pos -= U64(self.file.read(8)) + 8
self.file.seek(self.pos)
h = self.file.read(TRANS_HDR_LEN)
- tid, tl, status, ul, dl, el = struct.unpack(">8s8scHHH", h)
+ tid, tl, status, ul, dl, el = struct.unpack(TRANS_HDR, h)
if tid < self.packt or status == 'p':
self.stop = 1
return None
=== Zope/lib/python/ZODB/POSException.py 1.12.4.8 => 1.12.4.9 ===
=== Zope/lib/python/ZODB/TimeStamp.c 1.15.58.2 => 1.15.58.3 ===
=== Zope/lib/python/ZODB/Transaction.py 1.37.4.4 => 1.37.4.5 ===
=== Zope/lib/python/ZODB/cPersistence.c 1.62.8.2 => 1.62.8.3 ===
--- Zope/lib/python/ZODB/cPersistence.c:1.62.8.2 Tue Oct 8 17:45:55 2002
+++ Zope/lib/python/ZODB/cPersistence.c Sat Oct 26 15:51:49 2002
@@ -837,7 +837,10 @@
deallocated,
(intfunctionwithpythonarg)Per_setstate,
(pergetattr)Per_getattr,
- NULL
+ (persetattr)_setattro,
+ NULL /* The percachedel slot is initialized in cPickleCache.c when
+ the module is loaded. It uses a function in a different
+ shared library. */
};
void
=== Zope/lib/python/ZODB/fsdump.py 1.3 => 1.3.68.1 ===
--- Zope/lib/python/ZODB/fsdump.py:1.3 Mon Feb 11 14:38:09 2002
+++ Zope/lib/python/ZODB/fsdump.py Sat Oct 26 15:51:49 2002
@@ -64,8 +64,14 @@
version = "version=%s " % rec.version
else:
version = ''
- print >> file, " data #%05d oid=%016x %sclass=%s" % \
- (j, U64(rec.oid), version, fullclass)
+ if rec.data_txn:
+ # XXX It would be nice to print the transaction number
+ # (i) but it would be too expensive to keep track of.
+ bp = "bp=%016x" % U64(rec.data_txn)
+ else:
+ bp = ""
+ print >> file, " data #%05d oid=%016x %sclass=%s %s" % \
+ (j, U64(rec.oid), version, fullclass, bp)
j += 1
print >> file
i += 1