Commit c6c69c5a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a6c29fd2
...@@ -54,15 +54,14 @@ from wendelin.lib.zodb import zconn_at ...@@ -54,15 +54,14 @@ from wendelin.lib.zodb import zconn_at
# - provides blkmmapper with WCFS integration. # - provides blkmmapper with WCFS integration.
cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]: cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
cdef object zself # reference to ZBigFile cdef object zself # reference to ZBigFile
# cdef wcfs.Oid foid # = .zself._p_oid
cdef wcfs.FileH wfileh # WCFS file handle. Initially nil, opened by blkmmapper cdef wcfs.FileH wfileh # WCFS file handle. Initially nil, opened by blkmmapper
# _new creates new _ZBigFile associated with ZBigFile zself.
# XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__ # XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
@staticmethod @staticmethod
def _new(zself, blksize): def _new(zself, blksize):
cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize) cdef _ZBigFile obj = _ZBigFile.__new__(_ZBigFile, blksize)
obj.zself = zself obj.zself = zself
# obj.foid = -1 # Note: zself._p_oid could be yet None for newly created ZBigFile
obj.wfileh = nil obj.wfileh = nil
return obj return obj
...@@ -70,12 +69,13 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]: ...@@ -70,12 +69,13 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
zf.wfileh = nil zf.wfileh = nil
# redirect load/store/mapper to main class # redirect load/store to main class
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf) def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
def storeblk(self, blk, buf): return self.zself.storeblk(blk, buf) def storeblk(self, blk, buf): return self.zself.storeblk(blk, buf)
#def blkmmapper(self): return self.zself.blkmmapper()
# blkmmapper serves PyBigFile and gives it XXX ... # blkmmapper returns pycapsule with virtmem mmapper for the file.
#
# XXX
# #
# it is called from PyBigFile.fileh_open(mmap_overlay=True) and .zfile # it is called from PyBigFile.fileh_open(mmap_overlay=True) and .zfile
# should be already associated with jar and have oid. # should be already associated with jar and have oid.
...@@ -85,7 +85,6 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]: ...@@ -85,7 +85,6 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
zconn = zf.zself._p_jar zconn = zf.zself._p_jar
assert zconn is not None assert zconn is not None
# XXX locking? or rely on that ZODB objects for must be used from under 1 thread only? # XXX locking? or rely on that ZODB objects for must be used from under 1 thread only?
# zf.foid = u64(zf.zself._p_oid)
# join zconn to wconn; link to wconn from _ZBigFile # join zconn to wconn; link to wconn from _ZBigFile
pywconn = pywconnOf(zconn) pywconn = pywconnOf(zconn)
......
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