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
25a4723c
Commit
25a4723c
authored
Apr 02, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
dedcb356
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
11 deletions
+21
-11
wcfs/internal/δbtree/δbtail.go
wcfs/internal/δbtree/δbtail.go
+13
-0
wcfs/internal/δbtree/δbtree.go
wcfs/internal/δbtree/δbtree.go
+3
-6
wcfs/wcfs.go
wcfs/wcfs.go
+1
-1
wcfs/zblk.go
wcfs/zblk.go
+4
-4
No files found.
wcfs/internal/δbtree/δbtail.go
View file @
25a4723c
...
...
@@ -20,6 +20,10 @@
package
δbtree
// XXX -> another package?
import
(
"lab.nexedi.com/kirr/neo/go/zodb"
)
// ΔBTail reprsents tail of revisional changes to BTrees.
//
// It semantically consists of
...
...
@@ -32,6 +36,7 @@ package δbtree
// that ∈ BTree subgraphs that were explicitly requested to be tracked by δB.
//
// XXX incremental; not full coverage
// XXX -> ΔBIndex ?
type
ΔBTail
struct
{
//at // = head
δZtail
*
zodb
.
ΔTail
...
...
@@ -57,6 +62,8 @@ func (δb *ΔBTail) Track(path []zodb.IPersistent) { // XXX Tree|Bucket; path[0]
// Update updates δB with per-object level ZODB changes.
//
// XXX return -> [] of (root, []key) that are invalidated.
//
// XXX text ...
// XXX -> Append? -> Invalidate?
// XXX -> DiffTo ?
...
...
@@ -83,6 +90,12 @@ func (δB *ΔBTail) Update(δZ *zodb.EventCommit) {
diff(B, B')
...
XXX rebuild something?
-> [] of (root, []key)
*/
}
func
(
δB
*
ΔBTail
)
LastRevOf
(
root
Tree
,
key
Key
,
at
zodb
.
Tid
)
zodb
.
Tid
{
panic
(
"TODO"
)
}
wcfs/internal/δbtree/δbtree.go
View file @
25a4723c
...
...
@@ -24,14 +24,14 @@ package δbtree
//go:generate ../../gen-set δbtree Object interface{} zset_object.go
import
(
"fmt"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
)
type
Tree
=
btree
.
LOBTree
type
Bucket
=
btree
.
LOBucket
type
Node
=
btree
.
LONode
type
Key
=
int64
// PathSet is a collection of BTree paths.
//
...
...
@@ -64,7 +64,7 @@ func NewPathSet() *PathSet {
// A root can be associated with several masters (each provided on different Add call)
//
// XXX catch cycles on add?
func
(
m
*
PathSet
)
Add
(
master
interface
{},
path
[]
zodb
.
IPersistent
)
{
func
(
m
*
PathSet
)
Add
(
master
interface
{},
path
[]
Node
)
{
//fmt.Printf("\n\nPathSet.Add %v %s\n", master, path)
l
:=
len
(
path
)
...
...
@@ -75,9 +75,6 @@ func (m *PathSet) Add(master interface{}, path []zodb.IPersistent) {
var
root
*
Tree
for
i
,
node
:=
range
path
{
switch
node
:=
node
.
(
type
)
{
default
:
panic
(
fmt
.
Sprintf
(
"path elements must be Tree|Bucket, not %T"
,
node
))
case
*
Tree
:
if
i
==
0
{
root
=
node
...
...
wcfs/wcfs.go
View file @
25a4723c
...
...
@@ -1143,7 +1143,7 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
// XXX do we really need to use/propagate caller contex here? ideally update
// watchers should be synchronous, and in practice we just use 30s timeout.
// Should a READ interrupt cause watch update failure?
func
(
f
*
BigFile
)
updateWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
zodb
.
IPersistent
,
pathRevMax
zodb
.
Tid
)
{
func
(
f
*
BigFile
)
updateWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
pathRevMax
zodb
.
Tid
)
{
// only head/ is being watched for
if
f
.
head
.
rev
!=
0
{
return
...
...
wcfs/zblk.go
View file @
25a4723c
...
...
@@ -445,7 +445,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
// - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
//
// XXX better load into user-provided buf? mem.Buf?
func
(
bf
*
ZBigFile
)
LoadBlk
(
ctx
context
.
Context
,
blk
int64
)
(
_
[]
byte
,
treePath
[]
zodb
.
IPersistent
,
pathRevMax
zodb
.
Tid
,
err
error
)
{
func
(
bf
*
ZBigFile
)
LoadBlk
(
ctx
context
.
Context
,
blk
int64
)
(
_
[]
byte
,
treePath
[]
btree
.
LONode
,
pathRevMax
zodb
.
Tid
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"bigfile %s: loadblk %d"
,
bf
.
POid
(),
blk
)
err
=
bf
.
PActivate
(
ctx
)
...
...
@@ -455,7 +455,7 @@ func (bf *ZBigFile) LoadBlk(ctx context.Context, blk int64) (_ []byte, treePath
defer
bf
.
PDeactivate
()
pathRevMax
=
0
xzblk
,
ok
,
err
:=
bf
.
blktab
.
VGet
(
ctx
,
blk
,
func
(
node
zodb
.
IPersistent
)
{
xzblk
,
ok
,
err
:=
bf
.
blktab
.
VGet
(
ctx
,
blk
,
func
(
node
btree
.
LONode
)
{
treePath
=
append
(
treePath
,
node
)
pathRevMax
=
tidmax
(
pathRevMax
,
node
.
PSerial
())
})
...
...
@@ -498,7 +498,7 @@ func (bf *ZBigFile) LoadBlk(ctx context.Context, blk int64) (_ []byte, treePath
// Size returns whole file size.
//
// it also returns BTree path scaned to obtain size.
func
(
bf
*
ZBigFile
)
Size
(
ctx
context
.
Context
)
(
_
int64
,
treePath
[]
zodb
.
IPersistent
,
err
error
)
{
func
(
bf
*
ZBigFile
)
Size
(
ctx
context
.
Context
)
(
_
int64
,
treePath
[]
btree
.
LONode
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"bigfile %s: size"
,
bf
.
POid
())
err
=
bf
.
PActivate
(
ctx
)
...
...
@@ -508,7 +508,7 @@ func (bf *ZBigFile) Size(ctx context.Context) (_ int64, treePath []zodb.IPersist
defer
bf
.
PDeactivate
()
//fmt.Printf("\n\n\nSize ...\n")
tailblk
,
ok
,
err
:=
bf
.
blktab
.
VMaxKey
(
ctx
,
func
(
node
zodb
.
IPersistent
)
{
tailblk
,
ok
,
err
:=
bf
.
blktab
.
VMaxKey
(
ctx
,
func
(
node
btree
.
LONode
)
{
//fmt.Printf("visit %v\n", node)
treePath
=
append
(
treePath
,
node
)
})
...
...
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