Commit 9e0450d4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f59e1cb4
......@@ -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 *ZBTree:
case *ZBucket:
case *btree.BTree:
case *btree.Bucket:
}
return false
......
......@@ -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 *ZBTree // {} 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.(*ZBTree)
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 *ZBTree // 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].(*ZBTree)
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() {
registerPyClass(zwendelin + ".ZBlk", zblk0New)
registerPyClass(zwendelin + ".ZBlk0", zblk0New)
registerPyClass(zwendelin + ".ZBlk1", zblk1New)
registerPyClass(zwendelin + ".ZData", zdataNew)
registerPyClass(zwendelin + ".ZBigFile", zbigfileNew)
zodb.PyRegisterClass(zwendelin + ".ZBlk", zblk0New)
zodb.PyRegisterClass(zwendelin + ".ZBlk0", zblk0New)
zodb.PyRegisterClass(zwendelin + ".ZBlk1", zblk1New)
zodb.PyRegisterClass(zwendelin + ".ZData", zdataNew)
zodb.PyRegisterClass(zwendelin + ".ZBigFile", zbigfileNew)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment