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
af65001c
Commit
af65001c
authored
Jul 01, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Unexprt ΔBroots
parent
fecf1327
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+9
-9
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
af65001c
...
@@ -89,7 +89,7 @@ type ΔBtail struct {
...
@@ -89,7 +89,7 @@ type ΔBtail struct {
// includes all changed objects, not only tracked ones.
// includes all changed objects, not only tracked ones.
δZtail
*
zodb
.
ΔTail
δZtail
*
zodb
.
ΔTail
vδBroots
[]
ΔBroots
// [] (rev↑, roots changed in this rev)
vδBroots
[]
_ΔBroots
// [] (rev↑, roots changed in this rev)
vδTbyRoot
map
[
zodb
.
Oid
]
*
ΔTtail
// {} root -> [] k/v change history; only for keys ∈ tracked subset XXX -> byRoot?
vδTbyRoot
map
[
zodb
.
Oid
]
*
ΔTtail
// {} root -> [] k/v change history; only for keys ∈ tracked subset XXX -> byRoot?
// set of tracked nodes as of @head state.
// set of tracked nodes as of @head state.
...
@@ -124,10 +124,10 @@ type ΔTtail struct {
...
@@ -124,10 +124,10 @@ type ΔTtail struct {
lastRevOf
map
[
Key
]
zodb
.
Tid
// {} key -> last
lastRevOf
map
[
Key
]
zodb
.
Tid
// {} key -> last
}
}
// ΔBroots represents roots-only part of ΔB.
//
_
ΔBroots represents roots-only part of ΔB.
//
//
// It describes which trees were changed, but does not provide δkv details for changed trees.
// It describes which trees were changed, but does not provide δkv details for changed trees.
type
ΔBroots
struct
{
type
_
ΔBroots
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
ΔRoots
setOid
// which roots changed in this revision
ΔRoots
setOid
// which roots changed in this revision
}
}
...
@@ -184,9 +184,9 @@ func (orig *ΔBtail) Clone() *ΔBtail {
...
@@ -184,9 +184,9 @@ func (orig *ΔBtail) Clone() *ΔBtail {
}
}
// vδBroots
// vδBroots
klon
.
vδBroots
=
make
([]
ΔBroots
,
0
,
len
(
orig
.
vδBroots
))
klon
.
vδBroots
=
make
([]
_
ΔBroots
,
0
,
len
(
orig
.
vδBroots
))
for
_
,
origδBroots
:=
range
orig
.
vδBroots
{
for
_
,
origδBroots
:=
range
orig
.
vδBroots
{
klonδBroots
:=
ΔBroots
{
klonδBroots
:=
_
ΔBroots
{
Rev
:
origδBroots
.
Rev
,
Rev
:
origδBroots
.
Rev
,
ΔRoots
:
origδBroots
.
ΔRoots
.
Clone
(),
ΔRoots
:
origδBroots
.
ΔRoots
.
Clone
(),
}
}
...
@@ -598,7 +598,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -598,7 +598,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
for
root
:=
range
δB
.
ΔByRoot
{
for
root
:=
range
δB
.
ΔByRoot
{
δroots
.
Add
(
root
)
δroots
.
Add
(
root
)
}
}
δBtail
.
vδBroots
=
append
(
δBtail
.
vδBroots
,
ΔBroots
{
Rev
:
δB
.
Rev
,
ΔRoots
:
δroots
})
δBtail
.
vδBroots
=
append
(
δBtail
.
vδBroots
,
_
ΔBroots
{
Rev
:
δB
.
Rev
,
ΔRoots
:
δroots
})
return
δB
,
err
return
δB
,
err
}
}
...
@@ -689,10 +689,10 @@ func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) {
...
@@ -689,10 +689,10 @@ func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) {
return
rev
<=
δBtail
.
vδBroots
[
k
]
.
Rev
return
rev
<=
δBtail
.
vδBroots
[
k
]
.
Rev
})
})
if
j
==
l
||
δBtail
.
vδBroots
[
j
]
.
Rev
!=
rev
{
if
j
==
l
||
δBtail
.
vδBroots
[
j
]
.
Rev
!=
rev
{
δBroots
:=
ΔBroots
{
Rev
:
rev
,
ΔRoots
:
setOid
{}}
δBroots
:=
_
ΔBroots
{
Rev
:
rev
,
ΔRoots
:
setOid
{}}
// insert(@j, δBroots)
// insert(@j, δBroots)
δBtail
.
vδBroots
=
append
(
δBtail
.
vδBroots
[
:
j
],
δBtail
.
vδBroots
=
append
(
δBtail
.
vδBroots
[
:
j
],
append
([]
ΔBroots
{
δBroots
},
append
([]
_
ΔBroots
{
δBroots
},
δBtail
.
vδBroots
[
j
:
]
...
)
...
)
δBtail
.
vδBroots
[
j
:
]
...
)
...
)
}
}
δBroots
:=
δBtail
.
vδBroots
[
j
]
δBroots
:=
δBtail
.
vδBroots
[
j
]
...
@@ -719,7 +719,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
...
@@ -719,7 +719,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
}
}
// vδBroots[:icut] should be forgotten
// vδBroots[:icut] should be forgotten
δBtail
.
vδBroots
=
append
([]
ΔBroots
(
nil
),
δBtail
.
vδBroots
[
icut
:
]
...
)
δBtail
.
vδBroots
=
append
([]
_
ΔBroots
(
nil
),
δBtail
.
vδBroots
[
icut
:
]
...
)
// trim roots
// trim roots
for
root
:=
range
totrim
{
for
root
:=
range
totrim
{
...
...
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