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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
8456cefd
Commit
8456cefd
authored
Apr 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8be186ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
14 deletions
+13
-14
wcfs/δbtail.go
wcfs/δbtail.go
+8
-11
wcfs/δftail.go
wcfs/δftail.go
+5
-3
No files found.
wcfs/δbtail.go
View file @
8456cefd
...
...
@@ -82,7 +82,9 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
// ΔBTail is not safe for concurrent access.
// XXX -> multiple readers / single writer?
type
ΔBtail
struct
{
δZtail
*
zodb
.
ΔTail
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// includes all changed objects, not only tracked ones.
δZtail
*
zodb
.
ΔTail
δRtail
[]
ΔRoots
// which BTree were changed; Noted only by keys ∈ tracket subset
byRoot
map
[
*
Tree
]
*
ΔTreeTail
// root -> k/v change history; only for keys ∈ tracket subset
...
...
@@ -151,16 +153,9 @@ func newΔTtail() *ΔTreeTail {
}
}
// Head is similar to zodb.ΔTail.Head . XXX ok?
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
//return δb.head
return
δBtail
.
δZtail
.
Head
()
}
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
func
(
δBtail
*
ΔBtail
)
Tail
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Tail
()
}
// (tail, head] coverage
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Head
()
}
func
(
δBtail
*
ΔBtail
)
Tail
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Tail
()
}
// XXX SliceByRev?
// XXX ForgetPast
...
...
@@ -209,6 +204,8 @@ func (δBtail *ΔBtail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// Only those objects from δZ that belong to tracked set are guaranteed to be
// taken into account. In other words a tree history will assuredly include
// only those keys, that correspond to tracked subset of δZ.
//
// δZ should include all objects changed by ZODB transaction.
func
(
δBtail
*
ΔBtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
Δ
{
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
...
...
wcfs/δftail.go
View file @
8456cefd
...
...
@@ -83,9 +83,9 @@ func NewΔFtail(at0 zodb.Tid) *ΔFtail {
}
}
//
XXX
func
(
δFtail
*
ΔFtail
)
Head
()
zodb
.
Tid
{
panic
(
"TODO"
)
}
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
panic
(
"TODO"
)
}
//
(tail, head] coverage
func
(
δFtail
*
ΔFtail
)
Head
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Head
(
)
}
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Tail
(
)
}
// Track adds tree path to tracked set and associates path root with file.
...
...
@@ -117,6 +117,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
// Update updates δFtail given raw ZODB changes.
//
// It returns change in files space that corresponds to δZ.
//
// δZ should include all objects changed by ZODB transaction.
func
(
δFtail
*
ΔFtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
δB
:=
δFtail
.
δBtail
.
Update
(
δZ
)
δF
:=
ΔF
{
Rev
:
δB
.
Rev
,
Change
:
make
(
map
[
*
BigFile
]
SetI64
)}
...
...
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