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
8b548533
Commit
8b548533
authored
Apr 28, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
df8d0694
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
wcfs/δbtail.go
wcfs/δbtail.go
+1
-0
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+28
-7
No files found.
wcfs/δbtail.go
View file @
8b548533
...
@@ -498,6 +498,7 @@ func (tidx trackIndex) AddPath(path []zodb.Oid) {
...
@@ -498,6 +498,7 @@ func (tidx trackIndex) AddPath(path []zodb.Oid) {
// rebuild rebuilds ΔBtree taking trackNew requests into account. XXX
// rebuild rebuilds ΔBtree taking trackNew requests into account. XXX
// XXX place
// XXX place
func
(
δBtail
*
ΔBtail
)
rebuild
()
{
func
(
δBtail
*
ΔBtail
)
rebuild
()
{
return
panic
(
"TODO"
)
panic
(
"TODO"
)
}
}
...
...
wcfs/δbtail_test.go
View file @
8b548533
...
@@ -794,7 +794,6 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
...
@@ -794,7 +794,6 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
// t0->t1 exercises from-scratch rebuild,
// t0->t1 exercises from-scratch rebuild,
// t1->t2 further exercises incremental rebuild.
// t1->t2 further exercises incremental rebuild.
func
xverifyΔBTail_rebuild
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
t0
,
t1
,
t2
*
tTreeCommit
)
{
func
xverifyΔBTail_rebuild
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
t0
,
t1
,
t2
*
tTreeCommit
)
{
return
tAllKeys
:=
allTestKeys
(
t0
,
t1
,
t2
)
tAllKeys
:=
allTestKeys
(
t0
,
t1
,
t2
)
tAllKeyv
:=
tAllKeys
.
SortedElements
()
tAllKeyv
:=
tAllKeys
.
SortedElements
()
...
@@ -810,6 +809,14 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
...
@@ -810,6 +809,14 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
fmt
.
Printf
(
"@%s: %v
\n
"
,
xat
[
t1
.
at
],
xkvFlatten
(
t1
.
xkv
))
fmt
.
Printf
(
"@%s: %v
\n
"
,
xat
[
t1
.
at
],
xkvFlatten
(
t1
.
xkv
))
fmt
.
Printf
(
"@%s: %v
\n
"
,
xat
[
t2
.
at
],
xkvFlatten
(
t2
.
xkv
))
fmt
.
Printf
(
"@%s: %v
\n
"
,
xat
[
t2
.
at
],
xkvFlatten
(
t2
.
xkv
))
d01
:=
kvdiff
(
xkvFlatten
(
t0
.
xkv
),
xkvFlatten
(
t1
.
xkv
))
d12
:=
kvdiff
(
xkvFlatten
(
t1
.
xkv
),
xkvFlatten
(
t2
.
xkv
))
kadj01
:=
KAdj
(
t0
,
t1
)
// FIXME for all keys from t0,t1,t2
kadj12
:=
KAdj
(
t1
,
t2
)
// FIXME for all keys from t0,t1,t2
ø
:=
SetKey
{}
// verify t0 -> t1 Track(keys1) -> t2 Track(keys2)
// verify t0 -> t1 Track(keys1) -> t2 Track(keys2)
// for all combinations of keys1 and keys2
// for all combinations of keys1 and keys2
for
k1idx
:=
range
IntSets
(
len
(
tAllKeyv
))
{
for
k1idx
:=
range
IntSets
(
len
(
tAllKeyv
))
{
...
@@ -818,14 +825,27 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
...
@@ -818,14 +825,27 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
keys1
.
Add
(
tAllKeyv
[
idx1
])
keys1
.
Add
(
tAllKeyv
[
idx1
])
}
}
t
.
Run
(
fmt
.
Sprintf
(
"
%s→%s;track=%s;rebuild
"
,
t0
.
tree
,
t1
.
tree
,
keys1
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
"
rebuild/%s→%s;track=%s;R
"
,
t0
.
tree
,
t1
.
tree
,
keys1
),
func
(
t
*
testing
.
T
)
{
δbtail
:=
NewΔBtail
(
t0
.
at
,
db
)
δbtail
:=
NewΔBtail
(
t0
.
at
,
db
)
// assert trackIdx=ø, newTrackIdx=ø, vδB=[]
assertTrack
(
t
,
"@at0"
,
δbtail
.
trackIdx
,
ø
)
// XXX + newTrackIdx, XXX vδB
assertTrack
(
t
,
"@at1"
,
δbtail
.
trackIdx
,
xkv1
.
trackIdx
(
keys1
))
xverifyΔBTail_rebuild1
(
t
,
db
,
δbtail
,
t0
,
t1
,
treeRoot
,
xverifyΔBTail_rebuild1
(
t
,
db
,
δbtail
,
t0
,
t1
,
treeRoot
,
// after Update(t0->t1):
/*trackIdx=*/
ø
,
// after Track(keys)
keys1
,
keys1
,
/*trackIdx=*/
/*XXX temp*/
nil
/*Tadj(t1, keys1)*/
,
/*newTrackIdx=*/
xkv1
.
trackIdx
(
keys1
),
// after rebuild
/*trackIdx=*/
xkv1
.
trackIdx
(
keys1
),
/*vδB=*/
/*XXX temp*/
nil
/*[δ1/Tadj(keys1)*/
)
/*vδB=*/
/*XXX temp*/
nil
/*[δ1/Tadj(keys1)*/
)
/* TODO reenable
/* TODO reenable
// tRestKeys2 = tAllKeys - keys1
// tRestKeys2 = tAllKeys - keys1
tRestKeys2 := tAllKeys.Difference(keys1)
tRestKeys2 := tAllKeys.Difference(keys1)
...
@@ -847,16 +867,17 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
...
@@ -847,16 +867,17 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
}
}
}
}
// xverifyΔBTail_rebuild1 verifies ΔBTree state after Update(ti->tj), Track(keys), rebuild
// xverifyΔBTail_rebuild1 verifies ΔBTree state:
// 1. after Update(ti->tj),
// 2. after further Track(keys), rebuild
func
xverifyΔBTail_rebuild1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
δbtail
*
ΔBtail
,
ti
,
tj
*
tTreeCommit
,
treeRoot
zodb
.
Oid
,
keys
SetKey
,
trackIdxOK
trackIndex
,
vδBok
[]
ΔB
)
{
func
xverifyΔBTail_rebuild1
(
t
*
testing
.
T
,
db
*
zodb
.
DB
,
δbtail
*
ΔBtail
,
ti
,
tj
*
tTreeCommit
,
treeRoot
zodb
.
Oid
,
keys
SetKey
,
trackIdxOK
trackIndex
,
vδBok
[]
ΔB
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
// XXX assert trackIdx=ø, newTrackIdx=ø, vδB=[]
// Update ati -> atj
// Update ati -> atj
δB
,
err
:=
δbtail
.
Update
(
tj
.
δZ
);
X
(
err
)
δB
,
err
:=
δbtail
.
Update
(
tj
.
δZ
);
X
(
err
)
// XXX assert δB.Rev = tj.at; δB = δ(ti,tj)/initially tracked
// XXX assert δB.Rev = tj.at; δB = δ(ti,tj)/initially tracked
// XXX assert trackIdx=ø, newTrackIdx=ø, vδB=[ø]
// XXX assertTrack(δbtail.trackIdx, ø)
// XXX assertTrack(δbtail.newTrackIdx, ø), vδB=[ø]
_
=
δB
_
=
δB
// Track(keys)
// Track(keys)
...
...
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