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
c112b414
Commit
c112b414
authored
Aug 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d3e4212a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
wcfs/δbtail.go
wcfs/δbtail.go
+16
-3
No files found.
wcfs/δbtail.go
View file @
c112b414
...
...
@@ -745,13 +745,13 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Bkdone
:=
SetKey
{}
// ----//---- in B
Aktodo
:=
func
(
k
Key
)
{
if
!
Akdone
.
Has
(
k
)
{
tracef
(
"
Akqueue +=
%d
\n
"
,
k
)
tracef
(
"
Akq <-
%d
\n
"
,
k
)
Akqueue
.
Add
(
k
)
}
}
Bktodo
:=
func
(
k
Key
)
{
if
!
Bkdone
.
Has
(
k
)
{
tracef
(
"
Bkqueue +=
%d
\n
"
,
k
)
tracef
(
"
Bkq <-
%d
\n
"
,
k
)
Bkqueue
.
Add
(
k
)
}
}
...
...
@@ -768,11 +768,14 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// - ac ∉ δZTC && ∃ bc from B: ac.oid == bc.oid (ac was not changed and stays in the tree)
Aq
:=
[]
*
nodeInRange
{
atop
}
// queue for A nodes that contribyte to δ-
for
len
(
Aq
)
>
0
{
tracef
(
"
\n
"
)
tracef
(
" aq: %v
\n
"
,
Aq
)
tracef
(
" av: %s
\n
"
,
Av
)
tracef
(
" bv: %s
\n
"
,
Bv
)
ra
:=
pop
(
&
Aq
)
err
=
ra
.
node
.
PActivate
(
ctx
);
/*X*/
if
err
!=
nil
{
return
nil
,
err
}
defer
ra
.
node
.
PDeactivate
()
tracef
(
" a: %s
\n
"
,
ra
)
switch
a
:=
ra
.
node
.
(
type
)
{
case
*
Bucket
:
...
...
@@ -877,8 +880,15 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// * +B23, ...
tracef
(
"
\n
phase 2:
\n
"
)
for
len
(
Bkqueue
)
>
0
{
tracef
(
"
\n
"
)
tracef
(
" av: %s
\n
"
,
Av
)
tracef
(
" bv: %s
\n
"
,
Bv
)
tracef
(
"
\n
"
)
tracef
(
" Bkq: %s
\n
"
,
Bkqueue
)
for
k
:=
range
Bkqueue
{
b
,
err
:=
Bv
.
GetToLeaf
(
ctx
,
k
);
/*X*/
if
err
!=
nil
{
return
nil
,
err
}
tracef
(
" B k%d -> %s
\n
"
,
k
,
b
)
// +bucket if that bucket is reached for the first time
if
!
b
.
done
{
var
δB
map
[
Key
]
ΔValue
...
...
@@ -903,13 +913,16 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
}
Bkqueue
=
SetKey
{}
tracef
(
"
\n
"
)
tracef
(
" Akq: %s
\n
"
,
Akqueue
)
for
k
:=
range
Akqueue
{
a
,
err
:=
Av
.
GetToLeaf
(
ctx
,
k
);
/*X*/
if
err
!=
nil
{
return
nil
,
err
}
tracef
(
" A k%d -> %s
\n
"
,
k
,
a
)
// -bucket if that bucket is reached for the first time
if
!
a
.
done
{
var
δA
map
[
Key
]
ΔValue
abucket
,
ok
:=
a
.
node
.
(
*
Bucket
)
if
!
ok
{
// !ok means ø tree
if
ok
{
// !ok means ø tree
δA
,
err
=
diffB
(
ctx
,
abucket
,
nil
);
/*X*/
if
err
!=
nil
{
return
nil
,
err
}
}
...
...
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