diff --git a/rocksdb/_rocksdb.pyx b/rocksdb/_rocksdb.pyx index da216d3a017b92e86964b3a5944736981e514f4f..bfedde26c72c8c99880f5a5139da5f374634281f 100644 --- a/rocksdb/_rocksdb.pyx +++ b/rocksdb/_rocksdb.pyx @@ -1094,6 +1094,18 @@ cdef class Options(object): # def __set__(self, value): # self.opts.allow_os_buffer = value + property enable_write_thread_adaptive_yield: + def __get__(self): + return self.opts.enable_write_thread_adaptive_yield + def __set__(self, value): + self.opts.enable_write_thread_adaptive_yield = value + + property allow_concurrent_memtable_write: + def __get__(self): + return self.opts.allow_concurrent_memtable_write + def __set__(self, value): + self.opts.allow_concurrent_memtable_write = value + property allow_mmap_reads: def __get__(self): return self.opts.allow_mmap_reads diff --git a/rocksdb/options.pxd b/rocksdb/options.pxd index e54bf698561f945d5b94f0d7966c37d9596c08bf..373c66a4f88e4b28b4391cee581b47125e620a27 100644 --- a/rocksdb/options.pxd +++ b/rocksdb/options.pxd @@ -130,6 +130,8 @@ cdef extern from "rocksdb/options.h" namespace "rocksdb": # TODO: remove options source_compaction_factor, max_grandparent_overlap_bytes and expanded_compaction_factor from document uint64_t max_compaction_bytes CompressionOptions compression_opts + cpp_bool allow_concurrent_memtable_write + cpp_bool enable_write_thread_adaptive_yield cdef cppclass WriteOptions: cpp_bool sync diff --git a/rocksdb/tests/test_options.py b/rocksdb/tests/test_options.py index c585190fabf3b5a5733a9e63d108b634d8ecc887..571986d414f17731c95d869bab62a944e7ce3562 100644 --- a/rocksdb/tests/test_options.py +++ b/rocksdb/tests/test_options.py @@ -46,6 +46,18 @@ class TestOptions(unittest.TestCase): opts.compaction_pri = rocksdb.CompactionPri.min_overlapping_ratio self.assertEqual(opts.compaction_pri, rocksdb.CompactionPri.min_overlapping_ratio) + def test_enable_write_thread_adaptive_yield(self): + opts = rocksdb.Options() + self.assertEqual(opts.enable_write_thread_adaptive_yield, True) + opts.enable_write_thread_adaptive_yield = False + self.assertEqual(opts.enable_write_thread_adaptive_yield, False) + + def test_allow_concurrent_memtable_write(self): + opts = rocksdb.Options() + self.assertEqual(opts.allow_concurrent_memtable_write, True) + opts.allow_concurrent_memtable_write = False + self.assertEqual(opts.allow_concurrent_memtable_write, False) + def test_compression_opts(self): opts = rocksdb.Options() compression_opts = opts.compression_opts