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
ef12f1da
Commit
ef12f1da
authored
Feb 05, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
597bb439
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
wcfs/internal/δbtree/δbtree.go
wcfs/internal/δbtree/δbtree.go
+13
-5
wcfs/notes.txt
wcfs/notes.txt
+2
-0
wcfs/wcfs.go
wcfs/wcfs.go
+3
-3
No files found.
wcfs/internal/δbtree/δbtree.go
View file @
ef12f1da
...
...
@@ -32,10 +32,14 @@ import (
type
Tree
=
btree
.
LOBTree
type
Bucket
=
btree
.
LOBucket
// Path
Map is a residency index which maps BTree|Bucket to top tree element
.
// Path
Set is a collection of BTree paths
.
//
// PathMap is not safe for concurrent access.
type
PathMap
struct
{
// For example it can be a set of visited BTree paths.
// There is no requirement that paths belong to only one single BTree.
//
// PathSet is not safe for concurrent access.
type
PathSet
struct
{
// residency index which maps BTree|Bucket to top tree element.
residencyIdx
map
[
zodb
.
Oid
]
SetTree
// oid -> {} roots
}
...
...
@@ -43,7 +47,9 @@ type PathMap struct {
//
// path[0] signifies a root.
// All path elemens must be Tree except last one which must be Bucket.
func
(
m
*
PathMap
)
Add
(
path
[]
zodb
.
IPersistent
)
{
//
// XXX catch cycles on add?
func
(
m
*
PathSet
)
Add
(
path
[]
zodb
.
IPersistent
)
{
l
:=
len
(
path
)
if
l
==
0
{
panic
(
"empty path"
)
...
...
@@ -82,7 +88,9 @@ func (m *PathMap) Add(path []zodb.IPersistent) {
// returned are: roots of changed trees.
//
// XXX stub.
func
(
m
*
PathMap
)
Invalidates
(
changev
[]
zodb
.
Oid
)
SetTree
{
//
// TODO toposort changev wrt nodes ordering (defined by traversed paths) and do δbtree top-down.
func
(
m
*
PathSet
)
Invalidates
(
changev
[]
zodb
.
Oid
)
SetTree
{
toinvalidate
:=
make
(
SetTree
)
for
_
,
oid
:=
range
changev
{
...
...
wcfs/notes.txt
View file @
ef12f1da
...
...
@@ -182,6 +182,8 @@ i.e. exactly as for buckets and it accumulates to global Δ.
The globally-accumulated Δ is the answer for δ(BTree, (@new, []oid))
top-down order is obtained via toposort({oid}) wrt visited PathSet.
XXX -> internal/btreediff ?
δ(BTree) in wcfs context:
...
...
wcfs/wcfs.go
View file @
ef12f1da
...
...
@@ -460,8 +460,8 @@ type BigFileDir struct {
mu
sync
.
Mutex
fileTab
map
[
zodb
.
Oid
]
*
BigFile
//
residency index for btree|bucket -> which fil
e
b
treeMap
*
δbtree
.
PathMap
//
visited BTree nodes -> which file + ordering for toposort on δbtre
e
b
lktabLoaded
*
δbtree
.
PathSet
}
// /(head|<rev>)/bigfile/<bigfileX> - served by BigFile.
...
...
@@ -1162,7 +1162,7 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) error {
close
(
loading
.
ready
)
// XXX locking
_
=
treepath
// TODO -> btreeMap
x
.
blktabVisited
.
Add
(
treepath
)
// XXX before loading.ready?
blkrevmax
,
_
:=
f
.
δFtail
.
LastRevOf
(
blk
,
zbf
.
PJar
()
.
At
())
...
...
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