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
2ebe0d64
Commit
2ebe0d64
authored
Mar 23, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X use SeqBufReader when iterating - syscalls are gone from z/rust/fsiter profile
parent
06a97e5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
t/neo/storage/fs1/filestorage.go
t/neo/storage/fs1/filestorage.go
+11
-8
No files found.
t/neo/storage/fs1/filestorage.go
View file @
2ebe0d64
...
...
@@ -812,7 +812,7 @@ const (
// txnIter is iterator over transaction records
type
txnIter
struct
{
fs
*
FileStorage
fs
Seq
*
SeqBufReader
Txnh
TxnHeader
// current transaction information
TidStop
zodb
.
Tid
// iterate up to tid <= tidStop | tid >= tidStop depending on .dir
...
...
@@ -822,7 +822,7 @@ type txnIter struct {
// dataIter is iterator over data records inside one transaction
type
dataIter
struct
{
fs
*
FileStorage
fs
Seq
*
SeqBufReader
Txnh
*
TxnHeader
// header of transaction we are iterating inside
Datah
DataHeader
...
...
@@ -852,9 +852,9 @@ func (ti *txnIter) NextTxn(flags TxnLoadFlags) error {
default
:
var
err
error
if
ti
.
Flags
&
iterDir
!=
0
{
err
=
ti
.
Txnh
.
LoadNext
(
ti
.
fs
.
file
,
flags
)
err
=
ti
.
Txnh
.
LoadNext
(
ti
.
fs
Seq
,
flags
)
}
else
{
err
=
ti
.
Txnh
.
LoadPrev
(
ti
.
fs
.
file
,
flags
)
err
=
ti
.
Txnh
.
LoadPrev
(
ti
.
fs
Seq
,
flags
)
}
// XXX EOF ^^^ is not expected (range pre-cut to valid tids) ?
...
...
@@ -877,7 +877,7 @@ func (ti *txnIter) NextTxn(flags TxnLoadFlags) error {
}
func
(
di
*
dataIter
)
NextData
()
(
*
zodb
.
StorageRecordInformation
,
error
)
{
err
:=
di
.
Datah
.
LoadNext
(
di
.
fs
.
file
,
di
.
Txnh
)
err
:=
di
.
Datah
.
LoadNext
(
di
.
fs
Seq
,
di
.
Txnh
)
if
err
!=
nil
{
return
nil
,
err
// XXX recheck
}
...
...
@@ -887,7 +887,7 @@ func (di *dataIter) NextData() (*zodb.StorageRecordInformation, error) {
dh
:=
di
.
Datah
di
.
sri
.
Data
=
di
.
dataBuf
err
=
dh
.
LoadData
(
di
.
fs
.
file
,
&
di
.
sri
.
Data
)
err
=
dh
.
LoadData
(
di
.
fs
Seq
,
&
di
.
sri
.
Data
)
if
err
!=
nil
{
return
nil
,
err
// XXX recheck
}
...
...
@@ -927,8 +927,11 @@ func (fs *FileStorage) Iterate(tidMin, tidMax zodb.Tid) zodb.IStorageIterator {
// XXX naming
Iter
:=
iterator
{}
Iter
.
txnIter
.
fs
=
fs
Iter
.
dataIter
.
fs
=
fs
// when iterating use IO optimized for sequential access
fsSeq
:=
NewSeqBufReader
(
fs
.
file
)
Iter
.
txnIter
.
fsSeq
=
fsSeq
Iter
.
dataIter
.
fsSeq
=
fsSeq
Iter
.
dataIter
.
Txnh
=
&
Iter
.
txnIter
.
Txnh
if
tidMin
>
tidMax
{
...
...
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