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
0ed8303d
Commit
0ed8303d
authored
Apr 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2b918c95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
21 deletions
+22
-21
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+15
-14
wcfs/wcfs.go
wcfs/wcfs.go
+1
-1
wcfs/δftail.go
wcfs/δftail.go
+6
-6
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
0ed8303d
...
...
@@ -38,19 +38,12 @@ type Key = int64
type
Value
=
zodb
.
Oid
// XXX assumes key points to IPersistent
// XXX how to represent deletion? InvalidOid?
// ΔB represents a change in BTrees space.
//
// XXX place
type
ΔB
struct
{
Rev
zodb
.
Tid
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
// ΔTail represents tail of revisional changes to BTrees.
//
// It semantically consists of
//
// []δB ; rev ∈ (tail, head
// []δB ; rev ∈ (tail, head]
// atTail
//
// where δB represents a change in BTrees space
//
...
...
@@ -58,7 +51,10 @@ type ΔB struct {
// .rev↑
// {} root -> {}(key, value)
//
// XXX + atTail
// and atTail keeps set of k/v @tail for keys changed in (tail, head]
//
// atTail:
// {} root -> {}(key, value)
//
// It covers changes to keys from tracked subset of BTrees parts and
// semantically consists of
...
...
@@ -111,6 +107,13 @@ type ΔTail struct {
trackNew
map
[
zodb
.
Oid
]
struct
{}
// XXX SetOid
}
// Δ represents a change in BTrees space.
type
Δ
struct
{
Rev
zodb
.
Tid
Change
map
[
*
Tree
]
map
[
Key
]
Value
// {} root -> {}(key, value)
}
// ΔRoots describes which BTrees were change in one revision.
// XXX kill?
type
ΔRoots
struct
{
...
...
@@ -204,9 +207,7 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// Only those objects from δZ that belong to tracked set are guaranteed to be
// taken into account. In other words a tree history will assuredly include
// only those keys, that correspond to tracked subset of δZ.
//
// XXX returned [](root, []key) -> move to separate SliceByRev to get diff?
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔB
{
func
(
btail
*
ΔTail
)
Update
(
δZ
*
zodb
.
EventCommit
)
Δ
{
btail
.
ΔZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// {} root -> []oid changed under that root
...
...
@@ -221,7 +222,7 @@ func (btail *ΔTail) Update(δZ *zodb.EventCommit) ΔB {
}
}
δB
:=
Δ
B
{
Rev
:
δZ
.
Tid
,
Change
:
make
(
map
[
*
Tree
]
map
[
Key
]
Value
)}
δB
:=
Δ
{
Rev
:
δZ
.
Tid
,
Change
:
make
(
map
[
*
Tree
]
map
[
Key
]
Value
)}
if
len
(
δZByRoot
)
==
0
{
return
δB
// tracked set not changed
...
...
wcfs/wcfs.go
View file @
0ed8303d
...
...
@@ -508,7 +508,7 @@ type BigFileDir struct {
// δ of tracked BTree nodes of all BigFiles + -> which file
// (used only for head/, not revX/)
δFmu
sync
.
RWMutex
δFtail
*
ΔF
T
ail
δFtail
*
ΔF
t
ail
}
// /(head|<rev>)/bigfile/<bigfileX> - served by BigFile.
...
...
wcfs/δftail.go
View file @
0ed8303d
...
...
@@ -51,7 +51,7 @@ import (
//
//
// XXX only tracked blocks.
type
ΔF
T
ail
struct
{
type
ΔF
t
ail
struct
{
*
xbtree
.
ΔTail
fileIdx
map
[
*
btree
.
LOBTree
]
SetBigFile
// root -> {} BigFile XXX root -> oid?
}
...
...
@@ -62,8 +62,8 @@ type ΔF struct {
Change
map
[
*
BigFile
]
SetI64
// file -> δfile (= {}#blk)
}
func
NewΔFTail
(
at0
zodb
.
Tid
)
*
ΔF
T
ail
{
return
&
ΔF
T
ail
{
func
NewΔFTail
(
at0
zodb
.
Tid
)
*
ΔF
t
ail
{
return
&
ΔF
t
ail
{
ΔTail
:
xbtree
.
NewΔTail
(
at0
),
fileIdx
:
make
(
map
[
*
btree
.
LOBTree
]
SetBigFile
),
}
...
...
@@ -72,7 +72,7 @@ func NewΔFTail(at0 zodb.Tid) *ΔFTail {
// Track adds tree path to tracked set and associates path root with file.
//
// A root can be associated with several files (each provided on different Track call).
func
(
δf
*
ΔF
T
ail
)
Track
(
file
*
BigFile
,
path
[]
btree
.
LONode
)
{
func
(
δf
*
ΔF
t
ail
)
Track
(
file
*
BigFile
,
path
[]
btree
.
LONode
)
{
δf
.
ΔTail
.
Track
(
path
)
root
:=
path
[
0
]
.
(
*
btree
.
LOBTree
)
files
,
ok
:=
δf
.
fileIdx
[
root
]
...
...
@@ -86,13 +86,13 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
// Update updates δFtail given raw ZODB changes.
//
// It returns corresponding change in files space.
func
(
δFtail
*
ΔF
T
ail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
func
(
δFtail
*
ΔF
t
ail
)
Update
(
δZ
*
zodb
.
EventCommit
)
ΔF
{
δB
:=
δFtail
.
ΔTail
.
Update
(
δZ
)
δF
:=
ΔF
{
Rev
:
δB
.
Rev
,
Change
:
make
(
map
[
*
BigFile
]
SetI64
)}
for
root
,
δt
:=
range
δB
.
Change
{
files
:=
δFtail
.
fileIdx
[
root
]
if
len
(
files
)
==
0
{
panicf
(
"ΔF
T
ail: root<%s> -> ø file"
,
root
.
POid
())
panicf
(
"ΔF
t
ail: root<%s> -> ø file"
,
root
.
POid
())
}
for
file
:=
range
files
{
δfile
,
ok
:=
δF
.
Change
[
file
]
...
...
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