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
a34148fe
Commit
a34148fe
authored
Sep 03, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0d2aec32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
wcfs/wcfs.go
wcfs/wcfs.go
+3
-3
wcfs/zblk.go
wcfs/zblk.go
+12
-12
No files found.
wcfs/wcfs.go
View file @
a34148fe
...
...
@@ -470,7 +470,7 @@ func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (
// zodbCacheControl implements LiveCacheControl to tune ZODB to never evict
//
ZBTree/ZBucket from live cache. We want to keep ZBTree/Z
Bucket always alive
//
LOBTree/LOBucket from live cache. We want to keep LOBTree/LO
Bucket always alive
// becuse it is essentially the index where to find ZBigFile data.
//
// For the data itself - we put it to kernel cache and always deactivate from
...
...
@@ -484,8 +484,8 @@ func (cc *zodbCacheControl) WantEvict(obj zodb.IPersistent) bool {
default
:
return
true
case
*
btree
.
BTree
:
case
*
btree
.
Bucket
:
case
*
btree
.
LO
BTree
:
case
*
btree
.
LO
Bucket
:
}
return
false
...
...
wcfs/zblk.go
View file @
a34148fe
...
...
@@ -105,7 +105,7 @@ func (zd *zDataState) PySetState(pystate interface{}) error {
type
ZBlk1
struct
{
zodb
.
Persistent
chunktab
*
btree
.
BTree
// {} offset -> ZData(chunk)
chunktab
*
btree
.
IO
BTree
// {} offset -> ZData(chunk)
}
type
zBlk1State
ZBlk1
// hide state methods from public API
...
...
@@ -115,10 +115,10 @@ func (zb *zBlk1State) DropState() {
}
func
(
zb
*
zBlk1State
)
PySetState
(
pystate
interface
{})
error
{
chunktab
,
ok
:=
pystate
.
(
*
btree
.
BTree
)
chunktab
,
ok
:=
pystate
.
(
*
btree
.
IO
BTree
)
if
!
ok
{
//return fmt.Errorf("expect BTree; got %T", pystate)
return
fmt
.
Errorf
(
"expect BTree; got %#v"
,
pystate
)
//return fmt.Errorf("expect
IO
BTree; got %T", pystate)
return
fmt
.
Errorf
(
"expect
IO
BTree; got %#v"
,
pystate
)
}
zb
.
chunktab
=
chunktab
...
...
@@ -180,7 +180,7 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
}
// loadBucket loads all ZData objects from leaf BTree bucket.
loadBucket
:=
func
(
b
*
btree
.
Bucket
)
error
{
loadBucket
:=
func
(
b
*
btree
.
IO
Bucket
)
error
{
err
:=
b
.
PActivate
(
ctx
)
if
err
!=
nil
{
return
err
...
...
@@ -208,8 +208,8 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
// loadBTree spawns loading of all BTree children.
var
loadBTree
func
(
t
*
btree
.
BTree
)
error
loadBTree
=
func
(
t
*
btree
.
BTree
)
error
{
var
loadBTree
func
(
t
*
btree
.
IO
BTree
)
error
loadBTree
=
func
(
t
*
btree
.
IO
BTree
)
error
{
err
:=
t
.
PActivate
(
ctx
)
if
err
!=
nil
{
return
err
...
...
@@ -220,12 +220,12 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
for
_
,
e
:=
range
t
.
Entryv
()
{
switch
child
:=
e
.
Child
()
.
(
type
)
{
case
*
btree
.
BTree
:
case
*
btree
.
IO
BTree
:
wg
.
Go
(
func
()
error
{
return
loadBTree
(
child
)
})
case
*
btree
.
Bucket
:
case
*
btree
.
IO
Bucket
:
wg
.
Go
(
func
()
error
{
return
loadBucket
(
child
)
})
...
...
@@ -299,7 +299,7 @@ type ZBigFile struct {
zodb
.
Persistent
blksize
int64
blktab
*
btree
.
BTree
// LOBtree
{} blk -> ZBlk*(blkdata)
blktab
*
btree
.
LOBTree
//
{} blk -> ZBlk*(blkdata)
}
type
zBigFileState
ZBigFile
// hide state methods from public API
...
...
@@ -332,9 +332,9 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
return
fmt
.
Errorf
(
"blksize: expect integer; got %T"
,
t
[
0
])
}
blktab
,
ok
:=
t
[
1
]
.
(
*
btree
.
BTree
)
blktab
,
ok
:=
t
[
1
]
.
(
*
btree
.
LO
BTree
)
if
!
ok
{
return
fmt
.
Errorf
(
"blktab: expect BTree; got %T"
,
t
[
1
])
return
fmt
.
Errorf
(
"blktab: expect
LO
BTree; got %T"
,
t
[
1
])
}
bf
.
blksize
=
0
// XXX blksize
...
...
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