diff --git a/HISTORY.md b/HISTORY.md index 91f28f3e2..f4dce5cd8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -14,7 +14,7 @@ * Add `WriteBatch::Release()` that releases the batch's serialized data to the caller. ### Public API Changes -* Add parameter `deletion_ratio` to C API `rocksdb_options_add_compact_on_deletion_collector_factory`. +* Add C API `rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio`. * change the FileSystem::use_async_io() API to SupportedOps API in order to extend it to various operations supported by underlying FileSystem. Right now it contains FSSupportedOps::kAsyncIO and FSSupportedOps::kFSBuffer. More details about FSSupportedOps in filesystem.h * Add new tickers: `rocksdb.error.handler.bg.error.count`, `rocksdb.error.handler.bg.io.error.count`, `rocksdb.error.handler.bg.retryable.io.error.count` to replace the misspelled ones: `rocksdb.error.handler.bg.errro.count`, `rocksdb.error.handler.bg.io.errro.count`, `rocksdb.error.handler.bg.retryable.io.errro.count` ('error' instead of 'errro'). Users should switch to use the new tickers before 9.0 release as the misspelled old tickers will be completely removed then. * Overload the API CreateColumnFamilyWithImport() to support creating ColumnFamily by importing multiple ColumnFamilies It requires that CFs should not overlap in user key range. diff --git a/db/c.cc b/db/c.cc index 88527f99c..6da280b46 100644 --- a/db/c.cc +++ b/db/c.cc @@ -3916,6 +3916,14 @@ 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) { + std::shared_ptr + compact_on_del = + NewCompactOnDeletionCollectorFactory(window_size, num_dels_trigger); + opt->rep.table_properties_collector_factories.emplace_back(compact_on_del); +} + +void rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio( rocksdb_options_t* opt, size_t window_size, size_t num_dels_trigger, double deletion_ratio) { std::shared_ptr diff --git a/db/c_test.c b/db/c_test.c index 454aa1622..a694643bc 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -720,7 +720,9 @@ 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, 0.0); + 10001); + rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio( + options, 10000, 10001, 0.0); StartPhase("destroy"); rocksdb_destroy_db(options, dbname, &err); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 808617db6..81d05f778 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1626,6 +1626,9 @@ 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); +extern ROCKSDB_LIBRARY_API void +rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio( 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(