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
3fe38ee3
Commit
3fe38ee3
authored
Jul 03, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c4a49a11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
3 deletions
+86
-3
wcfs/δbtail.go
wcfs/δbtail.go
+86
-3
No files found.
wcfs/δbtail.go
View file @
3fe38ee3
...
@@ -797,7 +797,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -797,7 +797,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
tracef
(
" av: %s
\n
"
,
av
)
tracef
(
" av: %s
\n
"
,
av
)
tracef
(
" bv: %s
\n
"
,
bv
)
tracef
(
" bv: %s
\n
"
,
bv
)
// phase 2: iterate through keys queued for A and B, delve into
//
XXX
phase 2: iterate through keys queued for A and B, delve into
// corresponding nodes, and merge diff generated from them into δ.
// corresponding nodes, and merge diff generated from them into δ.
// Each delve for A or B, potentially adds new keys to process on the
// Each delve for A or B, potentially adds new keys to process on the
// other side.
// other side.
...
@@ -813,8 +813,91 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -813,8 +813,91 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// A queue
// A queue
// Bqueue = SetKey{}
// Bqueue = SetKey{}
for
len
(
Aqueue
)
>
0
{
for
len
(
Aqueue
)
>
0
{
Xa
:=
pop
(
&
Aqueue
)
anode
:=
pop
(
&
Aqueue
)
tracef
(
" A %v
\n
"
,
Xa
)
tracef
(
" A %v
\n
"
,
anode
)
// anode is a node from A.
// it can potentially contribute to -δA if
// - Xa ∈ Tracked ∈ δZTC
// - Xa ∈ Tracked _and_ is no longer referenced
interesting
:=
false
if
δZTC
.
Has
(
anode
.
node
.
POid
())
{
interesting
=
true
}
// XXX "no longer referenced"
if
!
interesting
{
continue
}
// anode can potentially contribute to -δA
// - tree: expand and queue its children
// - bucket: -δA += anode
switch
node
:=
anode
.
node
.
(
type
)
{
case
*
Tree
:
err
=
node
.
PActivate
(
ctx
);
if
err
!=
nil
{
return
nil
,
err
}
defer
node
.
PDeactivate
()
// empty tree - do not expand into bucket - only process tracked holes
if
len
(
node
.
Entryv
())
==
0
{
// XXX dup wrt bucket processing?
δA
:=
map
[
Key
]
ΔValue
{}
track
,
ok
:=
trackIdx
[
node
.
POid
()]
if
!
ok
{
panicf
(
"%s ∈ δZTC, but ∉ trackIdx"
,
vnode
(
node
))
}
for
k
:=
range
track
.
holes
{
δA
[
k
]
=
ΔValue
{
VDEL
,
VDEL
}
// ø->ø indicates hole
}
// δ <- δA
err
=
δMerge
(
δ
,
δA
)
if
err
!=
nil
{
return
nil
,
err
}
/*
// Adone <- δA
// Bqueue <- δA
for k := range δA {
Adone.Add(k)
Bqueue.Add(k)
}
*/
anode
.
done
=
true
continue
}
av
.
Expand
(
anode
)
case
*
Bucket
:
δA
,
err
:=
diffB
(
ctx
,
node
,
nil
)
if
err
!=
nil
{
return
nil
,
err
}
// XXX also extract holes
// δ <- δA
err
=
δMerge
(
δ
,
δA
)
if
err
!=
nil
{
return
nil
,
err
}
/*
// Adone <- δA
// Bqueue <- δA
for k_ := range δA {
Adone.Add(k_)
if !Bdone.Has(k_) {
Bqueue.Add(k_)
}
}
*/
anode
.
done
=
true
}
/*
/*
anode, ok, err := av.GetToLeaf(ctx, k)
anode, ok, err := av.GetToLeaf(ctx, k)
...
...
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