Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
20936e05
Commit
20936e05
authored
Jul 25, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aaf8cecf
Changes
1
Show 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) {
...
@@ -119,9 +119,9 @@ func dump(w io.Writer, path string, d dumper) (err error) {
// dumper is internal interface to implement various dumping modes
// dumper is internal interface to implement various dumping modes
type
dumper
interface
{
type
dumper
interface
{
dumpFileHeader
(
*
xfmt
.
Buffer
,
*
fs1
.
FileHeader
)
error
dumpFileHeader
(
*
xfmt
.
Buffer
,
*
fs1
.
FileHeader
)
error
dumpTxn
(
*
xfmt
.
Buffer
,
*
fs1
.
TxnHead
er
)
error
dumpTxn
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
dumpData
(
*
xfmt
.
Buffer
,
*
fs1
.
DataHead
er
)
error
dumpData
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
dumpTxnPost
(
*
xfmt
.
Buffer
,
*
fs1
.
TxnHead
er
)
error
dumpTxnPost
(
*
xfmt
.
Buffer
,
*
fs1
.
It
er
)
error
}
}
// "normal" dumper
// "normal" dumper
...
@@ -134,10 +134,11 @@ func (d *dumper1) dumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error {
...
@@ -134,10 +134,11 @@ func (d *dumper1) dumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error {
return
nil
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
(
"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
(
" 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
(
" user="
)
.
Qpyb
(
txnh
.
User
)
buf
.
S
(
" description="
)
.
Qpyb
(
txnh
.
Description
)
.
S
(
"
\n
"
)
buf
.
S
(
" description="
)
.
Qpyb
(
txnh
.
Description
)
.
S
(
"
\n
"
)
...
@@ -146,13 +147,14 @@ func (d *dumper1) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
...
@@ -146,13 +147,14 @@ func (d *dumper1) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
return
nil
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
)
buf
.
S
(
" data #"
)
.
D_f
(
"05"
,
d
.
ndata
)
.
S
(
" oid="
)
.
V
(
dh
.
Oid
)
if
dh
.
DataLen
==
0
{
if
dh
.
DataLen
==
0
{
buf
.
S
(
" class=undo or abort of object creation"
)
buf
.
S
(
" class=undo or abort of object creation"
)
backPos
,
err
:=
dh
.
LoadBackRef
()
backPos
,
err
:=
dh
.
LoadBackRef
(
it
.
R
)
if
err
!=
nil
{
if
err
!=
nil
{
// XXX
// XXX
}
}
...
@@ -164,9 +166,9 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
...
@@ -164,9 +166,9 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
// XXX Datah.LoadData()
// XXX Datah.LoadData()
//modname, classname = zodb.GetPickleMetadata(...) // XXX
//modname, classname = zodb.GetPickleMetadata(...) // XXX
//fullclass = "%s.%s" % (modname, classname)
//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
)
buf
.
S
(
" class="
)
.
S
(
fullclass
)
}
}
...
@@ -176,7 +178,7 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
...
@@ -176,7 +178,7 @@ func (d *dumper1) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
return
nil
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
return
nil
}
}
...
@@ -186,18 +188,24 @@ type dumperVerbose struct {
...
@@ -186,18 +188,24 @@ type dumperVerbose struct {
}
}
func
(
d
*
dumperVerbose
)
dumpFileHeader
(
buf
*
xfmt
.
Buffer
,
fh
*
fs1
.
FileHeader
)
error
{
func
(
d
*
dumperVerbose
)
dumpFileHeader
(
buf
*
xfmt
.
Buffer
,
fh
*
fs1
.
FileHeader
)
error
{
buf
.
S
(
"*"
*
60
)
.
S
(
"
\n
"
)
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"file identifier: "
)
.
Qpyb
(
fh
.
Magic
)
.
S
(
"
\n
"
)
buf
.
S
(
"*"
)
}
buf
.
S
(
"
\n
"
)
buf
.
S
(
"file identifier: "
)
.
Qpyb
(
fh
.
Magic
[
:
])
.
S
(
"
\n
"
)
return
nil
return
nil
}
}
func
(
d
*
dumperVerbose
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
txnh
*
fs1
.
TxnHeader
)
error
{
func
(
d
*
dumperVerbose
)
dumpTxn
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
buf
.
S
(
"="
*
60
)
txnh
:=
&
it
.
Txnh
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"="
)
}
buf
.
S
(
"
\n
offset: "
)
.
D64
(
txnh
.
Pos
)
buf
.
S
(
"
\n
offset: "
)
.
D64
(
txnh
.
Pos
)
buf
.
S
(
"
\n
end pos: "
)
.
D64
(
txnh
.
Pos
+
txnh
.
Len
)
buf
.
S
(
"
\n
end pos: "
)
.
D64
(
txnh
.
Pos
+
txnh
.
Len
)
buf
.
S
(
"
\n
transaction id: "
)
.
V
(
txnh
.
Tid
)
buf
.
S
(
"
\n
transaction id: "
)
.
V
(
txnh
.
Tid
)
buf
.
S
(
"
\n
trec len: "
)
.
D64
(
txnh
.
Len
)
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
user: "
)
.
Qpyb
(
txnh
.
User
)
buf
.
S
(
"
\n
description: "
)
.
Qpyb
(
txnh
.
Description
)
buf
.
S
(
"
\n
description: "
)
.
Qpyb
(
txnh
.
Description
)
buf
.
S
(
"
\n
len(extra): "
)
.
D
(
len
(
txnh
.
Extension
))
buf
.
S
(
"
\n
len(extra): "
)
.
D
(
len
(
txnh
.
Extension
))
...
@@ -205,8 +213,11 @@ func (d *dumperVerbose) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
...
@@ -205,8 +213,11 @@ func (d *dumperVerbose) dumpTxn(buf *xfmt.Buffer, txnh *fs1.TxnHeader) error {
return
nil
return
nil
}
}
func
(
d
*
dumperVerbose
)
dumpData
(
buf
*
xfmt
.
Buffer
,
dh
*
fs1
.
DataHeader
)
error
{
func
(
d
*
dumperVerbose
)
dumpData
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
{
buf
.
S
(
"-"
*
60
)
dh
:=
&
it
.
Datah
for
i
:=
0
;
i
<
60
;
i
++
{
buf
.
S
(
"-"
)
}
buf
.
S
(
"
\n
offset: "
)
.
D64
(
dh
.
Pos
)
buf
.
S
(
"
\n
offset: "
)
.
D64
(
dh
.
Pos
)
buf
.
S
(
"
\n
oid: "
)
.
V
(
dh
.
Oid
)
buf
.
S
(
"
\n
oid: "
)
.
V
(
dh
.
Oid
)
buf
.
S
(
"
\n
revid: "
)
.
V
(
dh
.
Tid
)
buf
.
S
(
"
\n
revid: "
)
.
V
(
dh
.
Tid
)
...
@@ -215,22 +226,22 @@ func (d *dumperVerbose) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
...
@@ -215,22 +226,22 @@ func (d *dumperVerbose) dumpData(buf *xfmt.Buffer, dh *fs1.DataHeader) error {
buf
.
S
(
"
\n
len(data): "
)
.
D64
(
dh
.
DataLen
)
buf
.
S
(
"
\n
len(data): "
)
.
D64
(
dh
.
DataLen
)
if
dh
.
DataLen
==
0
{
if
dh
.
DataLen
==
0
{
backPos
,
err
:=
dh
.
LoadBackRef
()
backPos
,
err
:=
dh
.
LoadBackRef
(
it
.
R
)
if
err
!=
nil
{
if
err
!=
nil
{
// XXX
// XXX
}
}
buf
.
S
(
"
\n
backpointer: "
,
D64
(
backPos
)
)
buf
.
S
(
"
\n
backpointer: "
)
.
D64
(
backPos
)
}
}
buf
.
S
(
"
\n
"
)
buf
.
S
(
"
\n
"
)
return
nil
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
// NOTE printing the same .Len twice
// we do not print/check redundant len here because our
// we do not print/check redundant len here because our
// FileStorage code checks/reports this itself
// 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
return
nil
}
}
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