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
f1d2aae6
Commit
f1d2aae6
authored
Apr 14, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
899dbc2c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+7
-6
wcfs/δftail.go
wcfs/δftail.go
+1
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
f1d2aae6
...
@@ -68,7 +68,8 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
...
@@ -68,7 +68,8 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
//
//
// ΔTail is not safe for concurrent access. XXX -> is safe to use from multiple goroutines simultaneously.
// ΔTail is not safe for concurrent access. XXX -> is safe to use from multiple goroutines simultaneously.
type
ΔTail
struct
{
type
ΔTail
struct
{
δZtail
*
zodb
.
ΔTail
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track
// XXX -> δZtail
ΔZtail
*
zodb
.
ΔTail
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track
δroot
[]
ΔRoots
// which BTree were changed; Noted only by keys ∈ tracket subset
δroot
[]
Δ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
...
@@ -116,7 +117,7 @@ type ΔTree struct {
...
@@ -116,7 +117,7 @@ type ΔTree struct {
// Initial coverage is (at₀, at₀].
// Initial coverage is (at₀, at₀].
func
NewΔTail
(
at0
zodb
.
Tid
)
*
ΔTail
{
func
NewΔTail
(
at0
zodb
.
Tid
)
*
ΔTail
{
return
&
ΔTail
{
return
&
ΔTail
{
δ
Ztail
:
zodb
.
NewΔTail
(
at0
),
Δ
Ztail
:
zodb
.
NewΔTail
(
at0
),
trackIdx
:
make
(
map
[
zodb
.
Oid
]
SetTree
),
trackIdx
:
make
(
map
[
zodb
.
Oid
]
SetTree
),
}
}
}
}
...
@@ -124,12 +125,12 @@ func NewΔTail(at0 zodb.Tid) *ΔTail {
...
@@ -124,12 +125,12 @@ func NewΔTail(at0 zodb.Tid) *ΔTail {
// Head is similar to zodb.ΔTail.Head . XXX ok?
// Head is similar to zodb.ΔTail.Head . XXX ok?
func
(
δb
*
ΔTail
)
Head
()
zodb
.
Tid
{
func
(
δb
*
ΔTail
)
Head
()
zodb
.
Tid
{
//return δb.head
//return δb.head
return
δb
.
δ
Ztail
.
Head
()
return
δb
.
Δ
Ztail
.
Head
()
}
}
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
func
(
δb
*
ΔTail
)
Tail
()
zodb
.
Tid
{
func
(
δb
*
ΔTail
)
Tail
()
zodb
.
Tid
{
return
δb
.
δ
Ztail
.
Tail
()
return
δb
.
Δ
Ztail
.
Tail
()
}
}
// XXX SliceByRev?
// XXX SliceByRev?
...
@@ -178,7 +179,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
...
@@ -178,7 +179,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
//
//
// 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
)
[]
ΔTree
{
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
δZByRoot
:=
map
[
*
Tree
][]
zodb
.
Oid
{}
// XXX -> map[*Tree]SetOid ?
δZByRoot
:=
map
[
*
Tree
][]
zodb
.
Oid
{}
// XXX -> map[*Tree]SetOid ?
...
@@ -253,7 +254,7 @@ func (btail *ΔTail) LastRevOf(root *Tree, key Key, at zodb.Tid) (_ zodb.Tid, ex
...
@@ -253,7 +254,7 @@ func (btail *ΔTail) LastRevOf(root *Tree, key Key, at zodb.Tid) (_ zodb.Tid, ex
}
}
func
(
btail
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
func
(
btail
*
ΔTail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
btail
.
δ
Ztail
.
ForgetPast
(
revCut
)
// XXX stub
btail
.
Δ
Ztail
.
ForgetPast
(
revCut
)
// XXX stub
}
}
...
...
wcfs/δftail.go
View file @
f1d2aae6
...
@@ -136,7 +136,7 @@ func (f *BigFile) LastBlkRev(blk int64, at zodb.Tid) (_ zodb.Tid, exact bool) {
...
@@ -136,7 +136,7 @@ func (f *BigFile) LastBlkRev(blk int64, at zodb.Tid) (_ zodb.Tid, exact bool) {
// blktab[blk] was changed to point to a zblk @rev.
// blktab[blk] was changed to point to a zblk @rev.
// blk revision is max rev and when zblk changed last in (rev, at] range.
// blk revision is max rev and when zblk changed last in (rev, at] range.
zblkRev
,
zblkRevExact
:=
δf
.
ΔTail
.
δ
Ztail
.
LastRevOf
(
zblkOid
,
at
)
zblkRev
,
zblkRevExact
:=
δf
.
ΔTail
.
Δ
Ztail
.
LastRevOf
(
zblkOid
,
at
)
if
zblkRev
>
tabRev
{
if
zblkRev
>
tabRev
{
return
zblkRev
,
zblkRevExact
return
zblkRev
,
zblkRevExact
}
else
{
}
else
{
...
...
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