Commit 7f4eb022 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 15123fbf
......@@ -24,7 +24,7 @@
// Each wendelin.core array (ZBigArray) is actually a linear file (ZBigFile)
// and array metadata like dtype, shape and strides associated with it. This
// program exposes as files only ZBigFile data and leaves rest of
// array-specific handling to client. Every ZBigFile is exposed as one separate
// array-specific handling to clients. Every ZBigFile is exposed as one separate
// file that represents whole ZBigFile's data.
//
// For a client, the primary way to access a bigfile should be to mmap
......@@ -227,6 +227,8 @@ package main
// timings depending on clients). No harm here as different bigfiles use
// completely different ZODB BTree and data objects.
//
// For every ZODB connection a dedicated read-only transaction is maintained.
//
//
// Notes on OS pagecache control:
//
......@@ -273,7 +275,7 @@ import (
"github.com/pkg/errors"
)
// /bigfile/ - represented by BigFileRoot.
// /bigfile/ - served by BigFileRoot.
type BigFileRoot struct {
nodefs.Node
zstor zodb.IStorage
......@@ -283,29 +285,25 @@ type BigFileRoot struct {
tab map[zodb.Oid]*BigFileDir
}
// /bigfile/<bigfileX>/ - represented by BigFileDir.
// /bigfile/<bigfileX>/ - served by BigFileDir.
type BigFileDir struct {
nodefs.Node
zdb *zodb.DB
// head/ (XXX just by fs entry)
// head/ is implicitly linked to by fs
// {} rev -> @<rev>/ bigfile snapshot
revMu sync.Mutex
//revTab map[zodb.Tid]*BigFileRev
revTab map[zodb.Tid]*BigFileRev
}
// /bigfile/<bigfileX>/head/ - represented by BigFileHead.
// XXX -> BigFileRev (with head | @tid) ?
type BigFileHead struct {
// /bigfile/<bigfileX>/(head|<rev>)/ - served by BigFileRev.
type BigFileRev struct {
nodefs.Node
data *BigFileData
//inv *BigFileInvalidations
// data, at, invalidations, etc - all implicitly linked to by fs
}
// /bigfile/<bigfileX>/(head|<rev>)/{data,at} - internally served by BigFile.
// /bigfile/<bigfileX>/(head|<rev>)/* - internally served by BigFile.
type BigFile struct {
// current read-only transaction under which we access ZODB data
txnCtx context.Context // XXX -> better directly store txn
......@@ -317,15 +315,14 @@ type BigFile struct {
// ZBigFile top-level object. Kept activated during lifetime of current transaction.
zbf *ZBigFile
// zbf.Size(). It is constant during liftime of a transaction
// (we do only read-only txn) XXX -> organization overview.
// zbf.Size(). It is constant during liftime of current transaction.
zbfSize int64
// TODO
// lastChange zodb.Tid // last change to whole bigfile as of .zconn.At view
}
// /bigfile/<bigfileX>/(head|<rev>)/data - represented by BigFileData.
// /bigfile/<bigfileX>/(head|<rev>)/data - served by BigFileData.
type BigFileData struct {
nodefs.Node
......@@ -333,6 +330,8 @@ type BigFileData struct {
// inflight loadings of ZBigFile from ZODB.
// successfull load results are kept here until blkdata is put into OS pagecache.
//
// XXX -> BigFile ?
loadMu sync.Mutex
loading map[int64]*blkLoadState // #blk -> {... blkdata}
}
......@@ -354,7 +353,7 @@ type blkLoadState struct {
// /bigfile -> Mkdir receives client request to create /bigfile/<bigfileX>.
//
// It creates <bigfileX>/head/data along the way.
// It creates <bigfileX>/head/* along the way.
func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (_ *nodefs.Inode, status fuse.Status) {
oid, err := zodb.ParseOid(name)
if err != nil {
......@@ -448,7 +447,7 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
zdb: zdb,
}
bfhead := &BigFileHead{
bfhead := &BigFileRev{
Node: nodefs.NewDefaultNode(),
}
......@@ -465,8 +464,6 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
loading: make(map[int64]*blkLoadState),
}
bfhead.data = bfdata
bfroot.tab[oid] = bfdir
bfroot.mu.Unlock()
......
......@@ -125,7 +125,7 @@ func (zd *zDataState) DropState() {
}
func (zd *zDataState) PySetState(pystate interface{}) error {
log.Printf("ZData.PySetState")
//log.Printf("ZData.PySetState")
data, ok := pystate.(string)
if !ok {
return fmt.Errorf("expect str; got %s", typeOf(pystate))
......
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