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
ac4ff8df
Commit
ac4ff8df
authored
Aug 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3950de77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
17 deletions
+24
-17
wcfs/δbtail.go
wcfs/δbtail.go
+24
-17
No files found.
wcfs/δbtail.go
View file @
ac4ff8df
...
@@ -373,6 +373,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -373,6 +373,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
tracef
(
"Update δZ: %v
\n
"
,
δZ
.
Changev
)
tracef
(
"Update δZ: %v
\n
"
,
δZ
.
Changev
)
tracef
(
"trackIdx: %v
\n
"
,
δBtail
.
trackIdx
)
tracef
(
"trackIdx: %v
\n
"
,
δBtail
.
trackIdx
)
tracef
(
"holeIdx: %v
\n
"
,
δBtail
.
holeIdx
)
δZTC
,
δtopsByRoot
:=
δBtail
.
δZConnectTracked
(
δZ
)
δZTC
,
δtopsByRoot
:=
δBtail
.
δZConnectTracked
(
δZ
)
...
@@ -633,7 +634,7 @@ func (rs rangeSplit) String() string {
...
@@ -633,7 +634,7 @@ func (rs rangeSplit) String() string {
func
treediff
(
ctx
context
.
Context
,
root
zodb
.
Oid
,
δtops
SetOid
,
δZTC
SetOid
,
trackIdx
map
[
zodb
.
Oid
]
nodeTrack
,
holeIdx
treeSetKey
,
zconnOld
,
zconnNew
*
zodb
.
Connection
)
(
δT
map
[
Key
]
ΔValue
,
err
error
)
{
func
treediff
(
ctx
context
.
Context
,
root
zodb
.
Oid
,
δtops
SetOid
,
δZTC
SetOid
,
trackIdx
map
[
zodb
.
Oid
]
nodeTrack
,
holeIdx
treeSetKey
,
zconnOld
,
zconnNew
*
zodb
.
Connection
)
(
δT
map
[
Key
]
ΔValue
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"treediff %s..%s %s"
,
zconnOld
.
At
(),
zconnNew
.
At
(),
root
)
defer
xerr
.
Contextf
(
&
err
,
"treediff %s..%s %s"
,
zconnOld
.
At
(),
zconnNew
.
At
(),
root
)
tracef
(
"treediff %s δtops: %v δZTC: %v
\n
"
,
root
,
δtops
,
δZTC
)
tracef
(
"
\n
treediff %s δtops: %v δZTC: %v
\n
"
,
root
,
δtops
,
δZTC
)
defer
tracef
(
"
\n
"
)
defer
tracef
(
"
\n
"
)
δT
=
map
[
Key
]
ΔValue
{}
δT
=
map
[
Key
]
ΔValue
{}
...
@@ -742,6 +743,18 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -742,6 +743,18 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Bkqueue
:=
SetKey
{}
// ----//---- in B for δ+
Bkqueue
:=
SetKey
{}
// ----//---- in B for δ+
Akdone
:=
SetKey
{}
// already processed keys in A
Akdone
:=
SetKey
{}
// already processed keys in A
Bkdone
:=
SetKey
{}
// ----//---- in B
Bkdone
:=
SetKey
{}
// ----//---- in B
Aktodo
:=
func
(
k
Key
)
{
if
!
Akdone
.
Has
(
k
)
{
tracef
(
" Akqueue += %d
\n
"
,
k
)
Akqueue
.
Add
(
k
)
}
}
Bktodo
:=
func
(
k
Key
)
{
if
!
Bkdone
.
Has
(
k
)
{
tracef
(
" Bkqueue += %d
\n
"
,
k
)
Bkqueue
.
Add
(
k
)
}
}
// {} oid -> parent for all nodes in Bv: current and previously expanded - up till top B
// {} oid -> parent for all nodes in Bv: current and previously expanded - up till top B
// XXX
// XXX
...
@@ -770,21 +783,21 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -770,21 +783,21 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// Bkqueue <- δA
// Bkqueue <- δA
for
k
:=
range
δA
{
for
k
:=
range
δA
{
Akdone
.
Add
(
k
)
Akdone
.
Add
(
k
)
if
!
Bkdone
.
Has
(
k
)
{
Bktodo
(
k
)
Bkqueue
.
Add
(
k
)
}
}
}
// Bkqueue <- holes(ra.range)
// Bkqueue <- holes(ra.range)
for
k
:=
range
holeIdx
.
GetInRange
(
ra
.
lo
,
ra
.
hi_
)
{
for
k
:=
range
holeIdx
.
GetInRange
(
ra
.
lo
,
ra
.
hi_
)
{
if
!
Bkdone
.
Has
(
k
)
{
Bktodo
(
k
)
Bkqueue
.
Add
(
k
)
}
}
}
ra
.
done
=
true
ra
.
done
=
true
case
*
Tree
:
case
*
Tree
:
// empty tree -
XXX no need to check?
// empty tree -
queue holes covered by it
if
len
(
a
.
Entryv
())
==
0
{
if
len
(
a
.
Entryv
())
==
0
{
for
k
:=
range
holeIdx
.
GetInRange
(
ra
.
lo
,
ra
.
hi_
)
{
Bktodo
(
k
)
}
continue
}
}
// a is normal tree - expand it and queue children
// a is normal tree - expand it and queue children
...
@@ -876,9 +889,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -876,9 +889,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// Akqueue <- δB
// Akqueue <- δB
for
k_
:=
range
δB
{
for
k_
:=
range
δB
{
Bkdone
.
Add
(
k_
)
Bkdone
.
Add
(
k_
)
if
!
Akdone
.
Has
(
k_
)
{
Aktodo
(
k_
)
Akqueue
.
Add
(
k_
)
}
}
}
b
.
done
=
true
b
.
done
=
true
...
@@ -904,15 +915,11 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -904,15 +915,11 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// Bkqueue <- δA
// Bkqueue <- δA
for
k_
:=
range
δA
{
for
k_
:=
range
δA
{
Akdone
.
Add
(
k_
)
Akdone
.
Add
(
k_
)
if
!
Bkdone
.
Has
(
k_
)
{
Bktodo
(
k_
)
Bkqueue
.
Add
(
k_
)
}
}
}
// Bkqueue <- holes(a.range)
// Bkqueue <- holes(a.range)
for
k_
:=
range
holeIdx
.
GetInRange
(
a
.
lo
,
a
.
hi_
)
{
for
k_
:=
range
holeIdx
.
GetInRange
(
a
.
lo
,
a
.
hi_
)
{
if
!
Bkdone
.
Has
(
k_
)
{
Bktodo
(
k_
)
Bkqueue
.
Add
(
k_
)
}
}
}
a
.
done
=
true
a
.
done
=
true
...
...
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