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
441e3666
Commit
441e3666
authored
Apr 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
599a72f3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
wcfs/wcfs.go
wcfs/wcfs.go
+1
-1
wcfs/δbtail.go
wcfs/δbtail.go
+6
-0
wcfs/δftail.go
wcfs/δftail.go
+25
-3
No files found.
wcfs/wcfs.go
View file @
441e3666
...
...
@@ -1370,7 +1370,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// pin all tracked file blocks that were changed (at, head] range
for
_
,
δfile
:=
range
bfdir
.
δFtail
.
SliceByFileRev
(
f
,
at
,
head
.
zconn
.
At
())
{
for
_
,
blk
:=
range
δfile
.
Change
{
for
blk
:=
range
δfile
.
Change
{
_
,
already
:=
toPin
[
blk
]
if
already
{
continue
...
...
wcfs/δbtail.go
View file @
441e3666
...
...
@@ -335,6 +335,12 @@ func (δΒtail *ΔBtail) Get(ctx context.Context, root *Tree, key Key, at zodb.T
return
}
// XXX SliceByRev
// XXX
func
(
δBtail
*
ΔBtail
)
SliceByRootRev
(
root
*
Tree
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔTree
{
panic
(
"TODO"
)
}
// δ(BTree) notes
// ==============
...
...
wcfs/δftail.go
View file @
441e3666
...
...
@@ -72,6 +72,12 @@ type ΔF struct {
Change
map
[
*
BigFile
]
SetI64
// file -> δfile (= {}#blk)
}
// Δfile represents a change to one file.
type
Δfile
struct
{
Rev
zodb
.
Tid
Change
SetI64
// changed blocks
}
// NewΔFtail creates new ΔFtail object.
//
// Initial tracked set is empty.
...
...
@@ -149,6 +155,24 @@ func (δFtail *ΔFtail) ForgetPast(revCut zodb.Tid) {
panic
(
"TODO"
)
}
// XXX SliceByRev
// XXX SliceByFileRev
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
f
*
BigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
Δfile
{
tail
:=
δFtail
.
Tail
()
head
:=
δFtail
.
Head
()
if
!
(
tail
<=
lo
&&
lo
<=
hi
&&
hi
<=
head
)
{
panicf
(
"δFtail.SliceByFileRev: invalid query: (%s, %s]; (tail, head] = (%s, %s]"
,
lo
,
hi
,
tail
,
head
)
}
// XXX activate zfile?
vδT
:=
δFtail
.
δBtail
.
SliceByRootRev
(
f
.
zfile
.
blktab
,
lo
,
hi
)
_
=
vδT
panic
(
"TODO"
)
}
// 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.
...
...
@@ -164,6 +188,7 @@ func (f *BigFile) LastBlkRev(ctx context.Context, blk int64, at zodb.Tid) (_ zod
δFtail
:=
f
.
head
.
bfdir
.
δFtail
// XXX tabRev -> treeRev ?
// XXX activate zfile?
zblkOid
,
ok
,
tabRev
,
tabRevExact
,
err
:=
δFtail
.
δBtail
.
Get
(
ctx
,
f
.
zfile
.
blktab
,
blk
,
at
)
if
err
!=
nil
{
panic
(
err
)
...
...
@@ -186,6 +211,3 @@ func (f *BigFile) LastBlkRev(ctx context.Context, blk int64, at zodb.Tid) (_ zod
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