diff --git a/db/c.cc b/db/c.cc index dde8f69fb..2a3d7b3bc 100644 --- a/db/c.cc +++ b/db/c.cc @@ -3881,10 +3881,11 @@ void rocksdb_options_set_row_cache(rocksdb_options_t* opt, } void rocksdb_options_add_compact_on_deletion_collector_factory( - rocksdb_options_t* opt, size_t window_size, size_t num_dels_trigger) { + rocksdb_options_t* opt, size_t window_size, size_t num_dels_trigger, + double deletion_ratio) { std::shared_ptr - compact_on_del = - NewCompactOnDeletionCollectorFactory(window_size, num_dels_trigger); + compact_on_del = NewCompactOnDeletionCollectorFactory( + window_size, num_dels_trigger, deletion_ratio); opt->rep.table_properties_collector_factories.emplace_back(compact_on_del); } diff --git a/db/c_test.c b/db/c_test.c index 57877c06b..da3e1c66c 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -720,7 +720,7 @@ int main(int argc, char** argv) { rocksdb_compactoptions_set_exclusive_manual_compaction(coptions, 1); rocksdb_options_add_compact_on_deletion_collector_factory(options, 10000, - 10001); + 10001, 0.0); StartPhase("destroy"); rocksdb_destroy_db(options, dbname, &err); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 6e0ad08c8..159d58466 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1615,7 +1615,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_row_cache( extern ROCKSDB_LIBRARY_API void rocksdb_options_add_compact_on_deletion_collector_factory( - rocksdb_options_t*, size_t window_size, size_t num_dels_trigger); + rocksdb_options_t*, size_t window_size, size_t num_dels_trigger, + double deletion_ratio); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_manual_wal_flush( rocksdb_options_t* opt, unsigned char); extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_manual_wal_flush( diff --git a/unreleased_history/public_api_changes/add_new_compaction_parameter.md b/unreleased_history/public_api_changes/add_new_compaction_parameter.md new file mode 100644 index 000000000..4278ff4a6 --- /dev/null +++ b/unreleased_history/public_api_changes/add_new_compaction_parameter.md @@ -0,0 +1 @@ +Add parameter `deletion_ratio` to C API `rocksdb_options_add_compact_on_deletion_collector_factory`. \ No newline at end of file