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
b90ada39
Commit
b90ada39
authored
Jul 27, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3529459c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
20 deletions
+16
-20
go/zodb/pyserialize.go
go/zodb/pyserialize.go
+1
-1
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+6
-12
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+1
-1
go/zodb/storage/fs1/fs1tools/dump.go
go/zodb/storage/fs1/fs1tools/dump.go
+2
-3
go/zodb/storage/fs1/fs1tools/index.go
go/zodb/storage/fs1/fs1tools/index.go
+2
-0
go/zodb/storage/fs1/fs1tools/main.go
go/zodb/storage/fs1/fs1tools/main.go
+1
-1
go/zodb/storage/fs1/py/gen-testdata
go/zodb/storage/fs1/py/gen-testdata
+1
-1
go/zodb/storage/fs1/ztestdata_expect_test.go
go/zodb/storage/fs1/ztestdata_expect_test.go
+1
-1
go/zodb/zodb.go
go/zodb/zodb.go
+1
-0
No files found.
go/zodb/pyserialize.go
View file @
b90ada39
...
...
@@ -27,7 +27,7 @@ import (
pickle
"github.com/kisielk/og-rek"
)
// PyData represent data stored into ZODB by Python applications.
// PyData represent
s
data stored into ZODB by Python applications.
//
// The format is based on python pickles. Basically every serialized object has
// two parts: class description and object state. See
...
...
go/zodb/storage/fs1/filestorage.go
View file @
b90ada39
...
...
@@ -792,7 +792,7 @@ func Iterate(r io.ReaderAt, posStart int64, dir IterDir) *Iter {
case
IterBackward
:
it
.
Txnh
.
LenPrev
=
lenIterStart
default
:
panic
(
"
invalid dir
"
)
panic
(
"
dir invalid
"
)
}
return
it
}
...
...
@@ -1267,9 +1267,7 @@ func (fs *FileStorage) computeIndex(ctx context.Context) (index *Index, err erro
// not want to load actual data - only data headers.
fsSeq
:=
xbufio
.
NewSeqReaderAt
(
fs
.
file
)
// pre-setup txnh so that txnh.LoadNext starts loading from the beginning of file
txnh
:=
&
TxnHeader
{
Pos
:
index
.
TopPos
,
Len
:
lenIterStart
}
dh
:=
&
DataHeader
{}
it
:=
Iterate
(
fsSeq
,
index
.
TopPos
,
IterForward
)
loop
:
for
{
...
...
@@ -1280,7 +1278,7 @@ loop:
default
:
}
err
=
txnh
.
LoadNext
(
fsSeq
,
LoadNoStrings
)
err
=
it
.
NextTxn
(
LoadNoStrings
)
if
err
!=
nil
{
err
=
okEOF
(
err
)
break
...
...
@@ -1288,14 +1286,10 @@ loop:
// XXX check txnh.Status != TxnInprogress
index
.
TopPos
=
txnh
.
Pos
+
txnh
.
Len
// first data iteration will go to first data record
dh
.
Pos
=
txnh
.
DataPos
()
dh
.
DataLen
=
-
DataHeaderSize
index
.
TopPos
=
it
.
Txnh
.
Pos
+
it
.
Txnh
.
Len
for
{
err
=
dh
.
LoadNext
(
fsSeq
,
txnh
)
err
=
it
.
NextData
(
)
if
err
!=
nil
{
err
=
okEOF
(
err
)
if
err
!=
nil
{
...
...
@@ -1304,7 +1298,7 @@ loop:
break
}
index
.
Set
(
dh
.
Oid
,
d
h
.
Pos
)
index
.
Set
(
it
.
Datah
.
Oid
,
it
.
Data
h
.
Pos
)
}
}
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
b90ada39
...
...
@@ -288,7 +288,7 @@ func TestComputeIndex(t *testing.T) {
fs
:=
xfsopen
(
t
,
"testdata/1.fs"
)
// TODO open ro
defer
exc
.
XRun
(
fs
.
Close
)
index
,
err
:=
fs
.
computeIndex
(
context
.
TODO
())
index
,
err
:=
fs
.
computeIndex
(
context
.
Background
())
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
go/zodb/storage/fs1/fs1tools/dump.go
View file @
b90ada39
...
...
@@ -50,13 +50,12 @@ type Dumper interface {
// transaction if it needs to dump information about data records.
//
// If dumper return io.EOF the whole dumping process finishes.
// XXX -> better dedicated err?
DumpTxn
(
buf
*
xfmt
.
Buffer
,
it
*
fs1
.
Iter
)
error
}
// Dump dumps content of a FileStorage file @ path.
// To do so it reads file header and then iterates over all transactions in the file.
// The logic to actually output information and
if needed read/process data
is implemented by Dumper d.
// The logic to actually output information and
, if needed read/process data,
is implemented by Dumper d.
func
Dump
(
w
io
.
Writer
,
path
string
,
dir
fs1
.
IterDir
,
d
Dumper
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"%s: %s"
,
path
,
d
.
DumperName
())
// XXX ok?
...
...
@@ -78,7 +77,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
return
err
}
// make sure to flush buffer
if we return prematurely e.g. with an error
// make sure to flush buffer
on return
defer
func
()
{
err2
:=
flushBuf
()
err
=
xerr
.
First
(
err
,
err2
)
...
...
go/zodb/storage/fs1/fs1tools/
re
index.go
→
go/zodb/storage/fs1/fs1tools/index.go
View file @
b90ada39
...
...
@@ -94,3 +94,5 @@ func reindexMain(argv []string) {
log
.
Fatal
(
err
)
}
}
// TODO verify-index
go/zodb/storage/fs1/fs1tools/main.go
View file @
b90ada39
...
...
@@ -28,7 +28,7 @@ var commands = zodbtools.CommandRegistry{
// + fsstats? (fsstats.py)
{
"reindex"
,
reindexSummary
,
reindexUsage
,
reindexMain
},
// XXX reindex -> reindex, verify-index
{
"verify-index"
,
verifyIdxSummary
,
verifyIdxUsage
,
verifyIdxMaxin
},
// recover (fsrecover.py)
// verify (fstest.py)
...
...
go/zodb/storage/fs1/py/gen-testdata
View file @
b90ada39
...
...
@@ -198,7 +198,7 @@ def main():
with
open
(
"ztestdata_expect_test.go"
,
"w"
)
as
f
:
def
emit
(
v
):
print
>>
f
,
v
emit
(
"// Code generated by %s; DO NOT EDIT."
%
__
nam
e__
)
emit
(
"// Code generated by %s; DO NOT EDIT."
%
__
fil
e__
)
emit
(
"package fs1
\
n
"
)
emit
(
"import
\
"
lab.nexedi.com/kirr/neo/go/zodb
\
"
\
n
"
)
...
...
go/zodb/storage/fs1/ztestdata_expect_test.go
View file @
b90ada39
// Code generated by py/gen-testdata; DO NOT EDIT.
// Code generated by
./
py/gen-testdata; DO NOT EDIT.
package
fs1
import
"lab.nexedi.com/kirr/neo/go/zodb"
...
...
go/zodb/zodb.go
View file @
b90ada39
...
...
@@ -165,6 +165,7 @@ type IStorage interface {
// tpc_finish(txn, callback) XXX clarify about callback
// tpc_abort(txn)
// XXX allow iteration both ways (forward & backward)
// XXX text
Iterate
(
tidMin
,
tidMax
Tid
)
IStorageIterator
// XXX , error ?
}
...
...
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