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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
wcfs/δbtail.go
wcfs/δbtail.go
+17
-3
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
...
@@ -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"
,
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
track
.
parent
,
parent
)
oid
,
track
.
parent
,
parent
)
}
}
if
track
.
trackedKeys
!=
nil
{
// root always covers [-∞, ∞)
track
.
trackedKeys
.
Add
(
key
)
track
.
trackedKeys
.
Add
(
key
)
}
parent
=
oid
parent
=
oid
}
}
...
@@ -297,13 +299,26 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -297,13 +299,26 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
fmt
.
Printf
(
"trackIdx: %v
\n
"
,
δBtail
.
trackIdx
)
fmt
.
Printf
(
"trackIdx: %v
\n
"
,
δBtail
.
trackIdx
)
// {} root -> {oid} changed under that root in tracked set
// {} 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
{}
δZByRoot
:=
map
[
zodb
.
Oid
]
SetOid
{}
for
_
,
oid
:=
range
δZ
.
Changev
{
for
_
,
oid
:=
range
δZ
.
Changev
{
root
s
,
ok
:=
δBtail
.
trackIdx
[
oid
]
root
,
ok
:=
rootOf
(
oid
)
if
!
ok
{
if
!
ok
{
continue
continue
}
}
for
root
:=
range
roots
{
δZT
,
ok
:=
δZByRoot
[
root
]
δZT
,
ok
:=
δZByRoot
[
root
]
if
!
ok
{
if
!
ok
{
δZT
=
SetOid
{}
δZT
=
SetOid
{}
...
@@ -311,7 +326,6 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -311,7 +326,6 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
}
}
δZT
.
Add
(
oid
)
δZT
.
Add
(
oid
)
}
}
}
fmt
.
Println
(
"δZByRoot:"
,
δZByRoot
)
fmt
.
Println
(
"δZByRoot:"
,
δZByRoot
)
δB
:=
ΔB
{
Rev
:
δZ
.
Tid
,
ByRoot
:
make
(
map
[
zodb
.
Oid
]
map
[
Key
]
ΔValue
)}
δB
:=
ΔB
{
Rev
:
δZ
.
Tid
,
ByRoot
:
make
(
map
[
zodb
.
Oid
]
map
[
Key
]
ΔValue
)}
...
...
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