diff --git a/db/c.cc b/db/c.cc index 45e8aefe5d..3a7ffd82bb 100644 --- a/db/c.cc +++ b/db/c.cc @@ -1740,6 +1740,11 @@ void rocksdb_options_set_max_background_compactions(rocksdb_options_t* opt, int opt->rep.max_background_compactions = n; } +void rocksdb_options_set_base_background_compactions(rocksdb_options_t* opt, + int n) { + opt->rep.base_background_compactions = n; +} + void rocksdb_options_set_max_background_flushes(rocksdb_options_t* opt, int n) { opt->rep.max_background_flushes = n; } diff --git a/db/c_test.c b/db/c_test.c index 6b52f0aee2..0260ec3fa5 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -323,6 +323,7 @@ int main(int argc, char** argv) { rocksdb_options_set_write_buffer_size(options, 100000); rocksdb_options_set_paranoid_checks(options, 1); rocksdb_options_set_max_open_files(options, 10); + rocksdb_options_set_base_background_compactions(options, 1); table_options = rocksdb_block_based_options_create(); rocksdb_block_based_options_set_block_cache(table_options, cache); rocksdb_options_set_block_based_table_factory(options, table_options); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 3f0aca7983..375b91e59b 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -585,6 +585,8 @@ rocksdb_options_set_max_write_buffer_number_to_maintain(rocksdb_options_t*, int); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_compactions( rocksdb_options_t*, int); +extern ROCKSDB_LIBRARY_API void rocksdb_options_set_base_background_compactions( + rocksdb_options_t*, int); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_flushes( rocksdb_options_t*, int); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_log_file_size(