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
7df766ea
Commit
7df766ea
authored
Jun 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c5c67e47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+26
-9
No files found.
wcfs/δbtail_test.go
View file @
7df766ea
...
...
@@ -463,19 +463,30 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
// verify transition at1->at2 for all initial states of tracked {keys} from kv1 + kv2 + ∞
allKeys
:=
SetKey
{};
allKeys
.
Add
(
kInf
)
// inf, simulating ZBigFile.Size() query
for
_
,
b
:=
range
xkv1
{
for
k
:=
range
b
.
kv
{
allKeys
.
Add
(
k
)
}}
for
_
,
b
:=
range
xkv2
{
for
k
:=
range
b
.
kv
{
allKeys
.
Add
(
k
)
}}
maxk1
:=
-
kInf
;
maxk2
:=
-
kInf
for
_
,
b
:=
range
xkv1
{
for
k
:=
range
b
.
kv
{
allKeys
.
Add
(
k
)
if
k
>
maxk1
{
maxk1
=
k
}
}}
for
_
,
b
:=
range
xkv2
{
for
k
:=
range
b
.
kv
{
allKeys
.
Add
(
k
)
if
k
>
maxk2
{
maxk2
=
k
}
}}
allKeyv
:=
allKeys
.
Elements
()
sort
.
Slice
(
allKeyv
,
func
(
i
,
j
int
)
bool
{
return
allKeyv
[
i
]
<
allKeyv
[
j
]
})
// maxkey among kv1+kv2
// it must be present in δB if maxkey tracking is requested.
maxKey
:=
maxk1
;
if
maxk2
>
maxk1
{
maxKey
=
maxk2
}
/*
maxKey := -kInf
if l := len(allKeyv); l > 0 {
maxKey = allKeyv[l-1] // FIXME always returns kInf -> rework to be real maxkey
}
*/
// {} k -> adjacent keys. if k is tracked -> changes to adjacents must be in δT.
kadj
:=
map
[
Key
]
SetKey
{}
...
...
@@ -483,16 +494,22 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
ka
:=
SetKey
{}
if
k
==
kInf
{
// XXX update with
// xkv1[maxk1]
// xkv2[maxk2]
// btree grows and maxkey tracked: maxkey from kv2 must be in δT
if
maxk2
>
maxk1
{
kb
:=
xkv2
.
Get
(
maxk2
)
for
k
:=
range
kb
.
kv
{
ka
.
Add
(
k
)
}
// no xkv1[maxk1]
// btree shrinks and maxkey tracked:
}
else
{
// XXX correct?
for
k
:=
range
xkv1
.
Get
(
maxk1
)
.
kv
{
ka
.
Add
(
k
)
}
for
k
:=
range
xkv2
.
Get
(
maxk2
)
.
kv
{
ka
.
Add
(
k
)
}
}
}
else
{
// XXX correct?
kb
:=
xkv1
.
Get
(
k
)
for
k
:=
range
kb
.
kv
{
ka
.
Add
(
k
)
}
//// XXX correct?
//ka.Update(xkv1[k])
//ka.Update(xkv2[k])
}
kadj
[
k
]
=
ka
...
...
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