diff --git a/db/c.cc b/db/c.cc index 8610871ab..e135c5bf8 100644 --- a/db/c.cc +++ b/db/c.cc @@ -1183,6 +1183,14 @@ void rocksdb_flush( SaveError(errptr, db->rep->Flush(options->rep)); } +void rocksdb_flush_cf( + rocksdb_t* db, + const rocksdb_flushoptions_t* options, + rocksdb_column_family_handle_t* column_family, + char** errptr) { + SaveError(errptr, db->rep->Flush(options->rep, column_family->rep)); +} + void rocksdb_disable_file_deletions( rocksdb_t* db, char** errptr) { diff --git a/db/c_test.c b/db/c_test.c index e403ce572..64241df28 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -1188,6 +1188,12 @@ int main(int argc, char** argv) { rocksdb_put_cf(db, woptions, handles[1], "foo", 3, "hello", 5, &err); CheckNoError(err); + rocksdb_flushoptions_t *flush_options = rocksdb_flushoptions_create(); + rocksdb_flushoptions_set_wait(flush_options, 1); + rocksdb_flush_cf(db, flush_options, handles[1], &err); + CheckNoError(err) + rocksdb_flushoptions_destroy(flush_options); + CheckGetCF(db, roptions, handles[1], "foo", "hello"); CheckPinGetCF(db, roptions, handles[1], "foo", "hello"); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 05699492c..0e335c8d1 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -380,6 +380,10 @@ extern ROCKSDB_LIBRARY_API const rocksdb_livefiles_t* rocksdb_livefiles( extern ROCKSDB_LIBRARY_API void rocksdb_flush( rocksdb_t* db, const rocksdb_flushoptions_t* options, char** errptr); +extern ROCKSDB_LIBRARY_API void rocksdb_flush_cf( + rocksdb_t* db, const rocksdb_flushoptions_t* options, + rocksdb_column_family_handle_t* column_family, char** errptr); + extern ROCKSDB_LIBRARY_API void rocksdb_disable_file_deletions(rocksdb_t* db, char** errptr);