C API: Allow setting compaction filter factory

This commit is contained in:
Evan Shaw 2014-07-04 16:04:55 +12:00
parent 91bede79cc
commit 3f7104d7c5
2 changed files with 8 additions and 0 deletions

View File

@ -956,6 +956,12 @@ void rocksdb_options_set_compaction_filter(
opt->rep.compaction_filter = 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<CompactionFilterFactory>(factory);
}
void rocksdb_options_set_comparator( void rocksdb_options_set_comparator(
rocksdb_options_t* opt, rocksdb_options_t* opt,
rocksdb_comparator_t* cmp) { rocksdb_comparator_t* cmp) {

View File

@ -347,6 +347,8 @@ extern void rocksdb_options_destroy(rocksdb_options_t*);
extern void rocksdb_options_set_compaction_filter( extern void rocksdb_options_set_compaction_filter(
rocksdb_options_t*, rocksdb_options_t*,
rocksdb_compactionfilter_t*); rocksdb_compactionfilter_t*);
extern void rocksdb_options_set_compaction_filter_factory(
rocksdb_options_t*, rocksdb_compactionfilterfactory_t*);
extern void rocksdb_options_set_comparator( extern void rocksdb_options_set_comparator(
rocksdb_options_t*, rocksdb_options_t*,
rocksdb_comparator_t*); rocksdb_comparator_t*);