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
4d0947ec
Commit
4d0947ec
authored
Oct 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
98d18081
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
27 deletions
+55
-27
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+0
-0
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+55
-27
No files found.
wcfs/internal/zdata/δftail.go
View file @
4d0947ec
This diff is collapsed.
Click to expand it.
wcfs/internal/zdata/δftail_test.go
View file @
4d0947ec
...
...
@@ -247,7 +247,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
newRoot
:
t
.
Root
(),
oldBlkSize
:
-
1
,
newBlkSize
:
blksize
,
old
TrackSetZBlk
:
nil
,
old
Zinblk
:
nil
,
})
epochv
=
append
(
epochv
,
t1
.
At
)
for
blk
,
zblk
:=
range
δt1
{
...
...
@@ -423,12 +423,12 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
δE
.
oldBlkSize
=
-
1
δE
.
newBlkSize
=
blksize
}
old
TrackSetZB
lk
:=
map
[
zodb
.
Oid
]
setI64
{}
old
Zinb
lk
:=
map
[
zodb
.
Oid
]
setI64
{}
for
zblk
,
inblk
:=
range
ZinblkPrev
{
oid
,
_
:=
commit
.
XGetBlkByName
(
zblk
)
old
TrackSetZB
lk
[
oid
]
=
inblk
old
Zinb
lk
[
oid
]
=
inblk
}
δE
.
old
TrackSetZBlk
=
oldTrackSetZB
lk
δE
.
old
Zinblk
=
oldZinb
lk
vδE
=
append
(
vδE
,
δE
)
}
...
...
@@ -445,26 +445,64 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
retrackAll
()
}
// verify δFtail.trackSetZBlk
trackZinblk
:=
map
[
string
]
setI64
{}
for
oid
,
zt
:=
range
δFtail
.
trackSetZBlk
{
zblki
:=
commit
.
ZBlkTab
[
oid
]
for
root
,
blocks
:=
range
zt
.
inroot
{
if
root
!=
t
.
Root
()
{
t
.
Errorf
(
".trackSetZBlk: zblk %s points to unexpected blktab %s"
,
zblki
.
Name
,
t
.
Root
())
continue
// verify byRoot, Zinroot
trackZinroot
:=
map
[
string
]
setOid
{}
trackRfiles
:=
map
[
zodb
.
Oid
]
setOid
{}
for
root
,
rt
:=
range
δFtail
.
byRoot
{
trackRfiles
[
root
]
=
rt
.
files
for
zoid
:=
range
rt
.
Zinblk
{
zblki
:=
commit
.
ZBlkTab
[
zoid
]
inroot
,
ok
:=
trackZinroot
[
zblki
.
Name
]
if
!
ok
{
inroot
=
setOid
{}
trackZinroot
[
zblki
.
Name
]
=
inroot
}
inroot
.
Add
(
root
)
}
}
inblk
,
ok
:=
trackZinblk
[
zblki
.
Name
]
Zinroot
:=
map
[
string
]
setOid
{}
for
zblk
:=
range
Zinblk
{
inroot
:=
setOid
{};
inroot
.
Add
(
t
.
Root
())
Zinroot
[
zblk
]
=
inroot
}
if
!
reflect
.
DeepEqual
(
trackZinroot
,
Zinroot
)
{
t
.
Errorf
(
"Zinroot:
\n
~have: %v
\n
want: %v"
,
trackZinroot
,
Zinroot
)
}
filesOK
:=
setOid
{}
if
!
delfile
{
filesOK
.
Add
(
foid
)
}
RfilesOK
:=
map
[
zodb
.
Oid
]
setOid
{
t
.
Root
()
:
filesOK
,
}
if
!
reflect
.
DeepEqual
(
trackRfiles
,
RfilesOK
)
{
t
.
Errorf
(
"Rfiles:
\n
~have: %v
\n
want: %v"
,
trackRfiles
,
RfilesOK
)
}
// verify Zinblk
trackZinblk
:=
map
[
string
]
setI64
{}
switch
{
case
len
(
δFtail
.
byRoot
)
==
0
:
// ok
case
len
(
δFtail
.
byRoot
)
==
1
:
rt
,
ok
:=
δFtail
.
byRoot
[
t
.
Root
()]
if
!
ok
{
inblk
=
setI64
{}
trackZinblk
[
zblki
.
Name
]
=
inblk
t
.
Errorf
(
".byRoot points to unexpected blktab"
)
}
else
{
for
zoid
,
inblk
:=
range
rt
.
Zinblk
{
zblki
:=
commit
.
ZBlkTab
[
zoid
]
trackZinblk
[
zblki
.
Name
]
=
inblk
.
Clone
()
// XXX clone needed?
}
inblk
.
Update
(
blocks
)
}
default
:
t
.
Errorf
(
"len(.byRoot) != (0,1) ; byRoot: %v"
,
δFtail
.
byRoot
)
}
if
!
reflect
.
DeepEqual
(
trackZinblk
,
Zinblk
)
{
t
.
Errorf
(
"
.trackSetZB
lk:
\n
~have: %v
\n
want: %v"
,
trackZinblk
,
Zinblk
)
t
.
Errorf
(
"
Zinb
lk:
\n
~have: %v
\n
want: %v"
,
trackZinblk
,
Zinblk
)
}
// ForgetPast configured threshold
...
...
@@ -485,16 +523,6 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδE
=
vδE
[
icut
:
]
}
// verify δFtail.filesByRoot
filesByRootOK
:=
map
[
zodb
.
Oid
]
setOid
{}
if
!
delfile
{
__
:=
setOid
{};
__
.
Add
(
foid
)
filesByRootOK
[
t
.
Root
()]
=
__
}
if
!
reflect
.
DeepEqual
(
δFtail
.
filesByRoot
,
filesByRootOK
)
{
t
.
Errorf
(
"filesByRoot:
\n
have: %v
\n
want: %v"
,
δFtail
.
filesByRoot
,
filesByRootOK
)
}
// verify δftail.root
δftail
:=
δFtail
.
byFile
[
foid
]
rootOK
:=
t
.
Root
()
...
...
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