Commit 6c9c45ec authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 073f3f17
...@@ -14,6 +14,16 @@ ...@@ -14,6 +14,16 @@
package main package main
// ZODB BTree handling // ZODB BTree handling
import (
"context"
"lab.nexedi.com/kirr/neo/go/zodb"
)
// XXX -> template
type KEY int64
// ZBucket mimics ?OBucket from btree/py, with ? being any integer. // ZBucket mimics ?OBucket from btree/py, with ? being any integer.
// //
// py description: // py description:
...@@ -32,7 +42,7 @@ type ZBucket struct { ...@@ -32,7 +42,7 @@ type ZBucket struct {
} }
// zBTreeItem mimics BTreeItem from btree/py. // zBTreeItem mimics BTreeItem from btree/py.
type zBTreeItem { type zBTreeItem struct {
key KEY key KEY
child interface{} // ZBTree or ZBucket child interface{} // ZBTree or ZBucket
} }
......
...@@ -34,7 +34,9 @@ package main ...@@ -34,7 +34,9 @@ package main
import ( import (
//"lab.nexedi.com/kirr/neo/go/zodb" "context"
"lab.nexedi.com/kirr/neo/go/zodb"
) )
...@@ -51,11 +53,11 @@ type ZBigFile struct { ...@@ -51,11 +53,11 @@ type ZBigFile struct {
pyobj *zodb.PyObject pyobj *zodb.PyObject
blksize int64 blksize int64
blktab ... // LOBtree{} blk -> ZBlk*(blkdata) blktab *ZBTree // LOBtree{} blk -> ZBlk*(blkdata)
} }
// module of Wendelin ZODB py objects // module of Wendelin ZODB py objects
const zwendelin "wendelin.bigfile.file_zodb" const zwendelin = "wendelin.bigfile.file_zodb"
// loadZBigFile loads ZBigFile object from specified oid. // loadZBigFile loads ZBigFile object from specified oid.
func (conn *zpyconn) loadZBigFile(ctx context.Context, oid zodb.Oid) (*ZBigFile, error) { func (conn *zpyconn) loadZBigFile(ctx context.Context, oid zodb.Oid) (*ZBigFile, error) {
...@@ -92,7 +94,8 @@ func (conn *zpyconn) loadZBigFile(ctx context.Context, oid zodb.Oid) (*ZBigFile, ...@@ -92,7 +94,8 @@ func (conn *zpyconn) loadZBigFile(ctx context.Context, oid zodb.Oid) (*ZBigFile,
taboid, err = decodeOID(t[0]) taboid, err = decodeOID(t[0])
// XXX err // XXX err
if t[1] != pickle.Class{Module: "BTrees.LOBTree", Name: "LOBTree"} { lobtreeClass := pickle.Class{Module: "BTrees.LOBTree", Name: "LOBTree"}
if t[1] != lobtreeClass {
// XXX err // XXX err
} }
......
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