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
Hide 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
// taken into account. In other words a tree history will assuredly include
// only those keys, that correspond to tracked subset of δZ.
//
// XXX return -> [] of (root, []key) that are invalidated.
// XXX -> + separate SliceByRev? or Data to get diff?
func
(
δB
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
{
/*
.δZtail += δZ
*/
δB
.
update
()
}
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
(
δB
ΔRevEntry
)
{
btail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// update brings .δBtail up to date by recomputing diff XXX and taking new
// entries in .δZtail into account.
func
(
δB
*
ΔTail
)
update
()
{
/*
δbZ = {}
for δ in δZ:
.trackIdx[δ]:
ø -> nothing
root -> δbZ[root] += δ
// {} root -> []oid changed under that root
δZByRoot
:=
map
[
*
Tree
][]
zodb
.
Oid
{}
// XXX -> map[*Tree]SetOid ?
for
_
,
δ
:=
range
δZ
.
Changev
{
roots
,
ok
:=
btail
.
trackIdx
[
δ
]
if
!
ok
{
continue
}
for
root
:=
range
roots
{
δZByRoot
[
root
]
=
append
(
δZByRoot
[
root
],
δ
)
}
}
δB
.
Rev
=
δZ
.
Tid
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
if δbZ == ø:
return
/* TODO btree-diff:
zconnNew = db.Open(δZ.rev)
defer(zconnNew.close)
...
...
@@ -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) ?
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]
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
0
,
false
// XXX stub (saying take only ZBlk.rev into account)
}
func
(
δB
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
δB
.
δZtail
.
ForgetPast
(
revCut
)
// XXX stub
func
(
btail
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
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) {
}
func
(
δf
*
ΔFTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔFentry
{
δf
.
ΔTail
.
Update
(
δZ
)
δB
:=
xbtree
.
ΔRevEntry
{}
// XXX stub
δB
:=
δf
.
ΔTail
.
Update
(
δZ
)
var
changev
[]
ΔFile
// δB.Changev root -> file (via .fileIdx)
for
_
,
δ
:=
range
δB
.
Changev
{
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