Commit 6a717cb2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 277f9e4d
/_file_zodb.cpp
# -*- coding: utf-8 -*-
# Wendelin.bigfile | BigFile ZODB backend
# Copyright (C) 2014-2019 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
"""XXX"""
from wendelin.bigfile import BigFile
# helper for ZBigFile - just redirect loadblk/storeblk back
# (because it is not possible to inherit from both Persistent and BigFile at
# the same time - see below)
class _ZBigFile(BigFile):
# .zself - reference to ZBigFile
def __new__(cls, zself, blksize):
obj = BigFile.__new__(cls, blksize)
obj.zself = zself
return obj
# redirect load/store/mapper to main class
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
def storeblk(self, blk, buf): return self.zself.storeblk(blk, buf)
#def blkmmapper(self): return self.zself.blkmmapper()
...@@ -175,7 +175,8 @@ will be our future approach after we teach NEO about object deduplication. ...@@ -175,7 +175,8 @@ will be our future approach after we teach NEO about object deduplication.
# natural to also use "2" here. # natural to also use "2" here.
from wendelin.bigfile import BigFile, WRITEOUT_STORE, WRITEOUT_MARKSTORED from wendelin.bigfile import WRITEOUT_STORE, WRITEOUT_MARKSTORED
from wendelin.bigfile._file_zodb import _ZBigFile
from wendelin import wcfs from wendelin import wcfs
from wendelin.lib.mem import bzero, memcpy from wendelin.lib.mem import bzero, memcpy
from wendelin.lib.zodb import LivePersistent, deactivate_btree, zconn_at from wendelin.lib.zodb import LivePersistent, deactivate_btree, zconn_at
...@@ -510,24 +511,6 @@ if ZBlk_fmt_write not in ZBlk_fmt_registry: ...@@ -510,24 +511,6 @@ if ZBlk_fmt_write not in ZBlk_fmt_registry:
# ---------------------------------------- # ----------------------------------------
# helper for ZBigFile - just redirect loadblk/storeblk back
# (because it is not possible to inherit from both Persistent and BigFile at
# the same time - see below)
class _ZBigFile(BigFile):
# .zself - reference to ZBigFile
def __new__(cls, zself, blksize):
obj = BigFile.__new__(cls, blksize)
obj.zself = zself
return obj
# redirect load/store/mapper to main class
def loadblk(self, blk, buf): return self.zself.loadblk(blk, buf)
def storeblk(self, blk, buf): return self.zself.storeblk(blk, buf)
#def blkmmapper(self): return self.zself.blkmmapper()
# ZBigFile implements BigFile backend with data stored in ZODB. # ZBigFile implements BigFile backend with data stored in ZODB.
# #
# NOTE Can't inherit from Persistent and BigFile at the same time - both are C # NOTE Can't inherit from Persistent and BigFile at the same time - both are C
......
...@@ -256,6 +256,9 @@ setup( ...@@ -256,6 +256,9 @@ setup(
ext_modules = [ ext_modules = [
_bigfile, _bigfile,
PyGoExt('wendelin.bigfile._file_zodb',
['bigfile/_file_zodb.pyx']),
PyGoExt('wendelin.wcfs.internal._wcfs', PyGoExt('wendelin.wcfs.internal._wcfs',
['wcfs/internal/_wcfs.pyx', ['wcfs/internal/_wcfs.pyx',
'wcfs/internal/wcfs_virtmem.cpp', 'wcfs/internal/wcfs_virtmem.cpp',
......
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