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
bc44049f
Commit
bc44049f
authored
Apr 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6b6f98c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
wcfs/δftail.go
wcfs/δftail.go
+18
-6
No files found.
wcfs/δftail.go
View file @
bc44049f
...
...
@@ -48,7 +48,7 @@ import (
// tracked set.
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δF - query for all 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]
// .LastBlkRev(file, #blk, at) - query for what is last revision that changed
// file[#blk] as of @at database state.
...
...
@@ -58,6 +58,8 @@ import (
// []blk
//
// XXX concurrent use
//
// XXX see also zodb.ΔTail
type
ΔFtail
struct
{
// ΔFtail merge btree.ΔTail with history of ZBlk
δBtail
*
xbtree
.
ΔTail
...
...
@@ -66,11 +68,14 @@ type ΔFtail struct {
// ΔF represents a change in files space.
type
ΔF
struct
{
Rev
zodb
.
Tid
Change
map
[
*
BigFile
]
SetI64
// file -> δfile (= {}#blk)
Rev
zodb
.
Tid
Change
map
[
*
BigFile
]
SetI64
// file -> δfile (= {}#blk)
}
func
NewΔFTail
(
at0
zodb
.
Tid
)
*
ΔFtail
{
// NewΔFtail creates new ΔFtail object.
//
// Initial coverage of created ΔFtail is (at₀, at₀].
func
NewΔFtail
(
at0
zodb
.
Tid
)
*
ΔFtail
{
return
&
ΔFtail
{
δBtail
:
xbtree
.
NewΔTail
(
at0
),
fileIdx
:
make
(
map
[
*
btree
.
LOBTree
]
SetBigFile
),
...
...
@@ -84,6 +89,8 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { panic("TODO") }
// Track adds tree path to tracked set and associates path root with file.
//
// XXX text
//
// A root can be associated with several files (each provided on different Track call).
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
path
[]
btree
.
LONode
)
{
δFtail
.
δBtail
.
Track
(
path
)
...
...
@@ -95,6 +102,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
}
files
.
Add
(
file
)
// XXX mark something dirty so that LastBlkRev and Slice* know what to rebuild?
// XXX debug
/*
leaf := path[len(path)-1].(*btree.LOBucket)
...
...
@@ -106,7 +115,7 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
// Update updates δFtail given raw ZODB changes.
//
// It returns c
orresponding change in files space
.
// It returns c
hange in files space that corresponds to δZ
.
func
(
δFtail
*
ΔFtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
δB
:=
δFtail
.
δBtail
.
Update
(
δZ
)
δF
:=
ΔF
{
Rev
:
δB
.
Rev
,
Change
:
make
(
map
[
*
BigFile
]
SetI64
)}
...
...
@@ -132,7 +141,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
return
δF
}
// XXX ForgetPast
// ForgetPast discards all δFtail entries with rev ≤ revCut.
func
(
δFtail
*
ΔFtail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
panic
(
"TODO"
)
}
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
//
...
...
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