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
3cc8369b
Commit
3cc8369b
authored
Jul 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6ec94d4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+3
-0
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+23
-6
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
3cc8369b
...
...
@@ -828,6 +828,9 @@ func (δBtail *ΔBtail) GetAt(ctx context.Context, root *Tree, key Key, at zodb.
// @tail[key] is not present - key was not changing in (tail, head].
// since at ∈ (tail, head] we can use @head[key] as the result
xvalue
,
ok
,
err
:=
root
.
Get
(
ctx
,
key
)
if
!
ok
{
value
=
VDEL
}
if
err
!=
nil
||
!
ok
{
return
}
...
...
wcfs/internal/zdata/δftail_test.go
View file @
3cc8369b
...
...
@@ -262,7 +262,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
delfile
=
true
}
newEpoch
:=
delfile
||
(
!
delfile
&&
delfilePrev
&&
!
delfilePrev
)
// new epoch starts when file is deleted or recreated
newEpoch
:=
delfile
||
(
!
delfile
&&
delfile
!=
delfilePrev
)
delfilePrev
=
delfile
// newEpoch -> reset
...
...
@@ -328,6 +329,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if
newEpoch
{
epochv
=
append
(
epochv
,
commit
.
At
)
}
xat
[
commit
.
At
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
flags
:=
""
if
newEpoch
{
flags
+=
"
\t
EPOCH"
}
t
.
Logf
(
"# → @%s (%s) δT%s δD%s
\t
; %s
\t
δ%s%s"
,
xat
[
commit
.
At
],
commit
.
At
,
xbtreetest
.
KVTxt
(
test
.
δblkTab
),
test
.
δdataTab
,
commit
.
Tree
,
δblk
,
flags
)
//t.Logf("# vδf: %s", vδfstr(vδf))
// update blkRevAt
var
blkRevPrev
map
[
int64
]
zodb
.
Tid
...
...
@@ -346,6 +355,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
blkRev
[
blk
]
=
commit
.
At
}
blkRevAt
[
commit
.
At
]
=
blkRev
if
false
{
fmt
.
Printf
(
"blkRevAt[@%s]:
\n
"
,
xat
[
commit
.
At
])
blkv
:=
[]
int64
{}
for
blk
:=
range
blkRev
{
blkv
=
append
(
blkv
,
blk
)
}
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
return
blkv
[
i
]
<
blkv
[
j
]
})
for
_
,
blk
:=
range
blkv
{
fmt
.
Printf
(
" #%d: %v
\n
"
,
blk
,
blkRev
[
blk
])
}
}
// update zfile
txn
.
Abort
()
...
...
@@ -363,11 +385,6 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf
=
append
(
vδf
,
δfok
)
}
xat
[
commit
.
At
]
=
fmt
.
Sprintf
(
"at%d"
,
i
)
// t.Logf("# → @%s (%s) δT%s δD%s\t; %s\tδ%s", xat[commit.At], commit.At, xbtreetest.KVTxt(test.δblkTab), test.δdataTab, tTxt, δblk)
t
.
Logf
(
"# → @%s (%s) δT%s δD%s
\t
; %s
\t
δ%s"
,
xat
[
commit
.
At
],
commit
.
At
,
xbtreetest
.
KVTxt
(
test
.
δblkTab
),
test
.
δdataTab
,
commit
.
Tree
,
δblk
)
//t.Logf("# vδf: %s", vδfstr(vδf))
//fmt.Printf("Zinblk: %v\n", Zinblk)
// update δFtail
...
...
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