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
0ad20539
Commit
0ad20539
authored
Apr 14, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
351cc95d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+8
-6
wcfs/δftail.go
wcfs/δftail.go
+10
-4
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
0ad20539
...
@@ -87,6 +87,7 @@ type ΔTail struct {
...
@@ -87,6 +87,7 @@ type ΔTail struct {
}
}
// ΔRoots describes which BTrees were change in one revision.
// ΔRoots describes which BTrees were change in one revision.
// XXX kill?
type
ΔRoots
struct
{
type
ΔRoots
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
Changev
[]
*
Tree
// root XXX -> Oid? XXX -> SetTree?
Changev
[]
*
Tree
// root XXX -> Oid? XXX -> SetTree?
...
@@ -104,8 +105,9 @@ type ΔTreeTail struct {
...
@@ -104,8 +105,9 @@ type ΔTreeTail struct {
// ΔTree describes changes to one BTree in one revision.
// ΔTree describes changes to one BTree in one revision.
type
ΔTree
struct
{
type
ΔTree
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
Change
map
[
Key
]
Value
Root
*
Tree
// XXX ok to have here?
KV
map
[
Key
]
Value
}
}
// NewΔTail creats new empty ΔTail object.
// NewΔTail creats new empty ΔTail object.
...
@@ -175,7 +177,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
...
@@ -175,7 +177,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// only those keys, that correspond to tracked subset of δZ.
// only those keys, that correspond to tracked subset of δZ.
//
//
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
(
δB
ΔRoots
)
{
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
[]
ΔTree
{
btail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
btail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// {} root -> []oid changed under that root
// {} root -> []oid changed under that root
...
@@ -190,14 +192,14 @@ func (btail *ΔTail) Update(δZ *zodb.EventCommit) (δB ΔRoots) {
...
@@ -190,14 +192,14 @@ func (btail *ΔTail) Update(δZ *zodb.EventCommit) (δB ΔRoots) {
}
}
}
}
δB
.
Rev
=
δZ
.
Tid
if
len
(
δZByRoot
)
==
0
{
if
len
(
δZByRoot
)
==
0
{
return
δB
// tracked set not changed
return
nil
// tracked set not changed
}
}
// XXX stub to get file.size invalidation working
// XXX stub to get file.size invalidation working
var
δB
[]
ΔTree
for
root
:=
range
δZByRoot
{
for
root
:=
range
δZByRoot
{
δB
.
Changev
=
append
(
δB
.
Changev
,
root
)
δB
=
append
(
δB
,
ΔTree
{
δZ
.
Tid
,
root
,
nil
}
)
}
}
return
δB
return
δB
...
...
wcfs/δftail.go
View file @
0ad20539
...
@@ -68,22 +68,28 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
...
@@ -68,22 +68,28 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
// XXX
// XXX
func
(
δf
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔFentry
{
func
(
δf
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔFentry
{
δB
:=
δf
.
ΔTail
.
Update
(
δZ
)
δB
:=
δf
.
ΔTail
.
Update
(
δZ
)
var
changev
[]
ΔFile
// δB
.Changev
root -> file (via .fileIdx)
var
changev
[]
ΔFile
// δB root -> file (via .fileIdx)
for
_
,
δ
:=
range
δB
.
Changev
{
for
_
,
δ
:=
range
δB
{
files
:=
δf
.
fileIdx
[
δ
.
Root
]
files
:=
δf
.
fileIdx
[
δ
.
Root
]
if
len
(
files
)
==
0
{
if
len
(
files
)
==
0
{
panicf
(
"ΔFTail: root<%s> -> ø file"
,
δ
.
Root
.
POid
())
panicf
(
"ΔFTail: root<%s> -> ø file"
,
δ
.
Root
.
POid
())
}
}
for
file
:=
range
files
{
for
file
:=
range
files
{
var
blkv
[]
int64
for
blk
/*, zblk*/
:=
range
δ
.
KV
{
// FIXME stub - need to take both keys and zblk changes into account
// XXX document, and in particular how to include atTail
blkv
=
append
(
blkv
,
blk
)
}
changev
=
append
(
changev
,
ΔFile
{
changev
=
append
(
changev
,
ΔFile
{
File
:
file
,
File
:
file
,
Blkv
:
δ
.
Key
v
,
Blkv
:
blk
v
,
})
})
}
}
}
}
return
ΔFentry
{
return
ΔFentry
{
Rev
:
δ
B
.
Rev
,
Rev
:
δ
Z
.
Tid
,
Changev
:
changev
,
Changev
:
changev
,
}
}
}
}
...
...
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