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
7bd1ae31
Commit
7bd1ae31
authored
Apr 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b56cada6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
26 deletions
+36
-26
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+35
-24
wcfs/misc.go
wcfs/misc.go
+1
-2
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
7bd1ae31
...
@@ -195,27 +195,34 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
...
@@ -195,27 +195,34 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// 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.
//
//
// XXX return -> [] of (root, []key) that are invalidated.
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
// XXX -> + separate SliceByRev? or Data to get diff?
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
(
δB
ΔRevEntry
)
{
func
(
δB
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
{
btail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
/*
.δZtail += δZ
*/
δB
.
update
()
}
// update brings .δBtail up to date by recomputing diff XXX and taking new
// {} root -> []oid changed under that root
// entries in .δZtail into account.
δZByRoot
:=
map
[
*
Tree
][]
zodb
.
Oid
{}
// XXX -> map[*Tree]SetOid ?
func
(
δB
*
ΔTail
)
update
()
{
for
_
,
δ
:=
range
δZ
.
Changev
{
/*
roots
,
ok
:=
btail
.
trackIdx
[
δ
]
δbZ = {}
if
!
ok
{
for δ in δZ:
continue
.trackIdx[δ]:
}
ø -> nothing
for
root
:=
range
roots
{
root -> δbZ[root] += δ
δZByRoot
[
root
]
=
append
(
δZByRoot
[
root
],
δ
)
}
}
if δbZ == ø:
δB
.
Rev
=
δZ
.
Tid
return
if
len
(
δZByRoot
)
==
0
{
return
δB
// tracked set not changed
}
// XXX stub to get file.size invalidation working
for
root
:=
range
δZByRoot
{
δB
.
Changev
=
append
(
δB
.
Changev
,
ΔTree
{
root
,
nil
})
}
return
δB
/* TODO btree-diff:
zconnNew = db.Open(δZ.rev)
zconnNew = db.Open(δZ.rev)
defer(zconnNew.close)
defer(zconnNew.close)
...
@@ -235,19 +242,23 @@ func (δB *ΔTail) update() {
...
@@ -235,19 +242,23 @@ func (δB *ΔTail) update() {
*/
*/
}
}
// update brings .δBtail up to date by recomputing diff XXX and taking new
// entries in .δZtail into account.
// func (btail *ΔTail) update()
// XXX -> Get(root, key, at) -> (valueOid, rev) ?
// XXX -> Get(root, key, at) -> (valueOid, rev) ?
func
(
δB
*
ΔTail
)
LastRevOf
(
root
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
func
(
btail
*
ΔTail
)
LastRevOf
(
root
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
/*
/*
lastRevOf =
δB
.lastRevOf[root]
lastRevOf =
btail
.lastRevOf[root]
rev = lastRevOf[key]
rev = lastRevOf[key]
while rev > at:
while rev > at:
rev = scan
δB
.δBtail ↓ looking for change(key) # XXX linear scan
rev = scan
btail
.δBtail ↓ looking for change(key) # XXX linear scan
return rev
return rev
*/
*/
return
0
,
false
// XXX stub (saying take only ZBlk.rev into account)
return
0
,
false
// XXX stub (saying take only ZBlk.rev into account)
}
}
func
(
δB
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
func
(
btail
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
δB
.
δZtail
.
ForgetPast
(
revCut
)
// XXX stub
btail
.
δZtail
.
ForgetPast
(
revCut
)
// XXX stub
}
}
wcfs/misc.go
View file @
7bd1ae31
...
@@ -705,8 +705,7 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
...
@@ -705,8 +705,7 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
}
}
func
(
δf
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔFentry
{
func
(
δf
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔFentry
{
δf
.
ΔTail
.
Update
(
δZ
)
δB
:=
δf
.
ΔTail
.
Update
(
δZ
)
δB
:=
xbtree
.
ΔRevEntry
{}
// XXX stub
var
changev
[]
ΔFile
// δB.Changev root -> file (via .fileIdx)
var
changev
[]
ΔFile
// δB.Changev root -> file (via .fileIdx)
for
_
,
δ
:=
range
δB
.
Changev
{
for
_
,
δ
:=
range
δB
.
Changev
{
files
:=
δf
.
fileIdx
[
δ
.
Root
]
files
:=
δf
.
fileIdx
[
δ
.
Root
]
...
...
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