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
953f1978
Commit
953f1978
authored
Jun 23, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
970d3243
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
wcfs/δbtail.go
wcfs/δbtail.go
+35
-2
No files found.
wcfs/δbtail.go
View file @
953f1978
...
@@ -782,9 +782,14 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -782,9 +782,14 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// 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.
//
// XXX inneficient: we process each key separately, while they can be
// processed in sorted batches.
for
len
(
Aqueue
)
>
0
||
len
(
Bqueue
)
>
0
{
for
len
(
Aqueue
)
>
0
||
len
(
Bqueue
)
>
0
{
// B queue
// expand keys in new δA -> in B till buckets;
// expand keys in new δA -> in B till buckets;
// process B buckets that cover new keys into δ+
// process B buckets that cover new keys into δ+
Aqueue
=
SetKey
{}
for
k
:=
range
Bqueue
{
for
k
:=
range
Bqueue
{
Bdone
.
Add
(
k
)
Bdone
.
Add
(
k
)
bbucket
,
ok
,
err
:=
bv
.
GetToBucket
(
ctx
,
k
)
bbucket
,
ok
,
err
:=
bv
.
GetToBucket
(
ctx
,
k
)
...
@@ -806,14 +811,42 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -806,14 +811,42 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
}
}
// Aqueue <- δB
// Aqueue <- δB
for
k
,
δv
:=
range
δ
{
for
k
:=
range
δB
{
if
!
Adone
.
Has
(
k
)
{
if
!
Adone
.
Has
(
k
)
{
Aqueue
.
Add
(
k
)
Aqueue
.
Add
(
k
)
}
}
}
_
=
δv
}
// A queue
Bqueue
=
SetKey
{}
for
k
:=
range
Aqueue
{
Adone
.
Add
(
k
)
abucket
,
ok
,
err
:=
av
.
GetToBucket
(
ctx
,
k
)
if
!
ok
{
continue
// key not covered
}
}
// XXX check bucket for already "done"
δA
,
err
:=
diffB
(
ctx
,
abucket
.
node
.
(
*
Bucket
),
nil
)
if
err
!=
nil
{
return
nil
,
err
}
// δ <- δA
err
=
δMerge
(
δ
,
δA
)
if
err
!=
nil
{
return
nil
,
err
}
// Bqueue <- δA
for
k
:=
range
δA
{
if
!
Bdone
.
Has
(
k
)
{
Bqueue
.
Add
(
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