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
2a2db135
Commit
2a2db135
authored
Apr 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9214be19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+26
-7
wcfs/δftail.go
wcfs/δftail.go
+1
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
2a2db135
...
...
@@ -38,13 +38,27 @@ type Key = int64
type
Value
=
zodb
.
Oid
// XXX assumes key points to IPersistent
// XXX how to represent deletion? InvalidOid?
// XXX
// ΔB represents a change in BTrees space.
//
// XXX place
type
ΔB
struct
{
Rev
zodb
.
Tid
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
// ΔTail represents tail of revisional changes to BTrees.
//
// It semantically consists of
//
// []δB ; rev ∈ (tail, head
//
// where δB represents a change in BTrees space
//
// δB:
// .rev↑
// {} root -> {}(key, value)
//
ΔTail represents tail of revisional changes to BTrees.
//
//
XXX + atTail
//
// It covers changes to keys from tracked subset of BTrees parts and
// semantically consists of
...
...
@@ -67,7 +81,7 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
// - Track(path) - start tracking tree nodes and keys; root=path[0], keys=path[-1].keys
// - ForgetPast(revCut) - forget changes past revCut
// - Get(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
// - Update(δZ) - update BTree δ tail given raw ZODB changes
// - Update(δZ)
-> δB
- update BTree δ tail given raw ZODB changes
//
// An example for tracked set is a set of visited BTree paths.
// There is no requirement that tracked set belongs to only one single BTree.
...
...
@@ -192,7 +206,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// only those keys, that correspond to tracked subset of δZ.
//
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
[]
ΔTree
{
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔB
{
btail
.
ΔZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// {} root -> []oid changed under that root
...
...
@@ -212,9 +226,14 @@ func (btail *ΔTail) Update(δZ *zodb.EventCommit) []ΔTree {
}
// XXX stub to get file.size invalidation working
var
δB
[]
ΔTree
δB
:=
ΔB
{
Rev
:
δZ
.
Tid
,
Change
:
make
(
map
[
*
Tree
]
map
[
Key
]
Value
)}
for
root
:=
range
δZByRoot
{
δB
=
append
(
δB
,
ΔTree
{
δZ
.
Tid
,
root
,
nil
})
δt
,
ok
:=
δB
.
Change
[
root
]
if
!
ok
{
δt
=
make
(
map
[
Key
]
Value
)
δB
.
Change
[
root
]
=
δt
}
// TODO update δt
}
return
δB
...
...
wcfs/δftail.go
View file @
2a2db135
...
...
@@ -89,7 +89,7 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
func
(
δFtail
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
δB
:=
δFtail
.
ΔTail
.
Update
(
δZ
)
δF
:=
ΔF
{
Rev
:
δB
.
Rev
,
Change
:
make
(
map
[
*
BigFile
]
SetI64
)}
for
root
,
δt
:=
range
δB
{
for
root
,
δt
:=
range
δB
.
Change
{
files
:=
δFtail
.
fileIdx
[
root
]
if
len
(
files
)
==
0
{
panicf
(
"ΔFTail: root<%s> -> ø file"
,
root
.
POid
())
...
...
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