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
656ec766
Commit
656ec766
authored
Jun 24, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
92fe0aa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
wcfs/δbtail.go
wcfs/δbtail.go
+18
-9
No files found.
wcfs/δbtail.go
View file @
656ec766
...
...
@@ -598,11 +598,14 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
return
children
}
// GetToBucket returns bucket corresponding to key k.
// While reaching to that bucket, it expands step-by-step trees that are leading to that bucket.
// GetToLeaf returns leaf node corresponding to key k.
//
// Leaf is usually bucket node, but, in the sole single case of empty tree, can be that root tree node.
// GetToLeaf expands step-by-step every tree from where it has to traverse to next depth level.
//
// XXX also return path?
func
(
prs
*
rangeSplit
)
GetTo
Bucket
(
ctx
context
.
Context
,
k
Key
)
(
rbucket
*
nodeInRange
,
ok
bool
,
err
error
)
{
rnode
,
ok
:
=
prs
.
Get_
(
k
)
func
(
prs
*
rangeSplit
)
GetTo
Leaf
(
ctx
context
.
Context
,
k
Key
)
(
rnode
*
nodeInRange
,
ok
bool
,
err
error
)
{
rnode
,
ok
=
prs
.
Get_
(
k
)
if
!
ok
{
return
nil
,
false
,
nil
// key not covered
}
...
...
@@ -620,6 +623,8 @@ func (prs *rangeSplit) GetToBucket(ctx context.Context, k Key) (rbucket *nodeInR
}
defer
rnode
.
node
.
PDeactivate
()
// FIXME ø tree -> don't expand -> tree
children
:=
prs
.
Expand
(
rnode
)
rnode
=
children
.
Get
(
k
)
// k must be there
}
...
...
@@ -872,7 +877,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Aqueue
=
SetKey
{}
for
k
:=
range
Bqueue
{
Bdone
.
Add
(
k
)
b
bucket
,
ok
,
err
:=
bv
.
GetToBucket
(
ctx
,
k
)
b
node
,
ok
,
err
:=
bv
.
GetToLeaf
(
ctx
,
k
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -881,10 +886,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
continue
// key not covered
}
// XXX check for bnode.node.(*Tree) (ø tree case)
// + bucket if not already done
// XXX update track.hole if k not in bbucket
if
!
b
bucket
.
done
{
δB
,
err
:=
diffB
(
ctx
,
nil
,
b
bucket
.
node
.
(
*
Bucket
))
if
!
b
node
.
done
{
δB
,
err
:=
diffB
(
ctx
,
nil
,
b
node
.
node
.
(
*
Bucket
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -902,7 +909,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
}
}
b
bucket
.
done
=
true
b
node
.
done
=
true
}
}
...
...
@@ -911,7 +918,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Bqueue
=
SetKey
{}
for
k
:=
range
Aqueue
{
Adone
.
Add
(
k
)
abucket
,
ok
,
err
:=
av
.
GetTo
Bucket
(
ctx
,
k
)
abucket
,
ok
,
err
:=
av
.
GetTo
Leaf
(
ctx
,
k
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -920,6 +927,8 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
continue
// key not covered
}
// XXX check for anode.node.(*Tree) (ø tree case)
// - bucket if not already done
// XXX also extract holes
if
!
abucket
.
done
{
...
...
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