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 {
...
@@ -83,7 +83,7 @@ type ΔTail struct {
// XXX -> δZtail
// XXX -> δZtail
ΔZtail
*
zodb
.
ΔTail
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track
Δ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
byRoot
map
[
*
Tree
]
*
ΔTreeTail
// root -> k/v change history; only for keys ∈ tracket subset
// XXX or ask client provide db on every call?
// XXX or ask client provide db on every call?
...
@@ -102,21 +102,17 @@ type Δ struct {
...
@@ -102,21 +102,17 @@ type Δ struct {
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
}
/*
// ΔRoots describes which BTrees were change in one revision.
// ΔRoots describes which BTrees were change in one revision.
// XXX kill?
type
ΔRoots
struct
{
type
ΔRoots
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
Changev
[]
*
Tree
// root XXX -> Oid? XXX -> SetTree?
Changev
[]
*
Tree
// root XXX -> Oid? XXX -> SetTree?
}
}
*/
// ΔTreeTail represent tail of revisional changes to one BTree.
// ΔTreeTail represent tail of revisional changes to one BTree.
//
//
// See ΔTail documentation for details.
// See ΔTail documentation for details.
type
ΔTreeTail
struct
{
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].
// {}k/v @tail for keys that are changed in (tail, head].
KVAtTail
map
[
Key
]
Value
KVAtTail
map
[
Key
]
Value
...
@@ -128,7 +124,7 @@ type ΔTreeTail struct {
...
@@ -128,7 +124,7 @@ type ΔTreeTail struct {
// ΔTree describes changes to one BTree in one revision.
// ΔTree describes changes to one BTree in one revision.
type
ΔTree
struct
{
type
ΔTree
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
Root
*
Tree
// XXX ok to have here?
//
Root *Tree // XXX ok to have here?
KV
map
[
Key
]
Value
KV
map
[
Key
]
Value
}
}
...
@@ -271,15 +267,15 @@ func (δΒtail *ΔTail) Get(root *Tree, key Key, at zodb.Tid) (value Value, ok b
...
@@ -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 stub -> that only ZBlk.rev is used
// XXX -> index lastXXXOf(key) | linear scan ↓ looking for change <= at
// XXX -> index lastXXXOf(key) | linear scan ↓ looking for change <= at
δ
t
:=
δΒtail
.
byRoot
[
root
]
δ
Ttail
:=
δΒtail
.
byRoot
[
root
]
for
i
:=
len
(
δ
t
.
δTtail
)
-
1
;
i
>=
0
;
i
--
{
for
i
:=
len
(
δ
Ttail
.
vδT
)
-
1
;
i
>=
0
;
i
--
{
δ
:=
δt
.
δTtail
[
i
]
δ
T
:=
δTtail
.
vδT
[
i
]
if
at
<
δ
.
Rev
{
if
at
<
δ
T
.
Rev
{
continue
continue
}
}
value
,
ok
=
δ
.
KV
[
key
]
value
,
ok
=
δ
T
.
KV
[
key
]
if
ok
{
if
ok
{
rev
=
δ
.
Rev
rev
=
δ
T
.
Rev
revExact
=
true
revExact
=
true
break
break
}
}
...
@@ -291,7 +287,7 @@ func (δΒtail *ΔTail) Get(root *Tree, key Key, at zodb.Tid) (value Value, ok b
...
@@ -291,7 +287,7 @@ func (δΒtail *ΔTail) Get(root *Tree, key Key, at zodb.Tid) (value Value, ok b
}
}
// key not in history tail
// key not in history tail
value
,
ok
=
δ
t
.
KVAtTail
[
key
]
value
,
ok
=
δ
Ttail
.
KVAtTail
[
key
]
rev
=
δΒtail
.
Tail
()
rev
=
δΒtail
.
Tail
()
revExact
=
false
revExact
=
false
return
return
...
...
wcfs/wcfs.go
View file @
67a29ab6
...
@@ -408,6 +408,7 @@ package main
...
@@ -408,6 +408,7 @@ package main
//
//
// δZ - change in ZODB space
// δZ - change in ZODB space
// δB - change in BTree*s* space
// δB - change in BTree*s* space
// δT - change in BTree(1) space
// δF - change in File*s* space
// δF - change in File*s* space
// δfile - change in File(1) 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