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
5eb50c5f
Commit
5eb50c5f
authored
Jun 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6d77591b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
wcfs/δbtail.go
wcfs/δbtail.go
+23
-9
No files found.
wcfs/δbtail.go
View file @
5eb50c5f
...
...
@@ -257,7 +257,9 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags Track
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
track
.
parent
,
parent
)
}
track
.
trackedKeys
.
Add
(
key
)
if
track
.
trackedKeys
!=
nil
{
// root always covers [-∞, ∞)
track
.
trackedKeys
.
Add
(
key
)
}
parent
=
oid
}
...
...
@@ -297,20 +299,32 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
fmt
.
Printf
(
"trackIdx: %v
\n
"
,
δBtail
.
trackIdx
)
// {} root -> {oid} changed under that root in tracked set
rootOf
:=
func
(
node
zodb
.
Oid
)
(
root
zodb
.
Oid
,
ok
bool
)
{
track
,
ok
:=
δBtail
.
trackIdx
[
node
]
if
!
ok
{
return
zodb
.
InvalidOid
,
false
}
for
track
.
parent
!=
zodb
.
InvalidOid
{
node
=
track
.
parent
track
=
δBtail
.
trackIdx
[
node
]
// must be present
}
return
node
,
true
}
δZByRoot
:=
map
[
zodb
.
Oid
]
SetOid
{}
for
_
,
oid
:=
range
δZ
.
Changev
{
root
s
,
ok
:=
δBtail
.
trackIdx
[
oid
]
root
,
ok
:=
rootOf
(
oid
)
if
!
ok
{
continue
}
for
root
:=
range
roots
{
δZT
,
ok
:=
δZByRoot
[
root
]
if
!
ok
{
δZT
=
SetOid
{}
δZByRoot
[
root
]
=
δZT
}
δZT
.
Add
(
oid
)
δZT
,
ok
:=
δZByRoot
[
root
]
if
!
ok
{
δZT
=
SetOid
{}
δZByRoot
[
root
]
=
δZT
}
δZT
.
Add
(
oid
)
}
fmt
.
Println
(
"δZByRoot:"
,
δZByRoot
)
...
...
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