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
08da1d81
Commit
08da1d81
authored
Apr 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
94f4471f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
wcfs/wcfs.go
wcfs/wcfs.go
+5
-2
wcfs/δftail.go
wcfs/δftail.go
+22
-2
No files found.
wcfs/wcfs.go
View file @
08da1d81
...
...
@@ -331,14 +331,14 @@ package main
// 7.1) load blkdata for head/bigfile/file[blk] @zhead.at .
//
// while loading this also gives upper bound estimate of when the block
// was last changed:
XXX kill upper bound -> populate and use δFtail
// was last changed:
//
// rev(blk) ≤ max(_.serial for _ in (ZBlk(#blk), all BTree/Bucket that lead to ZBlk))
//
// it is not exact because BTree/Bucket can change (e.g. rebalance)
// but still point to the same k->ZBlk.
//
// we also use file.δtail to find either exact blk revision:
XXX just use δFtail
// we also use file.δtail to find either exact blk revision:
//
// rev(blk) = max(file.δtail.by(#blk) -> []rev↑)
//
...
...
@@ -352,6 +352,9 @@ package main
// rev(blk) ≤ rev'(blk) rev'(blk) = min(^^^)
//
//
// XXX we delay recomputing δFtail.LastBlkRev(file, #blk, head) because
// just cheap revmax estimate can frequently result in all watches being skipped.
//
// 7.2) for all registered client@at watchers of head/bigfile/file:
//
// - rev'(blk) ≤ at: -> do nothing
...
...
wcfs/δftail.go
View file @
08da1d81
...
...
@@ -36,7 +36,7 @@ import (
//
// δF:
// .rev↑
//
[](file, []blk)
//
{} file -> {}blk
//
// Only files and blocks explicitly requested to be tracked are guaranteed to
// be present. In particular a block that was not explicitly requested to be
...
...
@@ -52,6 +52,12 @@ import (
// .SliceByFileRev(file, lo, hi) -> []δfile - query for changes of file with rev ∈ (lo, hi]
// .LastBlkRev(file, #blk, at) - query for what is last revision that changed
// file[#blk] as of @at database state.
//
// XXX δfile:
// .rev↑
// []blk
//
// XXX concurrent use
type
ΔFtail
struct
{
// ΔFtail merge btree.ΔTail with history of ZBlk
δBtail
*
xbtree
.
ΔTail
...
...
@@ -88,6 +94,14 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
δFtail
.
fileIdx
[
root
]
=
files
}
files
.
Add
(
file
)
// XXX debug
/*
leaf := path[len(path)-1].(*btree.LOBucket)
for _, e := range leaf.Entryv() { // XXX activate
δFtail.tracked.Add(e.Key())
}
*/
}
// Update updates δFtail given raw ZODB changes.
...
...
@@ -118,6 +132,8 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
return
δF
}
// XXX ForgetPast
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
//
// if exact=False - what is returned is only an upper bound for last block revision.
...
...
@@ -125,10 +141,11 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
// at must ∈ (tail, head] XXX [tail ?
// XXX blk must be tracked?
//
// XXX
-> LastTrackedBlkRev ?
// XXX
+ctx, error rebuild []δF here
func
(
f
*
BigFile
)
LastBlkRev
(
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
δFtail
:=
f
.
head
.
bfdir
.
δFtail
// XXX tabRev -> treeRev ?
zblkOid
,
ok
,
tabRev
,
tabRevExact
:=
δFtail
.
δBtail
.
Get
(
f
.
zfile
.
blktab
,
blk
,
at
)
// block was removed
...
...
@@ -148,3 +165,6 @@ func (f *BigFile) LastBlkRev(blk int64, at zodb.Tid) (_ zodb.Tid, exact bool) {
return
tabRev
,
tabRevExact
}
}
// XXX SliceByRev
// XXX SliceByFileRev
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