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
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
Levin Zimmermann
neoppod
Commits
a0d65ee2
Commit
a0d65ee2
authored
Mar 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c470505a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
t/neo/zodb/cmd/zodbdump/zodbdump.go
t/neo/zodb/cmd/zodbdump/zodbdump.go
+17
-6
No files found.
t/neo/zodb/cmd/zodbdump/zodbdump.go
View file @
a0d65ee2
...
...
@@ -68,28 +68,35 @@ func (d *dumper) DumpData(datai *zodb.StorageRecordInformation) error {
default
:
entry
+=
fmt
.
Sprintf
(
"%d sha1:%x"
,
len
(
datai
.
Data
),
sha1
.
Sum
(
datai
.
Data
))
writeData
=
true
// XXX write data here
writeData
=
true
}
entry
+=
"
\n
"
_
,
err
:=
d
.
W
.
Write
(
mem
.
Bytes
(
entry
))
if
err
!=
nil
{
return
err
goto
out
}
if
writeData
&&
!
d
.
HashOnly
{
_
,
err
=
d
.
W
.
Write
(
datai
.
Data
)
if
err
!=
nil
{
return
err
goto
out
}
// TODO use writev(data, "\n") when it is available
_
,
err
=
d
.
W
.
Write
([]
byte
(
"
\n
"
))
if
err
!=
nil
{
return
err
goto
out
}
}
// XXX ^^^ add oid: %v as prefix for err
out
:
// XXX do we need this context ?
// see for rationale in similar place in DumpTxn
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%v: %v"
,
datai
.
Oid
,
err
)
}
return
nil
}
...
...
@@ -105,7 +112,7 @@ func (d *dumper) DumpTxn(txni *zodb.TxnInfo, dataIter zodb.IStorageRecordIterato
_
,
err
:=
fmt
.
Fprintf
(
d
.
W
,
"%stxn %s (%c)
\n
user %q
\n
description %q
\n
extension %q
\n
"
,
vskip
,
txni
.
Tid
,
txni
.
Status
,
txni
.
User
,
txni
.
Description
,
txni
.
Extension
)
if
err
!=
nil
{
return
err
goto
out
}
// data records
...
...
@@ -125,6 +132,10 @@ func (d *dumper) DumpTxn(txni *zodb.TxnInfo, dataIter zodb.IStorageRecordIterato
}
}
out
:
// XXX do we need this context ?
// rationale: dataIter.NextData() if error in db - will include db context
// if error is in writer - it will include its own context
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%v: %v"
,
txni
.
Tid
,
err
)
}
...
...
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