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
e09b503e
Commit
e09b503e
authored
Jun 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2f9a46eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+25
-21
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
e09b503e
...
@@ -329,8 +329,8 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
...
@@ -329,8 +329,8 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
// go backwards and merge vδT <- treediff(lo..hi/trackNew)
// go backwards and merge vδT <- treediff(lo..hi/trackNew)
vδZ
:=
δZtail
.
Data
()
vδZ
:=
δZtail
.
Data
()
for
{
for
{
δtkeycov
:=
&
RangedKeySet
{}
// all keys coming into tracking set during this lo
..
hi scan
δtkeycov
:=
&
RangedKeySet
{}
// all keys coming into tracking set during this lo
<-
hi scan
trackNewCur
:=
trackNew
.
Clone
()
// trackNew adjusted when going to i<- entry
trackNewCur
:=
trackNew
.
Clone
()
// trackNew adjusted
as of
when going to i<- entry
for
i
:=
len
(
vδZ
)
-
1
;
i
>=
0
;
i
--
{
for
i
:=
len
(
vδZ
)
-
1
;
i
>=
0
;
i
--
{
δZ
:=
vδZ
[
i
]
δZ
:=
vδZ
[
i
]
...
@@ -576,27 +576,36 @@ if XXX_killWhenRebuildWorks {
...
@@ -576,27 +576,36 @@ if XXX_killWhenRebuildWorks {
tracefΔBtail
(
"
\n
-> root<%s> δkv: %v δtrack: %v δtkeycov: %v
\n
"
,
root
,
δT
,
δtrack
,
δtkeycov
)
tracefΔBtail
(
"
\n
-> root<%s> δkv: %v δtrack: %v δtkeycov: %v
\n
"
,
root
,
δT
,
δtrack
,
δtkeycov
)
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
if
len
(
δT
)
>
0
{
// an object might be resaved without change
if
len
(
δT
)
>
0
{
// an object might be resaved without change
δB
.
ΔByRoot
[
root
]
=
δT
δB
.
ΔByRoot
[
root
]
=
δT
// XXX after rebuild
δTtail
,
ok
:=
δBtail
.
vδTbyRoot
[
root
]
δTtail
.
vδT
=
append
(
δTtail
.
vδT
,
ΔTree
{
Rev
:
δZ
.
Tid
,
ΔKV
:
δT
})
if
!
ok
{
// XXX should not happen (only roots requested to be present are present in δ)
// this root was not tracked before -> create δTtail for it with empty changes
δTtail
=
newΔTtail
()
δBtail
.
vδTbyRoot
[
root
]
=
δTtail
}
}
δTtail
.
vδT
=
append
(
δTtail
.
vδT
,
ΔTree
{
Rev
:
δZ
.
Tid
,
ΔKV
:
δT
}
)
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
// XXX rebuild KVAtTail
// δtkeycov != ø -> rebuild δTtail
// XXX rebuild lastRevOf
//
// XXX NOTE `len(δZtail) > 1` check is not only optimization - it is
// important for tests: xverifyΔBTail_Update calls ΔBtail._Update with
// only one revision inside δZtail, and this way also directly exercises
// treediff. Should we drop `len(δZtail) > 1` check here, that test will
// no longer directly exercise treediff behaviour.
if
!
δtkeycov
.
Empty
()
&&
δBtail
.
δZtail
.
Len
()
>
1
{
δTtail
.
trackNew
=
...
// ~δtkeycov
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
if
err
!=
nil
{
return
ΔB
{},
δTKeyCov
,
err
}
}
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
δBtail
.
trackSet
.
UnionInplace
(
δtrackSet
)
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
// XXX Update δTKeyCov? XXX or it is needed only to be returned
// from treediff?
}
// XXX if δtkeycov != ø && len(δZtail) > 1 -> rebuild δTtail
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
// XXX after rebuild
// XXX do this
// XXX rebuild KVAtTail
// XXX rebuild lastRevOf
}
}
return
δB
,
δTKeyCov
,
nil
return
δB
,
δTKeyCov
,
nil
...
@@ -610,11 +619,6 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
...
@@ -610,11 +619,6 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
}
}
// update brings .δBtail up to date by recomputing diff XXX and taking new
// entries in .δZtail into account.
// func (δBtail *ΔBtail) update() XXX kill
// Get returns root[key] as of @at database state plus revision that changed it.
// Get returns root[key] as of @at database state plus revision that changed it.
//
//
// if revExact=False - rev is upper estimate for the revision.
// if revExact=False - rev is upper estimate for the revision.
...
...
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