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
92fe0aa7
Commit
92fe0aa7
authored
Jun 24, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
10ca3c4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
34 deletions
+55
-34
wcfs/δbtail.go
wcfs/δbtail.go
+55
-34
No files found.
wcfs/δbtail.go
View file @
92fe0aa7
...
...
@@ -516,6 +516,7 @@ func (δBtail *ΔBtail) δZConnectTracked(δZv *zodb.EventCommit) (δZTC SetOid,
type
nodeInRange
struct
{
lo
,
hi_
Key
// [lo, hi_] NOTE _not_ hi) not to overflow at ∞
node
Node
done
bool
// whether this node was already taken into account while computing diff
}
// rangeSplit represents set of nodes covering a range.
...
...
@@ -583,7 +584,11 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
hi_
=
treev
[
i
+
1
]
.
Key
()
-
1
// NOTE -1
}
children
=
append
(
children
,
&
nodeInRange
{
lo
,
hi_
,
treev
[
i
]
.
Child
()})
children
=
append
(
children
,
&
nodeInRange
{
lo
:
lo
,
hi_
:
hi_
,
node
:
treev
[
i
]
.
Child
(),
})
}
// fmt.Printf("E children: %s\n", children)
...
...
@@ -793,6 +798,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Bqueue
.
Add
(
k
)
}
arn
.
done
=
true
continue
}
...
...
@@ -837,6 +843,8 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Adone
.
Add
(
k
)
Bqueue
.
Add
(
k
)
}
rchild
.
done
=
true
}
}
}
...
...
@@ -865,28 +873,36 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
for
k
:=
range
Bqueue
{
Bdone
.
Add
(
k
)
bbucket
,
ok
,
err
:=
bv
.
GetToBucket
(
ctx
,
k
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
ok
{
// FIXME -> key must be included into some node.hole
continue
// key not covered
}
// XXX check bucket for already "done" (i.e. taken into account)
δB
,
err
:=
diffB
(
ctx
,
nil
,
bbucket
.
node
.
(
*
Bucket
))
if
err
!=
nil
{
return
nil
,
err
}
// + bucket if not already done
// XXX update track.hole if k not in bbucket
if
!
bbucket
.
done
{
δB
,
err
:=
diffB
(
ctx
,
nil
,
bbucket
.
node
.
(
*
Bucket
))
if
err
!=
nil
{
return
nil
,
err
}
// δ <- δB
err
=
δMerge
(
δ
,
δB
)
if
err
!=
nil
{
return
nil
,
err
}
// δ <- δB
err
=
δMerge
(
δ
,
δB
)
if
err
!=
nil
{
return
nil
,
err
}
// Aqueue <- δB
for
k
:=
range
δB
{
if
!
Adone
.
Has
(
k
)
{
Aqueue
.
Add
(
k
)
// Aqueue <- δB
for
k
:=
range
δB
{
if
!
Adone
.
Has
(
k
)
{
Aqueue
.
Add
(
k
)
}
}
bbucket
.
done
=
true
}
}
...
...
@@ -896,35 +912,40 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
for
k
:=
range
Aqueue
{
Adone
.
Add
(
k
)
abucket
,
ok
,
err
:=
av
.
GetToBucket
(
ctx
,
k
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
ok
{
// FIXME -> key must be included into some node.hole
continue
// key not covered
}
// XXX check bucket for already "done"
δA
,
err
:=
diffB
(
ctx
,
abucket
.
node
.
(
*
Bucket
),
nil
)
if
err
!=
nil
{
return
nil
,
err
}
// - bucket if not already done
// XXX also extract holes
if
!
abucket
.
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
}
// δ <- δA
err
=
δMerge
(
δ
,
δA
)
if
err
!=
nil
{
return
nil
,
err
}
// Bqueue <- δA
for
k
:=
range
δA
{
if
!
Bdone
.
Has
(
k
)
{
Bqueue
.
Add
(
k
)
// Bqueue <- δA
for
k
:=
range
δA
{
if
!
Bdone
.
Has
(
k
)
{
Bqueue
.
Add
(
k
)
}
}
abucket
.
done
=
true
}
}
}
return
δ
,
nil
}
...
...
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