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
a6760d8f
Commit
a6760d8f
authored
Jun 23, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
953f1978
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
wcfs/δbtail.go
wcfs/δbtail.go
+16
-5
No files found.
wcfs/δbtail.go
View file @
a6760d8f
...
@@ -605,6 +605,10 @@ func (prs *rangeSplit) GetToBucket(ctx context.Context, k Key) (rbucket *nodeInR
...
@@ -605,6 +605,10 @@ func (prs *rangeSplit) GetToBucket(ctx context.Context, k Key) (rbucket *nodeInR
}
}
func
(
rs
rangeSplit
)
String
()
string
{
func
(
rs
rangeSplit
)
String
()
string
{
if
len
(
rs
)
==
0
{
return
"ø"
}
s
:=
""
s
:=
""
for
_
,
rn
:=
range
rs
{
for
_
,
rn
:=
range
rs
{
if
s
!=
""
{
if
s
!=
""
{
...
@@ -726,7 +730,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -726,7 +730,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Adone
:=
SetKey
{}
// "processed" keys on A
Adone
:=
SetKey
{}
// "processed" keys on A
Bdone
:=
SetKey
{}
// "processed" keys on B
Bdone
:=
SetKey
{}
// "processed" keys on B
if
b
!=
nil
{
if
b
!=
nil
{
// XXX kill (always !nil) ?
// XXX precise range as for a ^^^ ?
// XXX precise range as for a ^^^ ?
btop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
b
}
// [-∞, ∞)
btop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
b
}
// [-∞, ∞)
bv
=
rangeSplit
{
btop
}
bv
=
rangeSplit
{
btop
}
...
@@ -734,7 +738,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -734,7 +738,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// initial phase: expand changed nodes in a till buckets;
// initial phase: expand changed nodes in a till buckets;
// XXX changed buckets -> δ-
// XXX changed buckets -> δ-
if
a
!=
nil
{
if
a
!=
nil
{
// XXX kill (always !nil) ?
// XXX maybe walk till a from root to get more precise initial range?
// XXX maybe walk till a from root to get more precise initial range?
atop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
a
}
// [-∞, ∞)
atop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
a
}
// [-∞, ∞)
av
=
rangeSplit
{
atop
}
av
=
rangeSplit
{
atop
}
...
@@ -771,13 +775,20 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -771,13 +775,20 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return
nil
,
err
return
nil
,
err
}
}
// XXX Adone <- δA
// Adone <- δA
// XXX Bqueue <- δA
// Bqueue <- δA
for
k
:=
range
δA
{
Adone
.
Add
(
k
)
Bqueue
.
Add
(
k
)
}
}
}
}
}
}
}
}
}
fmt
.
Printf
(
" av: %s
\n
"
,
av
)
fmt
.
Printf
(
" bv: %s
\n
"
,
bv
)
// phase 2: iterate through keys queued for A and B, delve into
// 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
...
@@ -916,7 +927,7 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
...
@@ -916,7 +927,7 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
bv
=
b
.
Entryv
()
// key↑
bv
=
b
.
Entryv
()
// key↑
}
}
fmt
.
Printf
(
" av: %s
\n
"
,
vtree
(
av
))
fmt
.
Printf
(
" av: %s
\n
"
,
vtree
(
av
))
fmt
.
Printf
(
" bv: %
v
\n
"
,
vtree
(
bv
))
fmt
.
Printf
(
" bv: %
s
\n
"
,
vtree
(
bv
))
δ
=
map
[
Key
]
ΔValue
{}
δ
=
map
[
Key
]
ΔValue
{}
defer
fmt
.
Printf
(
" -> δt: %v
\n
"
,
δ
)
defer
fmt
.
Printf
(
" -> δt: %v
\n
"
,
δ
)
...
...
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