From d72313a7fa204c2803fa80ae44af65e7ba392363 Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Wed, 18 Jun 2014 14:28:11 +1200 Subject: [PATCH] Add a way to set compaction filter in the C API --- db/c.cc | 6 ++++++ include/rocksdb/c.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/db/c.cc b/db/c.cc index ec47888449..219f650940 100644 --- a/db/c.cc +++ b/db/c.cc @@ -676,6 +676,12 @@ void rocksdb_options_destroy(rocksdb_options_t* options) { delete options; } +void rocksdb_options_set_compaction_filter( + rocksdb_options_t* opt, + rocksdb_compactionfilter_t* filter) { + opt->rep.compaction_filter = filter; +} + 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 3a96bfbd17..c7d9f7782b 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -230,6 +230,9 @@ extern const char* rocksdb_writebatch_data(rocksdb_writebatch_t*, size_t *size); extern rocksdb_options_t* rocksdb_options_create(); 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_comparator( rocksdb_options_t*, rocksdb_comparator_t*);