diff --git a/db/c.cc b/db/c.cc index e66cd9e44..f65285f2c 100644 --- a/db/c.cc +++ b/db/c.cc @@ -956,6 +956,12 @@ void rocksdb_options_set_compaction_filter( opt->rep.compaction_filter = filter; } +void rocksdb_options_set_compaction_filter_factory( + rocksdb_options_t* opt, rocksdb_compactionfilterfactory_t* factory) { + opt->rep.compaction_filter_factory = + std::shared_ptr(factory); +} + void rocksdb_options_set_comparator( rocksdb_options_t* opt, rocksdb_comparator_t* cmp) { diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 8ad8520a6..65992e967 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -347,6 +347,8 @@ extern void rocksdb_options_destroy(rocksdb_options_t*); extern void rocksdb_options_set_compaction_filter( rocksdb_options_t*, rocksdb_compactionfilter_t*); +extern void rocksdb_options_set_compaction_filter_factory( + rocksdb_options_t*, rocksdb_compactionfilterfactory_t*); extern void rocksdb_options_set_comparator( rocksdb_options_t*, rocksdb_comparator_t*);