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
8456cefd
Commit
8456cefd
authored
Apr 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8be186ba
Changes
2
Show 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
...
@@ -82,7 +82,9 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
// ΔBTail is not safe for concurrent access.
// ΔBTail is not safe for concurrent access.
// XXX -> multiple readers / single writer?
// XXX -> multiple readers / single writer?
type
ΔBtail
struct
{
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
δ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
byRoot
map
[
*
Tree
]
*
ΔTreeTail
// root -> k/v change history; only for keys ∈ tracket subset
...
@@ -151,16 +153,9 @@ func newΔTtail() *ΔTreeTail {
...
@@ -151,16 +153,9 @@ func newΔTtail() *ΔTreeTail {
}
}
}
}
// Head is similar to zodb.ΔTail.Head . XXX ok?
// (tail, head] coverage
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Head
()
}
//return δb.head
func
(
δBtail
*
ΔBtail
)
Tail
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Tail
()
}
return
δBtail
.
δZtail
.
Head
()
}
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
func
(
δBtail
*
ΔBtail
)
Tail
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Tail
()
}
// XXX SliceByRev?
// XXX SliceByRev?
// XXX ForgetPast
// XXX ForgetPast
...
@@ -209,6 +204,8 @@ func (δBtail *ΔBtail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
...
@@ -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
// 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
// taken into account. In other words a tree history will assuredly include
// only those keys, that correspond to tracked subset of δZ.
// 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
)
Δ
{
func
(
δBtail
*
ΔBtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
Δ
{
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
...
...
wcfs/δftail.go
View file @
8456cefd
...
@@ -83,9 +83,9 @@ func NewΔFtail(at0 zodb.Tid) *ΔFtail {
...
@@ -83,9 +83,9 @@ func NewΔFtail(at0 zodb.Tid) *ΔFtail {
}
}
}
}
//
XXX
//
(tail, head] coverage
func
(
δFtail
*
ΔFtail
)
Head
()
zodb
.
Tid
{
panic
(
"TODO"
)
}
func
(
δFtail
*
ΔFtail
)
Head
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Head
(
)
}
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
panic
(
"TODO"
)
}
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Tail
(
)
}
// Track adds tree path to tracked set and associates path root with file.
// 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) {
...
@@ -117,6 +117,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
// Update updates δFtail given raw ZODB changes.
// Update updates δFtail given raw ZODB changes.
//
//
// It returns change in files space that corresponds to δZ.
// 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
{
func
(
δFtail
*
ΔFtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
δB
:=
δFtail
.
δBtail
.
Update
(
δZ
)
δB
:=
δFtail
.
δBtail
.
Update
(
δZ
)
δF
:=
ΔF
{
Rev
:
δB
.
Rev
,
Change
:
make
(
map
[
*
BigFile
]
SetI64
)}
δ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