def __init__(self,
                 dbDir,
                 dbName,
                 isLineNoKey: bool=False,
                 storeContentHash: bool=True,
                 chunkSize: int=1000,
                 ensureDurability: bool=True,
                 chunk_creator=None,
                 open=True):
        """

        :param chunkSize: number of items in one chunk. Cannot be lower then number of items in defaultFile
        :param chunkStoreConstructor: constructor of store for single chunk
        """

        super().__init__(dbDir,
                         dbName,
                         isLineNoKey,
                         storeContentHash,
                         ensureDurability,
                         open=False)

        self.chunkSize = chunkSize
        self.itemNum = 1  # chunk size counter
        self.dataDir = os.path.join(dbDir, dbName)  # chunk files destination
        self.currentChunk = None  # type: KeyValueStorageFile
        self.currentChunkIndex = None  # type: int

        # TODO: fix chunk_creator support
        def default_chunk_creator(name):
            return TextFileStore(self.dataDir,
                                 name,
                                 isLineNoKey,
                                 storeContentHash,
                                 ensureDurability)

        self._chunkCreator = chunk_creator or default_chunk_creator
        if open:
            self.open()
def __init__ ( self , dbDir , dbName , isLineNoKey : bool = False , storeContentHash : bool = True , chunkSize : int = 1000 , ensureDurability : bool = True , chunk_creator = None , open = True ) : super ( ) . __init__ ( dbDir , dbName , isLineNoKey , storeContentHash , ensureDurability , open = False ) self . chunkSize = chunkSize self . itemNum = 1 self . dataDir = os . path . join ( dbDir , dbName ) self . currentChunk = None self . currentChunkIndex = None def default_chunk_creator ( name ) : return TextFileStore ( self . dataDir , name , isLineNoKey , storeContentHash , ensureDurability ) self . _chunkCreator = chunk_creator or default_chunk_creator if open : self . open ( )
:param chunkSize: number of items in one chunk. Cannot be lower then number of items in defaultFile
        :param chunkStoreConstructor: constructor of store for single chunk