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
ac195099
Commit
ac195099
authored
Sep 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3f3e0d87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+8
-4
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+3
-2
No files found.
wcfs/internal/zdata/δftail.go
View file @
ac195099
...
@@ -57,7 +57,9 @@ type setOid = set.Oid
...
@@ -57,7 +57,9 @@ type setOid = set.Oid
// be present. In particular a block that was not explicitly requested to be
// be present. In particular a block that was not explicitly requested to be
// tracked, even if it was changed in δZ, is not guaranteed to be present in δF.
// tracked, even if it was changed in δZ, is not guaranteed to be present in δF.
//
//
// XXX after epoch previous track requests has no effects
// After file epoch (file creation, deletion, or any other change to file
// object) previous track requests for that file become forgotten and has no
// further effect.
//
//
// ΔFtail provides the following operations:
// ΔFtail provides the following operations:
//
//
...
@@ -97,13 +99,13 @@ type _ΔFileTail struct {
...
@@ -97,13 +99,13 @@ type _ΔFileTail struct {
vδE
[]
_ΔFileEpoch
// changes to ZBigFile object itself ; nil if not yet rebuilt
vδE
[]
_ΔFileEpoch
// changes to ZBigFile object itself ; nil if not yet rebuilt
}
}
// _ΔFileEpoch represent change to ZBigFile object.
// _ΔFileEpoch represent
a
change to ZBigFile object.
type
_ΔFileEpoch
struct
{
type
_ΔFileEpoch
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
oldRoot
zodb
.
Oid
// .blktab was pointing to oldRoot before ; VDEL if ZBigFile deleted
oldRoot
zodb
.
Oid
// .blktab was pointing to oldRoot before ; VDEL if ZBigFile deleted
newRoot
zodb
.
Oid
// .blktab was changed to point to newRoot ; ----//----
newRoot
zodb
.
Oid
// .blktab was changed to point to newRoot ; ----//----
newBlkSize
int64
// .blksize was changed to newBlkSize
; -1 if ZBigFile deleted
oldBlkSize
int64
// .blksize was oldBlkSize
; -1 if ZBigFile deleted
// XXX +oldBlkSize ?
newBlkSize
int64
// .blksize was changed to newBlkSize ; ----//----
// snapshot of trackSetZBlk for this file right before this epoch
// snapshot of trackSetZBlk for this file right before this epoch
oldTrackSetZBlk
map
[
zodb
.
Oid
]
setI64
// {} zblk -> {}blk
oldTrackSetZBlk
map
[
zodb
.
Oid
]
setI64
// {} zblk -> {}blk
...
@@ -299,6 +301,7 @@ func (δftail *_ΔFileTail) rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *zo
...
@@ -299,6 +301,7 @@ func (δftail *_ΔFileTail) rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *zo
Rev
:
δZ
.
Rev
,
Rev
:
δZ
.
Rev
,
oldRoot
:
δ
.
blktabOld
,
oldRoot
:
δ
.
blktabOld
,
newRoot
:
δ
.
blktabNew
,
newRoot
:
δ
.
blktabNew
,
oldBlkSize
:
δ
.
blksizeOld
,
newBlkSize
:
δ
.
blksizeNew
,
newBlkSize
:
δ
.
blksizeNew
,
oldTrackSetZBlk
:
nil
,
// nothing was tracked
oldTrackSetZBlk
:
nil
,
// nothing was tracked
}
}
...
@@ -364,6 +367,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
...
@@ -364,6 +367,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
Rev
:
δZ
.
Tid
,
Rev
:
δZ
.
Tid
,
oldRoot
:
δ
.
blktabOld
,
oldRoot
:
δ
.
blktabOld
,
newRoot
:
δ
.
blktabNew
,
newRoot
:
δ
.
blktabNew
,
oldBlkSize
:
δ
.
blksizeOld
,
newBlkSize
:
δ
.
blksizeNew
,
newBlkSize
:
δ
.
blksizeNew
,
oldTrackSetZBlk
:
map
[
zodb
.
Oid
]
setI64
{},
oldTrackSetZBlk
:
map
[
zodb
.
Oid
]
setI64
{},
}
}
...
...
wcfs/internal/zdata/δftail_test.go
View file @
ac195099
...
@@ -245,6 +245,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -245,6 +245,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
Rev
:
t1
.
At
,
Rev
:
t1
.
At
,
oldRoot
:
zodb
.
InvalidOid
,
oldRoot
:
zodb
.
InvalidOid
,
newRoot
:
t
.
Root
(),
newRoot
:
t
.
Root
(),
oldBlkSize
:
-
1
,
newBlkSize
:
blksize
,
newBlkSize
:
blksize
,
oldTrackSetZBlk
:
nil
,
oldTrackSetZBlk
:
nil
,
})
})
...
@@ -414,13 +415,13 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
...
@@ -414,13 +415,13 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if
delfile
{
if
delfile
{
δE
.
oldRoot
=
t
.
Root
()
δE
.
oldRoot
=
t
.
Root
()
δE
.
newRoot
=
zodb
.
InvalidOid
δE
.
newRoot
=
zodb
.
InvalidOid
δE
.
oldBlkSize
=
blksize
δE
.
newBlkSize
=
-
1
δE
.
newBlkSize
=
-
1
// XXX oldBlkSize ?
}
else
{
}
else
{
δE
.
oldRoot
=
zodb
.
InvalidOid
δE
.
oldRoot
=
zodb
.
InvalidOid
δE
.
newRoot
=
t
.
Root
()
δE
.
newRoot
=
t
.
Root
()
δE
.
oldBlkSize
=
-
1
δE
.
newBlkSize
=
blksize
δE
.
newBlkSize
=
blksize
// XXX oldBlkSize ?
}
}
oldTrackSetZBlk
:=
map
[
zodb
.
Oid
]
setI64
{}
oldTrackSetZBlk
:=
map
[
zodb
.
Oid
]
setI64
{}
for
zblk
,
inblk
:=
range
ZinblkPrev
{
for
zblk
,
inblk
:=
range
ZinblkPrev
{
...
...
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