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
a39d91af
Commit
a39d91af
authored
Jun 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4fe7b39c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+36
-17
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+1
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
a39d91af
...
...
@@ -313,31 +313,49 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
// go backwards and merge vδT <- treediff(lo..hi/trackNew)
vδZ
:=
δZtail
.
Data
()
// vδtrack := []*ΔPPTreeSubSet{}
for
i
:=
len
(
vδZ
)
-
1
;
i
>=
0
;
i
--
{
δZ
:=
vδZ
[
i
]
for
{
δtkeycov
:=
&
RangedKeySet
{}
// all keys coming into tracking set during this lo..hi scan
trackNewCur
:=
trackNew
.
Clone
()
for
i
:=
len
(
vδZ
)
-
1
;
i
>=
0
;
i
--
{
δZ
:=
vδZ
[
i
]
// XXX dup wrt Update?
var
atPrev
zodb
.
Tid
if
i
>
0
{
atPrev
=
vδZ
[
i
-
1
]
.
Rev
}
else
{
atPrev
=
δZtail
.
Tail
()
}
// XXX dup wrt Update?
δtrackNew
,
δtkeycov_
,
err
:=
δTtail
.
rebuild1
(
atPrev
,
δZ
,
trackNewCur
,
db
)
if
err
!=
nil
{
return
nil
,
err
}
var
atPrev
zodb
.
Tid
if
i
>
0
{
atPrev
=
vδZ
[
i
-
1
]
.
Rev
}
else
{
atPrev
=
δZtail
.
Tail
()
trackNewCur
.
ApplyΔ
(
δtrackNew
)
δtkeycov
.
UnionInplace
(
δtkeycov_
)
// XXX update .KVAtTail, .lastRevOf
}
δtrackNew
,
δtkeycov
,
err
:=
δTtail
.
rebuild1
(
atPrev
,
δZ
,
trackNew
,
db
)
if
err
!=
nil
{
return
nil
,
err
// an iteration closer to tail may turn out to add a key to the tracking set
// we have to recheck all entries past that revision for changes to that key
// for example:
//
// XXX
//
// restart from head and cycle until set of tracked keys does not grow anymore
if
δtkeycov
.
Empty
()
{
break
}
trackNew
.
ApplyΔ
(
δtrackNew
)
// FIXME use δtkeycov to recompute track coverage
_
=
δtkeycov
for
_
,
r
:=
δtkeycov
.
AllRanges
()
{
}
// XXX update .KVAtTail, .lastRevOf
}
/*
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
// Remap it back to @head and merge to .trackSet
...
...
@@ -346,8 +364,9 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
trackNew.ApplyΔ(δtrack)
}
δBtail.trackSet.UnionInplace(trackNew)
*/
return δtrackSet, nil
*/
return
trackNew
}
// rebuild1 rebuilds δT for single δZ.
...
...
wcfs/internal/zdata/δftail.go
View file @
a39d91af
...
...
@@ -160,7 +160,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb
// XXX blk = ∞ from beginning ?
blk
=
xbtree
.
KeyMax
}
err
:=
δFtail
.
δBtail
.
Track
(
blk
,
zblk
!=
nil
,
path
)
err
:=
δFtail
.
δBtail
.
Track
(
blk
,
path
)
if
err
!=
nil
{
panic
(
err
)
// XXX -> error? errctx
}
...
...
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