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
e215d7e6
Commit
e215d7e6
authored
Jun 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
011fafc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
wcfs/δbtail.go
wcfs/δbtail.go
+17
-12
No files found.
wcfs/δbtail.go
View file @
e215d7e6
...
@@ -40,6 +40,7 @@ type Tree = btree.LOBTree
...
@@ -40,6 +40,7 @@ type Tree = btree.LOBTree
type
Bucket
=
btree
.
LOBucket
type
Bucket
=
btree
.
LOBucket
type
Node
=
btree
.
LONode
type
Node
=
btree
.
LONode
type
TreeEntry
=
btree
.
LOEntry
type
BucketEntry
=
btree
.
LOBucketEntry
type
BucketEntry
=
btree
.
LOBucketEntry
type
Key
=
int64
type
Key
=
int64
...
@@ -417,20 +418,25 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
...
@@ -417,20 +418,25 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
func
diffT
(
ctx
context
.
Context
,
a
,
b
*
Tree
,
δZTC
SetOid
)
(
δ
map
[
Key
]
Value
,
err
error
)
{
func
diffT
(
ctx
context
.
Context
,
a
,
b
*
Tree
,
δZTC
SetOid
)
(
δ
map
[
Key
]
Value
,
err
error
)
{
fmt
.
Printf
(
" T %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
fmt
.
Printf
(
" T %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffT %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffT %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
if
a
.
POid
()
!=
b
.
POid
()
{
if
(
a
!=
nil
&&
b
!=
nil
)
&&
(
a
.
POid
()
!=
b
.
POid
())
{
panic
(
"different trees"
)
panic
(
"different trees"
)
}
}
// XXX a/b = nil - means del/add -> handle
var
av
[]
TreeEntry
var
bv
[]
TreeEntry
err
=
a
.
PActivate
(
ctx
);
if
err
!=
nil
{
return
nil
,
err
}
if
a
!=
nil
{
defer
a
.
PDeactivate
()
err
=
a
.
PActivate
(
ctx
);
if
err
!=
nil
{
return
nil
,
err
}
err
=
b
.
PActivate
(
ctx
);
if
err
!=
nil
{
return
nil
,
err
}
defer
a
.
PDeactivate
()
defer
b
.
PDeactivate
()
av
=
a
.
Entryv
()
// key↑
}
if
b
!=
nil
{
err
=
b
.
PActivate
(
ctx
);
if
err
!=
nil
{
return
nil
,
err
}
defer
b
.
PDeactivate
()
bv
=
b
.
Entryv
()
// key↑
}
av
:=
a
.
Entryv
()
// key↑
δ
=
map
[
Key
]
Value
{}
bv
:=
b
.
Entryv
()
// key↑
δ
=
map
[
Key
]
Value
{}
// [i].Key ≤ [i].Child.*.Key < [i+1].Key i ∈ [0, len([]))
// [i].Key ≤ [i].Child.*.Key < [i+1].Key i ∈ [0, len([]))
//
//
...
@@ -494,11 +500,10 @@ func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]Value, err error) {
...
@@ -494,11 +500,10 @@ func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]Value, err error) {
fmt
.
Printf
(
" B %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
fmt
.
Printf
(
" B %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffB %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffB %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
if
a
.
POid
()
!=
b
.
POid
(
)
{
if
(
a
!=
nil
&&
b
!=
nil
)
&&
(
a
.
POid
()
!=
b
.
POid
()
)
{
panic
(
"different buckets"
)
panic
(
"different buckets"
)
}
}
// XXX a/b = nil - means del/add -> handle
var
av
[]
BucketEntry
var
av
[]
BucketEntry
var
bv
[]
BucketEntry
var
bv
[]
BucketEntry
...
...
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