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
67a29ab6
Commit
67a29ab6
authored
Apr 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
873e336e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+10
-14
wcfs/wcfs.go
wcfs/wcfs.go
+1
-0
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
67a29ab6
...
...
@@ -83,7 +83,7 @@ type ΔTail struct {
// 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
δRtail
[]
Δ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
// XXX or ask client provide db on every call?
...
...
@@ -102,21 +102,17 @@ type Δ struct {
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
/*
// ΔRoots describes which BTrees were change in one revision.
// XXX kill?
type
ΔRoots
struct
{
Rev
zodb
.
Tid
Changev
[]
*
Tree
// root XXX -> Oid? XXX -> SetTree?
}
*/
// ΔTreeTail represent tail of revisional changes to one BTree.
//
// See ΔTail documentation for details.
type
ΔTreeTail
struct
{
δTtail
[]
ΔTree
// changes to tree keys; rev↑. covers keys ∈ tracket subset
vδT
[]
ΔTree
// changes to tree keys; rev↑. covers keys ∈ tracket subset
// {}k/v @tail for keys that are changed in (tail, head].
KVAtTail
map
[
Key
]
Value
...
...
@@ -128,7 +124,7 @@ type ΔTreeTail struct {
// ΔTree describes changes to one BTree in one revision.
type
ΔTree
struct
{
Rev
zodb
.
Tid
Root
*
Tree
// XXX ok to have here?
//
Root *Tree // XXX ok to have here?
KV
map
[
Key
]
Value
}
...
...
@@ -271,15 +267,15 @@ func (δΒtail *ΔTail) Get(root *Tree, key Key, at zodb.Tid) (value Value, ok b
// XXX stub -> that only ZBlk.rev is used
// XXX -> index lastXXXOf(key) | linear scan ↓ looking for change <= at
δ
t
:=
δΒtail
.
byRoot
[
root
]
for
i
:=
len
(
δ
t
.
δTtail
)
-
1
;
i
>=
0
;
i
--
{
δ
:=
δt
.
δTtail
[
i
]
if
at
<
δ
.
Rev
{
δ
Ttail
:=
δΒtail
.
byRoot
[
root
]
for
i
:=
len
(
δ
Ttail
.
vδT
)
-
1
;
i
>=
0
;
i
--
{
δ
T
:=
δTtail
.
vδT
[
i
]
if
at
<
δ
T
.
Rev
{
continue
}
value
,
ok
=
δ
.
KV
[
key
]
value
,
ok
=
δ
T
.
KV
[
key
]
if
ok
{
rev
=
δ
.
Rev
rev
=
δ
T
.
Rev
revExact
=
true
break
}
...
...
@@ -291,7 +287,7 @@ func (δΒtail *ΔTail) Get(root *Tree, key Key, at zodb.Tid) (value Value, ok b
}
// key not in history tail
value
,
ok
=
δ
t
.
KVAtTail
[
key
]
value
,
ok
=
δ
Ttail
.
KVAtTail
[
key
]
rev
=
δΒtail
.
Tail
()
revExact
=
false
return
...
...
wcfs/wcfs.go
View file @
67a29ab6
...
...
@@ -408,6 +408,7 @@ package main
//
// δZ - change in ZODB space
// δB - change in BTree*s* space
// δT - change in BTree(1) space
// δF - change in File*s* space
// δfile - change in File(1) space
...
...
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