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
04dbd323
Commit
04dbd323
authored
Feb 13, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
83ef7688
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
bigfile/_bigfile.c
bigfile/_bigfile.c
+2
-2
bigfile/_bigfile.h
bigfile/_bigfile.h
+19
-4
bigfile/file_zodb.cpp
bigfile/file_zodb.cpp
+1
-1
wcfs/client/client_test.py
wcfs/client/client_test.py
+2
-2
No files found.
bigfile/_bigfile.c
View file @
04dbd323
...
@@ -951,11 +951,11 @@ static const struct bigfile_ops pybigfile_ops = {
...
@@ -951,11 +951,11 @@ static const struct bigfile_ops pybigfile_ops = {
.
loadblk
=
pybigfile_loadblk
,
.
loadblk
=
pybigfile_loadblk
,
.
storeblk
=
pybigfile_storeblk
,
.
storeblk
=
pybigfile_storeblk
,
//.release =
.
mmap_setup_read
=
pybigfile_mmap_setup_read
,
.
mmap_setup_read
=
pybigfile_mmap_setup_read
,
.
remmap_blk_read
=
pybigfile_remmap_blk_read
,
.
remmap_blk_read
=
pybigfile_remmap_blk_read
,
.
munmap
=
pybigfile_munmap
,
.
munmap
=
pybigfile_munmap
,
//.release =
};
};
...
...
bigfile/_bigfile.h
View file @
04dbd323
...
@@ -25,12 +25,15 @@
...
@@ -25,12 +25,15 @@
/* Package _bigfile provides Python bindings to virtmem.
/* Package _bigfile provides Python bindings to virtmem.
*
*
* - `BigFile` is base class that allows implementing BigFile backends in Python.
* - `BigFile` is base class that allows implementing BigFile backends in Python.
* Users can inherit from BigFile, implement loadblk/storeblk
/blkmmapper and XXX review
* Users can inherit from BigFile, implement loadblk/storeblk
and this way
*
this way provide access to data managed from Python to virtmem subsystem
.
*
provide access to data managed from Python to virtmem subsystem(*)
.
* - `BigFileH` represents virtmem file handle for opened BigFile.
* - `BigFileH` represents virtmem file handle for opened BigFile.
* It can be mmap'ed and provides writeout control.
* It can be mmap'ed and provides writeout control.
* - `VMA` represents mmap'ed part of a BigFileH.
* - `VMA` represents mmap'ed part of a BigFileH.
* It provides buffer/memoryview interface for data access.
* It provides buffer/memoryview interface for data access.
*
* (*) A subclass may additionally provide functionality to map file data into
* memory. Please see BigFile documentation for details.
*/
*/
#include <Python.h>
#include <Python.h>
...
@@ -91,9 +94,11 @@ struct PyBigFileH {
...
@@ -91,9 +94,11 @@ struct PyBigFileH {
BigFileH
fileh
;
BigFileH
fileh
;
/* if subclass, in addition to .loadblk/.storeblk, defines .blkmmapper XXX ... */
#if 0
/* if BigFile subclass, in addition to .loadblk/.storeblk, defines .blkmmapper XXX ... */
PyObject *pymmapper; // python object returned by .blkmmapper() that is holding virtmem_mapper pycapsule
PyObject *pymmapper; // python object returned by .blkmmapper() that is holding virtmem_mapper pycapsule
//virt_mapper *virt_mmap_ops; // XXX ok?
//virt_mapper *virt_mmap_ops; // XXX ok?
#endif
};
};
typedef
struct
PyBigFileH
PyBigFileH
;
typedef
struct
PyBigFileH
PyBigFileH
;
...
@@ -101,8 +106,18 @@ typedef struct PyBigFileH PyBigFileH;
...
@@ -101,8 +106,18 @@ typedef struct PyBigFileH PyBigFileH;
/*
/*
* BigFile that can be implemented in python
* BigFile that can be implemented in python
*
*
* Allows subclasses to implement .loadblk()
(& friends) in python. XXX blkmmapper doc
* Allows subclasses to implement .loadblk()
and .storeblk() in python.
* For users .fileh_open() is exposed to get to file handles.
* For users .fileh_open() is exposed to get to file handles.
*
* A subclass may additionally provide functionality to map file data into
* memory: if subclass provides .blkmmapper attribute, it is treated as
* pycapsule with type "wendelin.bigfile.IBlkMMapper" and C-level bigfile_ops
* struct that provides .mmap_setup_read and other operations related to
* mmapping data. To avoid deadlocks all mmap-related functionality must be
* nogil and so cannot be implemented in Python.
*
* One example user of .blkmmapper functionality is _ZBigFile which uses WCFS
* and mmaps files from it to provide memory mappings for ZBigFile data.
*/
*/
struct
PyBigFile
{
struct
PyBigFile
{
PyObject
pyobj
;
PyObject
pyobj
;
...
...
bigfile/file_zodb.cpp
View file @
04dbd323
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
// See https://www.nexedi.com/licensing for rationale and options.
// See https://www.nexedi.com/licensing for rationale and options.
// File file_zodb.cpp provides blkmmapper functions for _ZBigFile.
// File file_zodb.cpp provides blkmmapper functions for _ZBigFile.
// MMapping is implemented via
WCFS
.
// MMapping is implemented via
wcfs client
.
#include "wcfs/client/wcfs.h"
#include "wcfs/client/wcfs.h"
#include "wendelin/bigfile/file.h"
#include "wendelin/bigfile/file.h"
...
...
wcfs/client/client_test.py
View file @
04dbd323
...
@@ -28,8 +28,8 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode.
...
@@ -28,8 +28,8 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode.
from
__future__
import
print_function
,
absolute_import
from
__future__
import
print_function
,
absolute_import
from
golang
import
func
,
defer
from
golang
import
func
,
defer
from
wendelin.wcfs.wcfs_test
import
tDB
,
tAt
from
..wcfs_test
import
tDB
,
tAt
# XXX -> absolute
from
wendelin.wcfs
import
wcfs_test
from
..
import
wcfs_test
# XXX -> absolute
# XXX so that e.g. testdb is set up + ...
# XXX so that e.g. testdb is set up + ...
def
setup_module
():
wcfs_test
.
setup_module
()
def
setup_module
():
wcfs_test
.
setup_module
()
...
...
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