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
7f4eb022
Commit
7f4eb022
authored
Oct 15, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
15123fbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
21 deletions
+18
-21
wcfs/wcfs.go
wcfs/wcfs.go
+17
-20
wcfs/zblk.go
wcfs/zblk.go
+1
-1
No files found.
wcfs/wcfs.go
View file @
7f4eb022
...
...
@@ -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 client
s
. 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/ -
represent
ed by BigFileRoot.
// /bigfile/ -
serv
ed by BigFileRoot.
type
BigFileRoot
struct
{
nodefs
.
Node
zstor
zodb
.
IStorage
...
...
@@ -283,29 +285,25 @@ type BigFileRoot struct {
tab
map
[
zodb
.
Oid
]
*
BigFileDir
}
// /bigfile/<bigfileX>/ -
represent
ed by BigFileDir.
// /bigfile/<bigfileX>/ -
serv
ed 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 -
represent
ed by BigFileData.
// /bigfile/<bigfileX>/(head|<rev>)/data -
serv
ed 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
:=
&
BigFile
Head
{
bfhead
:=
&
BigFile
Rev
{
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
()
...
...
wcfs/zblk.go
View file @
7f4eb022
...
...
@@ -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
))
...
...
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