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
c2d692af
Commit
c2d692af
authored
Jul 21, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
459b6060
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+12
-2
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
c2d692af
...
@@ -1049,6 +1049,8 @@ func (fs *FileStorage) Iterate(tidMin, tidMax zodb.Tid) zodb.IStorageIterator {
...
@@ -1049,6 +1049,8 @@ func (fs *FileStorage) Iterate(tidMin, tidMax zodb.Tid) zodb.IStorageIterator {
// ComputeIndex from scratch builds new in-memory index for FileStorage
// ComputeIndex from scratch builds new in-memory index for FileStorage
// XXX naming
// XXX naming
func
(
fs
*
FileStorage
)
ComputeIndex
(
ctx
context
.
Context
)
(
index
*
Index
,
err
error
)
{
func
(
fs
*
FileStorage
)
ComputeIndex
(
ctx
context
.
Context
)
(
index
*
Index
,
err
error
)
{
// TODO err ctx <file>: <reindex>:
// XXX handle ctx cancel
// XXX handle ctx cancel
index
=
IndexNew
()
index
=
IndexNew
()
index
.
TopPos
=
txnValidFrom
index
.
TopPos
=
txnValidFrom
...
@@ -1058,12 +1060,20 @@ func (fs *FileStorage) ComputeIndex(ctx context.Context) (index *Index, err erro
...
@@ -1058,12 +1060,20 @@ func (fs *FileStorage) ComputeIndex(ctx context.Context) (index *Index, err erro
fsSeq
:=
xbufio
.
NewSeqReaderAt
(
fs
.
file
)
fsSeq
:=
xbufio
.
NewSeqReaderAt
(
fs
.
file
)
// pre-setup txnh so that txnh.LoadNext starts loading from the beginning of file
// pre-setup txnh so that txnh.LoadNext starts loading from the beginning of file
txnh
:=
&
TxnHeader
{
Pos
:
0
,
Len
:
index
.
TopPos
,
TxnInfo
:
zodb
.
TxnInfo
{
Tid
:
0
}}
//txnh := &TxnHeader{Pos: 0, Len: index.TopPos, TxnInfo: zodb.TxnInfo{Tid: 0}}
txnh
:=
&
TxnHeader
{
Pos
:
index
.
TopPos
,
Len
:
-
2
}
// XXX -2
dh
:=
&
DataHeader
{}
dh
:=
&
DataHeader
{}
loop
:
loop
:
for
{
for
{
err
=
txnh
.
LoadNext
(
fsSeq
,
LoadNoStrings
)
// XXX merge logic infot LoadNext/LoadPrev
switch
txnh
.
Len
{
case
-
2
:
err
=
txnh
.
Load
(
fsSeq
,
txnh
.
Pos
,
LoadNoStrings
)
default
:
err
=
txnh
.
LoadNext
(
fsSeq
,
LoadNoStrings
)
}
if
err
!=
nil
{
if
err
!=
nil
{
err
=
okEOF
(
err
)
err
=
okEOF
(
err
)
break
break
...
...
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