Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
3baeea9e
Commit
3baeea9e
authored
Jan 09, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove a bunch of old files.
parent
2c2b7d30
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
1635 deletions
+0
-1635
trunk/src/ZODB/Setup
trunk/src/ZODB/Setup
+0
-10
trunk/src/ZODB/TimeStamp.c
trunk/src/ZODB/TimeStamp.c
+0
-442
trunk/src/ZODB/cPickleCache.c
trunk/src/ZODB/cPickleCache.c
+0
-992
trunk/src/ZODB/fsdump.py
trunk/src/ZODB/fsdump.py
+0
-191
No files found.
trunk/src/ZODB/Setup
deleted
100644 → 0
View file @
2c2b7d30
*shared*
cPersistence cPersistence.c -I../../Components/ExtensionClass/src
cPickleCache cPickleCache.c -I../../Components/ExtensionClass/src
TimeStamp TimeStamp.c -I../../Components/ExtensionClass/src -DUSE_EXTENSION_CLASS
coptimizations coptimizations.c -I../../Components/ExtensionClass/src
# This is an auxilary file that provides file locking on windows.
# It is essentially null on any other platform.
winlock winlock.c
trunk/src/ZODB/TimeStamp.c
deleted
100644 → 0
View file @
2c2b7d30
This diff is collapsed.
Click to expand it.
trunk/src/ZODB/cPickleCache.c
deleted
100644 → 0
View file @
2c2b7d30
This diff is collapsed.
Click to expand it.
trunk/src/ZODB/fsdump.py
deleted
100644 → 0
View file @
2c2b7d30
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Low-level text dumps of FileStorage contents.
fsdump() prints a two-line summary of each transaction and a one-line
summary of each data record in that transaction. This report is often
useful when analyzing a storage's contents.
Dumper() prints a very detailed representation of the contents. Each
header field is printed on a separate line. This produces lots of
data that is useful when debugging the storage implementation.
"""
from
ZODB.FileStorage
import
TRANS_HDR
,
TRANS_HDR_LEN
from
ZODB.FileStorage
import
DATA_HDR
,
DATA_HDR_LEN
,
DATA_VERSION_HDR_LEN
from
ZODB.FileStorage
import
FileIterator
from
ZODB.utils
import
u64
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
from
persistent.TimeStamp
import
TimeStamp
from
cPickle
import
Unpickler
from
cStringIO
import
StringIO
import
md5
import
struct
import
types
def
get_pickle_metadata
(
data
):
# ZODB's data records contain two pickles. The first is the class
# of the object, the second is the object.
if
data
.
startswith
(
'(c'
):
# Don't actually unpickle a class, because it will attempt to
# load the class. Just break open the pickle and get the
# module and class from it.
modname
,
classname
,
rest
=
data
.
split
(
'
\
n
'
,
2
)
modname
=
modname
[
2
:]
return
modname
,
classname
f
=
StringIO
(
data
)
u
=
Unpickler
(
f
)
try
:
class_info
=
u
.
load
()
except
Exception
,
err
:
print
"Error"
,
err
return
''
,
''
if
isinstance
(
class_info
,
types
.
TupleType
):
if
isinstance
(
class_info
[
0
],
types
.
TupleType
):
modname
,
classname
=
class_info
[
0
]
else
:
modname
,
classname
=
class_info
else
:
# XXX not sure what to do here
modname
=
repr
(
class_info
)
classname
=
''
return
modname
,
classname
def
fsdump
(
path
,
file
=
None
,
with_offset
=
True
,
start
=
None
,
stop
=
None
):
i
=
0
iter
=
FileIterator
(
path
,
start
,
stop
)
for
trans
in
iter
:
if
with_offset
:
print
>>
file
,
(
"Trans #%05d tid=%016x time=%s size=%d"
%
(
i
,
u64
(
trans
.
tid
),
str
(
TimeStamp
(
trans
.
tid
)),
trans
.
_tend
-
trans
.
_tpos
))
else
:
print
>>
file
,
"Trans #%05d tid=%016x time=%s"
%
\
(
i
,
u64
(
trans
.
tid
),
str
(
TimeStamp
(
trans
.
tid
)))
print
>>
file
,
"
\
t
offset=%d status=%s user=%s description=%s"
%
\
(
trans
.
_tpos
,
`trans.status`
,
trans
.
user
,
trans
.
description
)
j
=
0
for
rec
in
trans
:
if
rec
.
data
is
None
:
fullclass
=
"undo or abort of object creation"
else
:
modname
,
classname
=
get_pickle_metadata
(
rec
.
data
)
dig
=
md5
.
new
(
rec
.
data
).
hexdigest
()
fullclass
=
"%s.%s"
%
(
modname
,
classname
)
# special case for testing purposes
if
fullclass
==
"ZODB.tests.MinPO.MinPO"
:
obj
=
zodb_unpickle
(
rec
.
data
)
fullclass
=
"%s %s"
%
(
fullclass
,
obj
.
value
)
if
rec
.
version
:
version
=
"version=%s "
%
rec
.
version
else
:
version
=
''
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
=
""
if
rec
.
data_txn
:
size
=
8
+
len
(
rec
.
version
)
else
:
if
rec
.
data
is
None
:
# XXX why is rec.data None and rec.data_txn False?
size
=
len
(
rec
.
version
)
else
:
size
=
len
(
rec
.
data
)
+
len
(
rec
.
version
)
if
rec
.
version
:
size
+=
DATA_VERSION_HDR_LEN
else
:
size
+=
DATA_HDR_LEN
print
>>
file
,
" data #%05d oid=%016x %sclass=%s size=%d %s"
%
\
(
j
,
u64
(
rec
.
oid
),
version
,
fullclass
,
size
,
bp
)
j
+=
1
print
>>
file
i
+=
1
iter
.
close
()
def
fmt
(
p64
):
# Return a nicely formatted string for a packaged 64-bit value
return
"%016x"
%
u64
(
p64
)
class
Dumper
:
"""A very verbose dumper for debuggin FileStorage problems."""
def
__init__
(
self
,
path
,
dest
=
None
):
self
.
file
=
open
(
path
,
"rb"
)
self
.
dest
=
dest
def
dump
(
self
):
fid
=
self
.
file
.
read
(
4
)
print
>>
self
.
dest
,
"*"
*
60
print
>>
self
.
dest
,
"file identifier: %r"
%
fid
while
self
.
dump_txn
():
pass
def
dump_txn
(
self
):
pos
=
self
.
file
.
tell
()
h
=
self
.
file
.
read
(
TRANS_HDR_LEN
)
if
not
h
:
return
False
tid
,
stlen
,
status
,
ul
,
dl
,
el
=
struct
.
unpack
(
TRANS_HDR
,
h
)
end
=
pos
+
u64
(
stlen
)
print
>>
self
.
dest
,
"="
*
60
print
>>
self
.
dest
,
"offset: %d"
%
pos
print
>>
self
.
dest
,
"end pos: %d"
%
end
print
>>
self
.
dest
,
"transaction id: %s"
%
fmt
(
tid
)
print
>>
self
.
dest
,
"trec len: %d"
%
u64
(
stlen
)
print
>>
self
.
dest
,
"status: %r"
%
status
user
=
descr
=
extra
=
""
if
ul
:
user
=
self
.
file
.
read
(
ul
)
if
dl
:
descr
=
self
.
file
.
read
(
dl
)
if
el
:
extra
=
self
.
file
.
read
(
el
)
print
>>
self
.
dest
,
"user: %r"
%
user
print
>>
self
.
dest
,
"description: %r"
%
descr
print
>>
self
.
dest
,
"len(extra): %d"
%
el
while
self
.
file
.
tell
()
<
end
:
self
.
dump_data
(
pos
)
stlen2
=
self
.
file
.
read
(
8
)
print
>>
self
.
dest
,
"redundant trec len: %d"
%
u64
(
stlen2
)
return
1
def
dump_data
(
self
,
tloc
):
pos
=
self
.
file
.
tell
()
h
=
self
.
file
.
read
(
DATA_HDR_LEN
)
assert
len
(
h
)
==
DATA_HDR_LEN
oid
,
revid
,
sprev
,
stloc
,
vlen
,
sdlen
=
struct
.
unpack
(
DATA_HDR
,
h
)
dlen
=
u64
(
sdlen
)
print
>>
self
.
dest
,
"-"
*
60
print
>>
self
.
dest
,
"offset: %d"
%
pos
print
>>
self
.
dest
,
"oid: %s"
%
fmt
(
oid
)
print
>>
self
.
dest
,
"revid: %s"
%
fmt
(
revid
)
print
>>
self
.
dest
,
"previous record offset: %d"
%
u64
(
sprev
)
print
>>
self
.
dest
,
"transaction offset: %d"
%
u64
(
stloc
)
if
vlen
:
pnv
=
self
.
file
.
read
(
8
)
sprevdata
=
self
.
file
.
read
(
8
)
version
=
self
.
file
.
read
(
vlen
)
print
>>
self
.
dest
,
"version: %r"
%
version
print
>>
self
.
dest
,
"non-version data offset: %d"
%
u64
(
pnv
)
print
>>
self
.
dest
,
\
"previous version data offset: %d"
%
u64
(
sprevdata
)
print
>>
self
.
dest
,
"len(data): %d"
%
dlen
self
.
file
.
read
(
dlen
)
if
not
dlen
:
sbp
=
self
.
file
.
read
(
8
)
print
>>
self
.
dest
,
"backpointer: %d"
%
u64
(
sbp
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment