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
c63dbe30
Commit
c63dbe30
authored
Apr 18, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
441e3666
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
12 deletions
+32
-12
wcfs/δbtail.go
wcfs/δbtail.go
+24
-5
wcfs/δftail.go
wcfs/δftail.go
+8
-7
No files found.
wcfs/δbtail.go
View file @
c63dbe30
...
...
@@ -99,8 +99,8 @@ type ΔBtail struct {
trackNew
map
[
zodb
.
Oid
]
struct
{}
// XXX SetOid
}
// Δ represents a change in BTrees space.
type
Δ
struct
{
// Δ
B
represents a change in BTrees space.
type
Δ
B
struct
{
Rev
zodb
.
Tid
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
...
...
@@ -206,7 +206,7 @@ func (δBtail *ΔBtail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// only those keys, that correspond to tracked subset of δZ.
//
// δZ should include all objects changed by ZODB transaction.
func
(
δBtail
*
ΔBtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
Δ
{
func
(
δBtail
*
ΔBtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
Δ
B
{
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// {} root -> []oid changed under that root
...
...
@@ -221,7 +221,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) Δ {
}
}
δB
:=
Δ
{
Rev
:
δZ
.
Tid
,
Change
:
make
(
map
[
*
Tree
]
map
[
Key
]
Value
)}
δB
:=
Δ
B
{
Rev
:
δZ
.
Tid
,
Change
:
make
(
map
[
*
Tree
]
map
[
Key
]
Value
)}
if
len
(
δZByRoot
)
==
0
{
return
δB
// tracked set not changed
...
...
@@ -335,10 +335,17 @@ func (δΒtail *ΔBtail) Get(ctx context.Context, root *Tree, key Key, at zodb.T
return
}
// XXX SliceByRev
// XXX
func
(
δBtail
*
ΔBtail
)
SliceByRev
(
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔB
{
δassertSlice
(
δBtail
,
lo
,
hi
)
panic
(
"TODO"
)
}
// XXX
func
(
δBtail
*
ΔBtail
)
SliceByRootRev
(
root
*
Tree
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔTree
{
δassertSlice
(
δBtail
,
lo
,
hi
)
panic
(
"TODO"
)
}
...
...
@@ -388,3 +395,15 @@ func (δBtail *ΔBtail) SliceByRootRev(root *Tree, lo, hi zodb.Tid) /*readonly*/
//
// . -k(blk) -> invalidate #blk
// . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
// misc
// δassertSlice asserts that δ.tail ≤ lo ≤ hi ≤ δ.head
func
δassertSlice
(
δ
interface
{
Head
()
zodb
.
Tid
;
Tail
()
zodb
.
Tid
},
lo
,
hi
zodb
.
Tid
)
{
tail
:=
δ
.
Tail
()
head
:=
δ
.
Head
()
if
!
(
tail
<=
lo
&&
lo
<=
hi
&&
hi
<=
head
)
{
panicf
(
"invalid slice: (%s, %s]; (tail, head] = (%s, %s]"
,
lo
,
hi
,
tail
,
head
)
}
}
wcfs/δftail.go
View file @
c63dbe30
...
...
@@ -155,15 +155,16 @@ func (δFtail *ΔFtail) ForgetPast(revCut zodb.Tid) {
panic
(
"TODO"
)
}
// XXX SliceByRev
// XXX
func
(
δFtail
*
ΔFtail
)
SliceByRev
(
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔF
{
δassertSlice
(
δFtail
,
lo
,
hi
)
// XXX SliceByFileRev
panic
(
"TODO"
)
}
// XXX
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
f
*
BigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
Δfile
{
tail
:=
δFtail
.
Tail
()
head
:=
δFtail
.
Head
()
if
!
(
tail
<=
lo
&&
lo
<=
hi
&&
hi
<=
head
)
{
panicf
(
"δFtail.SliceByFileRev: invalid query: (%s, %s]; (tail, head] = (%s, %s]"
,
lo
,
hi
,
tail
,
head
)
}
δassertSlice
(
δFtail
,
lo
,
hi
)
// XXX activate zfile?
vδT
:=
δFtail
.
δBtail
.
SliceByRootRev
(
f
.
zfile
.
blktab
,
lo
,
hi
)
...
...
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