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