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
9e0450d4
Commit
9e0450d4
authored
Jul 20, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f59e1cb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
wcfs/wcfs.go
wcfs/wcfs.go
+4
-3
wcfs/zblk.go
wcfs/zblk.go
+19
-18
No files found.
wcfs/wcfs.go
View file @
9e0450d4
...
...
@@ -256,6 +256,7 @@ import (
"syscall"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
_
"lab.nexedi.com/kirr/neo/go/zodb/wks"
"github.com/hanwen/go-fuse/fuse"
...
...
@@ -478,13 +479,13 @@ func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (
// TODO set it to Connection.CacheControl
type
zodbCacheControl
struct
{}
func
(
cc
*
zodbCacheControl
)
WantEvict
(
obj
IPersistent
)
bool
{
func
(
cc
*
zodbCacheControl
)
WantEvict
(
obj
zodb
.
IPersistent
)
bool
{
switch
obj
.
(
type
)
{
default
:
return
true
case
*
Z
BTree
:
case
*
Z
Bucket
:
case
*
btree
.
BTree
:
case
*
btree
.
Bucket
:
}
return
false
...
...
wcfs/zblk.go
View file @
9e0450d4
...
...
@@ -24,7 +24,8 @@ package main
import
(
//"context"
//"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
pickle
"github.com/kisielk/og-rek"
)
...
...
@@ -35,7 +36,7 @@ const zwendelin = "wendelin.bigfile.file_zodb"
// ZBlk0 mimics ZBlk0 from python.
type
ZBlk0
struct
{
*
PyPersistent
*
zodb
.
PyPersistent
blkdata
string
}
...
...
@@ -58,7 +59,7 @@ func (zb *ZBlk0) PySetState(pystate interface{}) error {
// ZData mimics ZData from python.
type
ZData
struct
{
*
PyPersistent
*
zodb
.
PyPersistent
data
string
}
...
...
@@ -79,9 +80,9 @@ func (zd *ZData) PySetState(pystate interface{}) error {
// ZBlk1 mimics ZBlk1 from python.
type
ZBlk1
struct
{
*
PyPersistent
*
zodb
.
PyPersistent
chunktab
*
Z
BTree
// {} offset -> ZData(chunk)
chunktab
*
btree
.
BTree
// {} offset -> ZData(chunk)
}
func
(
zb
*
ZBlk1
)
DropState
()
{
...
...
@@ -89,7 +90,7 @@ func (zb *ZBlk1) DropState() {
}
func
(
zb
*
ZBlk1
)
PySetState
(
pystate
interface
{})
error
{
chunktab
,
ok
:=
pystate
.
(
*
Z
BTree
)
chunktab
,
ok
:=
pystate
.
(
*
btree
.
BTree
)
if
!
ok
{
// XXX
}
...
...
@@ -103,10 +104,10 @@ func (zb *ZBlk1) PySetState(pystate interface{}) error {
// ZBigFile mimics ZBigFile from python.
type
ZBigFile
struct
{
*
PyPersistent
*
zodb
.
PyPersistent
blksize
int64
blktab
*
Z
BTree
// LOBtree{} blk -> ZBlk*(blkdata)
blktab
*
btree
.
BTree
// LOBtree{} blk -> ZBlk*(blkdata)
}
...
...
@@ -134,7 +135,7 @@ func (bf *ZBigFile) PySetState(pystate interface{}) (err error) {
// XXX
}
blktab
,
ok
:=
t
[
1
]
.
(
*
Z
BTree
)
blktab
,
ok
:=
t
[
1
]
.
(
*
btree
.
BTree
)
if
!
ok
{
// XXX
}
...
...
@@ -147,15 +148,15 @@ func (bf *ZBigFile) PySetState(pystate interface{}) (err error) {
// ----------------------------------------
func
zblk0New
(
base
*
PyPersistent
)
IPyPersistent
{
return
&
ZBlk0
{
PyPersistent
:
base
}
}
func
zblk1New
(
base
*
PyPersistent
)
IPyPersistent
{
return
&
ZBlk1
{
PyPersistent
:
base
}
}
func
zdataNew
(
base
*
PyPersistent
)
IPyPersistent
{
return
&
ZData
{
PyPersistent
:
base
}
}
func
zbigfileNew
(
pyobj
*
PyPersistent
)
IPyPersistent
{
return
&
ZBigFile
{
PyPersistent
:
pyobj
}
}
func
zblk0New
(
base
*
zodb
.
PyPersistent
)
zodb
.
IPyPersistent
{
return
&
ZBlk0
{
PyPersistent
:
base
}
}
func
zblk1New
(
base
*
zodb
.
PyPersistent
)
zodb
.
IPyPersistent
{
return
&
ZBlk1
{
PyPersistent
:
base
}
}
func
zdataNew
(
base
*
zodb
.
PyPersistent
)
zodb
.
IPyPersistent
{
return
&
ZData
{
PyPersistent
:
base
}
}
func
zbigfileNew
(
pyobj
*
zodb
.
PyPersistent
)
zodb
.
IPyPersistent
{
return
&
ZBigFile
{
PyPersistent
:
pyobj
}
}
func
init
()
{
registerPy
Class
(
zwendelin
+
".ZBlk"
,
zblk0New
)
registerPy
Class
(
zwendelin
+
".ZBlk0"
,
zblk0New
)
registerPy
Class
(
zwendelin
+
".ZBlk1"
,
zblk1New
)
registerPy
Class
(
zwendelin
+
".ZData"
,
zdataNew
)
registerPy
Class
(
zwendelin
+
".ZBigFile"
,
zbigfileNew
)
zodb
.
PyRegister
Class
(
zwendelin
+
".ZBlk"
,
zblk0New
)
zodb
.
PyRegister
Class
(
zwendelin
+
".ZBlk0"
,
zblk0New
)
zodb
.
PyRegister
Class
(
zwendelin
+
".ZBlk1"
,
zblk1New
)
zodb
.
PyRegister
Class
(
zwendelin
+
".ZData"
,
zdataNew
)
zodb
.
PyRegister
Class
(
zwendelin
+
".ZBigFile"
,
zbigfileNew
)
}
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