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
064efa3c
Commit
064efa3c
authored
Jul 07, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8672b6d8
Changes
1
Hide 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 @
064efa3c
...
@@ -90,7 +90,7 @@ type ΔBtail struct {
...
@@ -90,7 +90,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.
...
@@ -125,10 +125,10 @@ type ΔTtail struct {
...
@@ -125,10 +125,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
}
}
...
@@ -185,9 +185,9 @@ func (orig *ΔBtail) Clone() *ΔBtail {
...
@@ -185,9 +185,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
(),
}
}
...
@@ -599,7 +599,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -599,7 +599,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
}
}
...
@@ -690,10 +690,10 @@ func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) {
...
@@ -690,10 +690,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
]
...
@@ -720,7 +720,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
...
@@ -720,7 +720,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