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
f9b4fc6f
Commit
f9b4fc6f
authored
Jul 25, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b04cd609
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+15
-9
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
f9b4fc6f
...
...
@@ -894,6 +894,7 @@ func (fs *FileStorage) Load(xid zodb.Xid) (data []byte, tid zodb.Tid, err error)
// --- raw iteration ---
/*
// TxnIter is iterator over transaction records
type TxnIter struct {
fsSeq *xbufio.SeqReaderAt
...
...
@@ -909,28 +910,36 @@ type DataIter struct {
Txnh *TxnHeader // header of transaction we are iterating inside
Datah DataHeader // current data record information
}
*/
// Iter is combined 2-level iterator over transaction and data records
type
Iter
struct
{
TxnIter
DataIter
fsSeq
*
xbufio
.
SeqReaderAt
Flags
iterFlags
// XXX iterate forward (> 0) / backward (< 0) / EOF reached (== 0)
Txnh
TxnHeader
// current transaction record information
Datah
DataHeader
// current data record information
}
// NextTxn iterates to next/previous transaction record according to iteration direction
func
(
ti
*
Txn
Iter
)
NextTxn
(
flags
TxnLoadFlags
)
error
{
func
(
it
*
Iter
)
NextTxn
(
flags
TxnLoadFlags
)
error
{
var
err
error
if
ti
.
Flags
&
iterDir
!=
0
{
err
=
ti
.
Txnh
.
LoadNext
(
ti
.
fsSeq
,
flags
)
err
=
it
.
Txnh
.
LoadNext
(
ti
.
fsSeq
,
flags
)
}
else
{
err
=
ti
.
Txnh
.
LoadPrev
(
ti
.
fsSeq
,
flags
)
err
=
it
.
Txnh
.
LoadPrev
(
ti
.
fsSeq
,
flags
)
}
//fmt.Println("loaded:", ti.Txnh.Tid)
return
err
// set .Datah to iterate over .Txnh
it
.
Datah
.
Pos
=
fsi
.
txnIter
.
Txnh
.
DataPos
()
it
.
Datah
.
DataLen
=
-
DataHeaderSize
// first iteration will go to first data record
}
// NextData iterates to next data record header
// NextData iterates to next data record header
inside current transaction
func
(
di
*
DataIter
)
NextData
()
error
{
return
di
.
Datah
.
LoadNext
(
di
.
fsSeq
,
di
.
Txnh
)
}
...
...
@@ -942,9 +951,6 @@ func (iter *Iter) NextTxn() error {
return
err
}
// set .DataIter to iterate over .TxnIter.Txnh
iter
.
DataIter
.
Datah
.
Pos
=
fsi
.
txnIter
.
Txnh
.
DataPos
()
iter
.
DataIter
.
Datah
.
DataLen
=
-
DataHeaderSize
// first iteration will go to first data record
}
// IterateRaw ... XXX
...
...
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