From f166a5dca3ce1b01f5868ce577e5527d414284ad Mon Sep 17 00:00:00 2001 From: iFA Date: Wed, 14 Apr 2021 09:09:06 +0200 Subject: [PATCH 1/2] Add files via upload --- rocksdb/_rocksdb.pyx | 26 +++++++++++++------------- rocksdb/options.pxd | 3 ++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/rocksdb/_rocksdb.pyx b/rocksdb/_rocksdb.pyx index df365f7..4c8b354 100644 --- a/rocksdb/_rocksdb.pyx +++ b/rocksdb/_rocksdb.pyx @@ -159,8 +159,7 @@ cdef class PyGenericComparator(PyComparator): def __dealloc__(self): if not self.comparator_ptr == NULL: - with nogil: - del self.comparator_ptr + del self.comparator_ptr cdef object get_ob(self): return self.ob @@ -772,8 +771,7 @@ cdef class _ColumnFamilyHandle: def __dealloc__(self): if not self.handle == NULL: - with nogil: - del self.handle + del self.handle @staticmethod cdef from_handle_ptr(db.ColumnFamilyHandle* handle): @@ -881,8 +879,7 @@ cdef class ColumnFamilyOptions(object): def __dealloc__(self): if not self.copts == NULL: - with nogil: - del self.copts + del self.copts def __init__(self, **kwargs): self.py_comparator = BytewiseComparator() @@ -1293,9 +1290,8 @@ cdef class Options(ColumnFamilyOptions): def __dealloc__(self): if not self.opts == NULL: - with nogil: - del self.copts - del self.opts + self.copts = NULL + del self.opts def __init__(self, **kwargs): ColumnFamilyOptions.__init__(self) @@ -1439,6 +1435,12 @@ cdef class Options(ColumnFamilyOptions): def __set__(self, value): self.opts.WAL_size_limit_MB = value + property max_total_wal_size: + def __get__(self): + return self.opts.max_total_wal_size + def __set__(self, value): + self.opts.max_total_wal_size = value + property manifest_preallocation_size: def __get__(self): return self.opts.manifest_preallocation_size @@ -1549,8 +1551,7 @@ cdef class WriteBatch(object): def __dealloc__(self): if not self.batch == NULL: - with nogil: - del self.batch + del self.batch def put(self, key, value): cdef db.ColumnFamilyHandle* cf_handle = NULL @@ -2304,8 +2305,7 @@ cdef class BaseIterator(object): def __dealloc__(self): if not self.ptr == NULL: - with nogil: - del self.ptr + del self.ptr def __iter__(self): return self diff --git a/rocksdb/options.pxd b/rocksdb/options.pxd index 0eeb21a..c1e7825 100644 --- a/rocksdb/options.pxd +++ b/rocksdb/options.pxd @@ -87,7 +87,8 @@ cdef extern from "rocksdb/options.h" namespace "rocksdb": int table_cache_numshardbits uint64_t WAL_ttl_seconds uint64_t ttl - uint64_t WAL_size_limit_MB + uint64_t WAL_size_limit_MB # Not supported + uint64_t max_total_wal_size size_t manifest_preallocation_size cpp_bool allow_mmap_reads cpp_bool allow_mmap_writes From 2d5bb4faf15ed8e93dc3edc936cf287196928d24 Mon Sep 17 00:00:00 2001 From: iFA Date: Wed, 14 Apr 2021 09:17:45 +0200 Subject: [PATCH 2/2] Add files via upload --- rocksdb/_rocksdb.pyx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/rocksdb/_rocksdb.pyx b/rocksdb/_rocksdb.pyx index 4c8b354..08201ba 100644 --- a/rocksdb/_rocksdb.pyx +++ b/rocksdb/_rocksdb.pyx @@ -159,7 +159,8 @@ cdef class PyGenericComparator(PyComparator): def __dealloc__(self): if not self.comparator_ptr == NULL: - del self.comparator_ptr + with nogil: + del self.comparator_ptr cdef object get_ob(self): return self.ob @@ -771,7 +772,8 @@ cdef class _ColumnFamilyHandle: def __dealloc__(self): if not self.handle == NULL: - del self.handle + with nogil: + del self.handle @staticmethod cdef from_handle_ptr(db.ColumnFamilyHandle* handle): @@ -879,7 +881,8 @@ cdef class ColumnFamilyOptions(object): def __dealloc__(self): if not self.copts == NULL: - del self.copts + with nogil: + del self.copts def __init__(self, **kwargs): self.py_comparator = BytewiseComparator() @@ -1290,8 +1293,9 @@ cdef class Options(ColumnFamilyOptions): def __dealloc__(self): if not self.opts == NULL: - self.copts = NULL - del self.opts + with nogil: + del self.copts + del self.opts def __init__(self, **kwargs): ColumnFamilyOptions.__init__(self) @@ -1551,7 +1555,8 @@ cdef class WriteBatch(object): def __dealloc__(self): if not self.batch == NULL: - del self.batch + with nogil: + del self.batch def put(self, key, value): cdef db.ColumnFamilyHandle* cf_handle = NULL @@ -2305,7 +2310,8 @@ cdef class BaseIterator(object): def __dealloc__(self): if not self.ptr == NULL: - del self.ptr + with nogil: + del self.ptr def __iter__(self): return self