Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setup(
name="aimrocks",
version='0.0.10',
version='0.0.11',
description='RocksDB wrapper implemented in Cython.',
setup_requires=['setuptools>=25', 'Cython==3.0.0a9'],
packages=find_packages('./src'),
Expand Down
14 changes: 10 additions & 4 deletions src/aimrocks/_rocksdb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1801,13 +1801,19 @@ cdef class DB(object):
st = self.db.DeleteRange(opts, cf_handle, c_begin_key, c_end_key)
check_status(st)

def flush(self):
def flush(self, ColumnFamilyHandle column_family=None, **py_options):
cdef Status st
cdef FlushOptions options
cdef db.ColumnFamilyHandle* cf_handle = self.db.DefaultColumnFamily()

cdef FlushOptions c_options
c_options.wait = py_options.get('wait', True)
c_options.allow_write_stall = py_options.get('allow_write_stall', False)

cdef db.ColumnFamilyHandle * cf_handle = self.db.DefaultColumnFamily()
if column_family:
cf_handle = (<ColumnFamilyHandle?> column_family).get_handle()

with nogil:
st = self.db.Flush(options, cf_handle)
st = self.db.Flush(c_options, cf_handle)
check_status(st)

def flush_wal(self, sync=False):
Expand Down
1 change: 1 addition & 0 deletions src/aimrocks/options.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ cdef extern from "rocksdb/options.h" namespace "rocksdb":

cdef cppclass FlushOptions:
cpp_bool wait
cpp_bool allow_write_stall

ctypedef enum BottommostLevelCompaction:
blc_skip "rocksdb::BottommostLevelCompaction::kSkip"
Expand Down