def _growMapSize(self, size=None): mapsize = self.mapsize if size is not None: mapsize += size elif self.growsize is not None: mapsize += self.growsize else: mapsize = _mapsizeround(mapsize + 1) if self.maxsize is not None: mapsize = min(mapsize, self.maxsize) if mapsize == self.mapsize: raise s_exc.DbOutOfSpace( mesg= f'DB at {self.path} is at specified max capacity of {self.maxsize} and is out of space' ) logger.warning('lmdbslab %s growing map size to: %d MiB', self.path, mapsize // s_const.mebibyte) self.lenv.set_mapsize(mapsize) self.mapsize = mapsize self.resizeevent.set() return self.mapsize
def _growMapSize(self, size=None): mapsize = self.mapsize if size is not None: mapsize += size elif self.growsize is not None: mapsize += self.growsize else: mapsize *= 2 if self.maxsize is not None: mapsize = min(mapsize, self.maxsize) if mapsize == self.mapsize: raise s_exc.DbOutOfSpace( mesg=f'DB at {self.path} is at specified max capacity of {self.maxsize} and is out of space') logger.warning('growing map size to: %d' % (mapsize,)) self.lenv.set_mapsize(mapsize) self.mapsize = mapsize self._saveOptsFile() return self.mapsize
def baddrop(self, name): raise s_exc.DbOutOfSpace()