Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
7973b942
Commit
7973b942
authored
Jun 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f626ec3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+24
-10
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
7973b942
...
@@ -282,7 +282,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
...
@@ -282,7 +282,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
for
root
:=
range
trackNewRoots
{
for
root
:=
range
trackNewRoots
{
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
δtrackSet
,
err
:=
δTtail
.
rebuild
(
δBtail
.
δZtail
,
δBtail
.
db
)
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -298,7 +298,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
...
@@ -298,7 +298,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
// It returns set of nodes that must be added to ΔBtail.trackSet to account for
// It returns set of nodes that must be added to ΔBtail.trackSet to account for
// keys that becomes tracked. Note: this set is potentially wider compared to what was in .trackNew.
// keys that becomes tracked. Note: this set is potentially wider compared to what was in .trackNew.
// XXX place
// XXX place
func
(
δTtail
*
ΔTtail
)
rebuild
(
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
δtrackSet
PPTreeSubSet
,
err
error
)
{
func
(
δTtail
*
ΔTtail
)
rebuild
(
root
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
δtrackSet
PPTreeSubSet
,
err
error
)
{
defer
xerr
.
Context
(
&
err
,
"ΔTtail rebuild"
)
defer
xerr
.
Context
(
&
err
,
"ΔTtail rebuild"
)
// XXX locking
// XXX locking
...
@@ -352,16 +352,23 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
...
@@ -352,16 +352,23 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
break
break
}
}
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
root
}
widenTrackNew
:=
func
()
error
{
// XXX errctx, debug
txn
,
ctx
:=
transaction
.
New
(
context
.
TODO
())
// XXX
defer
txn
.
Abort
()
zhead
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{
At
:
δZtail
.
Head
()});
/*X*/
if
err
!=
nil
{
return
err
}
xtree
,
err
:=
zhead
.
Get
(
ctx
,
root
);
/*X*/
if
err
!=
nil
{
return
err
}
tree
:=
xtree
.
(
*
Tree
)
// must succeed
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
tree
}
V
:=
rangeSplit
{
top
}
V
:=
rangeSplit
{
top
}
for
_
,
r
:=
δtkeycov
.
AllRanges
()
{
for
_
,
r
:=
range
δtkeycov
.
AllRanges
()
{
lo
:=
r
.
lo
lo
:=
r
.
lo
for
{
for
{
b
,
err
:=
V
.
GetToLeaf
(
ctx
,
lo
)
b
,
err
:=
V
.
GetToLeaf
(
ctx
,
lo
);
/*X*/
if
err
!=
nil
{
return
err
}
if
err
!=
nil
{
return
nil
,
err
}
trackNew
.
AddPath
(
b
.
Path
())
trackNew
.
AddPath
(
b
.
Path
())
// continue with next right bucket until r coverage is complete
// continue with next right bucket until r coverage is complete
...
@@ -371,8 +378,16 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
...
@@ -371,8 +378,16 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
lo
=
b
.
hi_
+
1
lo
=
b
.
hi_
+
1
}
}
}
}
return
nil
}
err
:=
widenTrackNew
()
if
err
!=
nil
{
return
nil
,
err
}
}
}
return
trackNew
,
nil
/*
/*
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
...
@@ -384,7 +399,6 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
...
@@ -384,7 +399,6 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
δBtail.trackSet.UnionInplace(trackNew)
δBtail.trackSet.UnionInplace(trackNew)
return δtrackSet, nil
return δtrackSet, nil
*/
*/
return
trackNew
}
}
// rebuild1 rebuilds δT for single δZ.
// rebuild1 rebuilds δT for single δZ.
...
...
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