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
646ac661
Commit
646ac661
authored
Oct 14, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
90abcd03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+24
-22
No files found.
wcfs/internal/zdata/δftail.go
View file @
646ac661
...
...
@@ -298,27 +298,6 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, bl
}
}
// rebuildAll rebuilds vδE for all files from trackNew requests.
func
(
δFtail
*
ΔFtail
)
rebuildAll
()
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"ΔFtail rebuildAll"
)
// XXX locking
δBtail
:=
δFtail
.
δBtail
δZtail
:=
δBtail
.
ΔZtail
()
db
:=
δBtail
.
DB
()
for
foid
:=
range
δFtail
.
trackNew
{
δFtail
.
trackNew
.
Del
(
foid
)
δftail
:=
δFtail
.
byFile
[
foid
]
δftail
.
vδE
,
err
=
vδEBuild
(
foid
,
δZtail
,
db
)
if
err
!=
nil
{
δFtail
.
trackNew
.
Add
(
foid
)
return
err
}
}
return
nil
}
// rebuild1IfNeeded rebuilds vδE for a file if there is such need.
//
// It also returns corresponding δftail.root for convenience.
...
...
@@ -374,6 +353,29 @@ func (δFtail *ΔFtail) rebuild1IfNeeded(foid zodb.Oid) (vδE []_ΔFileEpoch, he
return
vδE
,
root
,
err
}
// _rebuildAll rebuilds vδE for all files from trackNew requests.
//
// must be calledwith δFtail.mu locked.
func
(
δFtail
*
ΔFtail
)
_rebuildAll
()
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"ΔFtail rebuildAll"
)
δBtail
:=
δFtail
.
δBtail
δZtail
:=
δBtail
.
ΔZtail
()
db
:=
δBtail
.
DB
()
for
foid
:=
range
δFtail
.
trackNew
{
δFtail
.
trackNew
.
Del
(
foid
)
δftail
:=
δFtail
.
byFile
[
foid
]
// no need to set δftail.rebuildJob - we are under lock
δftail
.
vδE
,
err
=
vδEBuild
(
foid
,
δZtail
,
db
)
if
err
!=
nil
{
δFtail
.
trackNew
.
Add
(
foid
)
return
err
}
}
return
nil
}
// Update updates δFtail given raw ZODB changes.
//
// It returns change in files space that corresponds to δZ.
...
...
@@ -388,7 +390,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
// TODO verify that there is no in-progress readers/writers
// rebuild vδE for newly tracked files
err
=
δFtail
.
rebuildAll
()
err
=
δFtail
.
_
rebuildAll
()
if
err
!=
nil
{
return
ΔF
{},
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