Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
20936e05
Commit
20936e05
authored
7 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aaf8cecf
x/fsnotify_stub
t
t+ypy3
t2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
21 deletions
+32
-21
go/zodb/storage/fs1/fs1tools/dump.go
go/zodb/storage/fs1/fs1tools/dump.go
+32
-21
No files found.
go/zodb/storage/fs1/fs1tools/dump.go
View file @
20936e05
...
...
@@ -119,9 +119,9 @@ func dump(w io.Writer, path string, d dumper) (err error) {
// dumper is internal interface to implement various dumping modes
type
dumper
interface
{
dumpFileHeader
(
*
xfmt
.
Buffer
,
*
fs1
.
FileHeader
)
error
dumpTxn
(
*
xfmt
.
Buffer
,
*
fs1
.
TxnHead
er
)
error
dumpData
(
*
xfmt
.
Buffer
,
*
fs1
.
DataHead
er
)
error
dumpTxnPost
(
*
xfmt
.
Buffer
,
*
fs1
.
TxnHead
er
)
error
dumpTxn
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
dumpData
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
dumpTxnPost
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
}
// "normal" dumper
...
...
@@ -134,10 +134,11 @@ func (d *dumper1) dumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error {
return
nil
}
func
(
d
*
dumper1
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
txnh
*
fs1
.
TxnHeader
)
error
{
func
(
d
*
dumper1
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
txnh
:=
&
it
.
Txnh
buf
.
S
(
"Trans #"
)
.
D_f
(
"05"
,
d
.
ntxn
)
.
S
(
" tid="
)
.
V
(
txnh
.
Tid
)
buf
.
S
(
" time="
)
.
V
(
txnh
.
Tid
.
Time
())
.
S
(
" offset="
)
.
D64
(
txnh
.
Pos
)
buf
.
S
(
"
\n
status="
)
.
Qpy
(
txnh
.
Status
)
buf
.
S
(
"
\n
status="
)
.
Qpy
cb
(
byte
(
txnh
.
Status
)
)
buf
.
S
(
" user="
)
.
Qpyb
(
txnh
.
User
)
buf
.
S
(
" description="
)
.
Qpyb
(
txnh
.
Description
)
.
S
(
"
\n
"
)
...
...
@@ -146,13 +147,14 @@ func (d *dumper1) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
return
nil
}
func
(
d
*
dumper1
)
dumpData
(
buf
*
xfmt
.
Buffer
,
dh
*
fs1
.
DataHeader
)
error
{
func
(
d
*
dumper1
)
dumpData
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
dh
:=
&
it
.
Datah
buf
.
S
(
" data #"
)
.
D_f
(
"05"
,
d
.
ndata
)
.
S
(
" oid="
)
.
V
(
dh
.
Oid
)
if
dh
.
DataLen
==
0
{
buf
.
S
(
" class=undo or abort of object creation"
)
backPos
,
err
:=
dh
.
LoadBackRef
()
backPos
,
err
:=
dh
.
LoadBackRef
(
it
.
R
)
if
err
!=
nil
{
// XXX
}
...
...
@@ -164,9 +166,9 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
// XXX Datah.LoadData()
//modname, classname = zodb.GetPickleMetadata(...) // XXX
//fullclass = "%s.%s" % (modname, classname)
fullclass
=
"AAA.BBB"
// FIXME stub
fullclass
:
=
"AAA.BBB"
// FIXME stub
buf
.
S
(
" size="
)
.
D
(
dh
.
DataLen
)
buf
.
S
(
" size="
)
.
D
64
(
dh
.
DataLen
)
buf
.
S
(
" class="
)
.
S
(
fullclass
)
}
...
...
@@ -176,7 +178,7 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
return
nil
}
func
(
d
*
dumper1
)
dumpTxnPost
(
buf
*
xfmt
.
Buffer
,
txnh
*
fs1
.
TxnHead
er
)
error
{
func
(
d
*
dumper1
)
dumpTxnPost
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
It
er
)
error
{
return
nil
}
...
...
@@ -186,18 +188,24 @@ type dumperVerbose struct {
}
func
(
d
*
dumperVerbose
)
dumpFileHeader
(
buf
*
xfmt
.
Buffer
,
fh
*
fs1
.
FileHeader
)
error
{
buf
.
S
(
"*"
*
60
)
.
S
(
"
\n
"
)
buf
.
S
(
"file identifier: "
)
.
Qpyb
(
fh
.
Magic
)
.
S
(
"
\n
"
)
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"*"
)
}
buf
.
S
(
"
\n
"
)
buf
.
S
(
"file identifier: "
)
.
Qpyb
(
fh
.
Magic
[
:
])
.
S
(
"
\n
"
)
return
nil
}
func
(
d
*
dumperVerbose
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
txnh
*
fs1
.
TxnHeader
)
error
{
buf
.
S
(
"="
*
60
)
func
(
d
*
dumperVerbose
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
txnh
:=
&
it
.
Txnh
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"="
)
}
buf
.
S
(
"
\n
offset: "
)
.
D64
(
txnh
.
Pos
)
buf
.
S
(
"
\n
end pos: "
)
.
D64
(
txnh
.
Pos
+
txnh
.
Len
)
buf
.
S
(
"
\n
transaction id: "
)
.
V
(
txnh
.
Tid
)
buf
.
S
(
"
\n
trec len: "
)
.
D64
(
txnh
.
Len
)
buf
.
S
(
"
\n
status: "
)
.
Qpy
(
txnh
.
Status
)
buf
.
S
(
"
\n
status: "
)
.
Qpy
cb
(
byte
(
txnh
.
Status
)
)
buf
.
S
(
"
\n
user: "
)
.
Qpyb
(
txnh
.
User
)
buf
.
S
(
"
\n
description: "
)
.
Qpyb
(
txnh
.
Description
)
buf
.
S
(
"
\n
len(extra): "
)
.
D
(
len
(
txnh
.
Extension
))
...
...
@@ -205,8 +213,11 @@ func (d *dumperVerbose) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
return
nil
}
func
(
d
*
dumperVerbose
)
dumpData
(
buf
*
xfmt
.
Buffer
,
dh
*
fs1
.
DataHeader
)
error
{
buf
.
S
(
"-"
*
60
)
func
(
d
*
dumperVerbose
)
dumpData
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
dh
:=
&
it
.
Datah
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"-"
)
}
buf
.
S
(
"
\n
offset: "
)
.
D64
(
dh
.
Pos
)
buf
.
S
(
"
\n
oid: "
)
.
V
(
dh
.
Oid
)
buf
.
S
(
"
\n
revid: "
)
.
V
(
dh
.
Tid
)
...
...
@@ -215,22 +226,22 @@ func (d *dumperVerbose) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
buf
.
S
(
"
\n
len(data): "
)
.
D64
(
dh
.
DataLen
)
if
dh
.
DataLen
==
0
{
backPos
,
err
:=
dh
.
LoadBackRef
()
backPos
,
err
:=
dh
.
LoadBackRef
(
it
.
R
)
if
err
!=
nil
{
// XXX
}
buf
.
S
(
"
\n
backpointer: "
,
D64
(
backPos
)
)
buf
.
S
(
"
\n
backpointer: "
)
.
D64
(
backPos
)
}
buf
.
S
(
"
\n
"
)
return
nil
}
func
(
d
*
dumperVerbose
)
dumpTxnPost
(
buf
*
xfmt
.
Buffer
,
txnh
*
fs1
.
TxnHead
er
)
error
{
func
(
d
*
dumperVerbose
)
dumpTxnPost
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
It
er
)
error
{
// NOTE printing the same .Len twice
// we do not print/check redundant len here because our
// FileStorage code checks/reports this itself
buf
.
S
(
"redundant trec len: "
.
D64
(
txnh
.
Len
)
)
.
S
(
"
\n
"
)
buf
.
S
(
"redundant trec len: "
)
.
D64
(
it
.
Txnh
.
Len
)
.
S
(
"
\n
"
)
return
nil
}
This diff is collapsed.
Click to expand it.
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