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
ec505b13
Commit
ec505b13
authored
Aug 05, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d97605e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+8
-8
No files found.
wcfs/internal/zdata/δftail.go
View file @
ec505b13
...
@@ -66,7 +66,7 @@ type setOid = set.Oid
...
@@ -66,7 +66,7 @@ type setOid = set.Oid
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
// .SliceByFileRev(file, lo, hi) -> []δfile - query for changes of file with rev ∈ (lo, hi]
// .SliceByFileRev(file, lo, hi) -> []δfile - query for changes of
a
file with rev ∈ (lo, hi]
// .BlkRevAt(file, #blk, at) - query for what is last revision that changed
// .BlkRevAt(file, #blk, at) - query for what is last revision that changed
// file[#blk] as of @at database state.
// file[#blk] as of @at database state.
//
//
...
@@ -74,7 +74,7 @@ type setOid = set.Oid
...
@@ -74,7 +74,7 @@ type setOid = set.Oid
//
//
// δfile:
// δfile:
// .rev↑
// .rev↑
// {}blk
// {}blk
| EPOCH
//
//
// XXX concurrent use
// XXX concurrent use
//
//
...
@@ -85,7 +85,7 @@ type ΔFtail struct {
...
@@ -85,7 +85,7 @@ type ΔFtail struct {
fileIdx
map
[
zodb
.
Oid
]
setOid
// tree-root -> {} ZBigFile<oid> as of @head XXX -> root2file ?
fileIdx
map
[
zodb
.
Oid
]
setOid
// tree-root -> {} ZBigFile<oid> as of @head XXX -> root2file ?
byFile
map
[
zodb
.
Oid
]
*
_ΔFileTail
// file -> vδf tail XXX
byFile
map
[
zodb
.
Oid
]
*
_ΔFileTail
// file -> vδf tail XXX
// set of files, which are newly tracked and for which vδE was not yet rebuilt
// set of files, which are newly tracked and for which
byFile[foid].
vδE was not yet rebuilt
trackNew
setOid
// {}foid
trackNew
setOid
// {}foid
trackSetZBlk
map
[
zodb
.
Oid
]
*
zblkTrack
// zblk -> {} root -> {}blk as of @head
trackSetZBlk
map
[
zodb
.
Oid
]
*
zblkTrack
// zblk -> {} root -> {}blk as of @head
...
@@ -157,8 +157,6 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
...
@@ -157,8 +157,6 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
//
//
// XXX Track adds tree path to tracked set and associates path root with file.
// XXX Track adds tree path to tracked set and associates path root with file.
//
//
// XXX text
//
// XXX objects in path and zblk must be with .PJar().At() == .head
// XXX objects in path and zblk must be with .PJar().At() == .head
//
//
// A root can be associated with several files (each provided on different Track call).
// A root can be associated with several files (each provided on different Track call).
...
@@ -186,7 +184,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb
...
@@ -186,7 +184,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb
δftail
,
ok
:=
δFtail
.
byFile
[
foid
]
δftail
,
ok
:=
δFtail
.
byFile
[
foid
]
if
!
ok
{
if
!
ok
{
δftail
=
&
_ΔFileTail
{
root
:
roid
,
vδE
:
nil
/*will need to be rebuilt t
ill past
*/
}
δftail
=
&
_ΔFileTail
{
root
:
roid
,
vδE
:
nil
/*will need to be rebuilt t
o past till tail
*/
}
δFtail
.
byFile
[
foid
]
=
δftail
δFtail
.
byFile
[
foid
]
=
δftail
δFtail
.
trackNew
.
Add
(
foid
)
δFtail
.
trackNew
.
Add
(
foid
)
}
}
...
@@ -221,11 +219,13 @@ func (δFtail *ΔFtail) rebuildAll() (err error) {
...
@@ -221,11 +219,13 @@ func (δFtail *ΔFtail) rebuildAll() (err error) {
defer
xerr
.
Contextf
(
&
err
,
"ΔFtail rebuildAll"
)
defer
xerr
.
Contextf
(
&
err
,
"ΔFtail rebuildAll"
)
// XXX locking
// XXX locking
δBtail
:=
δFtail
.
δBtail
δZtail
:=
δBtail
.
ΔZtail
()
db
:=
δBtail
.
DB
()
for
foid
:=
range
δFtail
.
trackNew
{
for
foid
:=
range
δFtail
.
trackNew
{
δFtail
.
trackNew
.
Del
(
foid
)
δFtail
.
trackNew
.
Del
(
foid
)
δftail
:=
δFtail
.
byFile
[
foid
]
δftail
:=
δFtail
.
byFile
[
foid
]
δBtail
:=
δFtail
.
δBtail
err
:=
δftail
.
rebuild1
(
foid
,
δZtail
,
db
)
err
:=
δftail
.
rebuild1
(
foid
,
δBtail
.
ΔZtail
(),
δBtail
.
DB
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
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