From 7e5b04d04fdabe7edf46de75e17e23cd8ad8b346 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 17 Jan 2020 12:56:19 -0800 Subject: [PATCH] Expose atomic flush option in C API (#6307) Summary: This PR adds a `rocksdb_options_set_atomic_flush` function to the C API. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6307 Differential Revision: D19451313 Pulled By: ltamasi fbshipit-source-id: 750495642ef55b1ea7e13477f85c38cd6574849c --- db/c.cc | 6 ++++++ include/rocksdb/c.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/db/c.cc b/db/c.cc index 0cee46b410..a04d0832ac 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2736,6 +2736,12 @@ void rocksdb_options_set_ratelimiter(rocksdb_options_t *opt, rocksdb_ratelimiter } } +void rocksdb_options_set_atomic_flush( + rocksdb_options_t *opt, + unsigned char atomic_flush) { + opt->rep.atomic_flush = atomic_flush; +} + rocksdb_ratelimiter_t* rocksdb_ratelimiter_create( int64_t rate_bytes_per_sec, int64_t refill_period_us, diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index c86e08d002..97e881b67e 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1037,6 +1037,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_fifo_compaction_options( rocksdb_options_t* opt, rocksdb_fifo_compaction_options_t* fifo); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_ratelimiter( rocksdb_options_t* opt, rocksdb_ratelimiter_t* limiter); +extern ROCKSDB_LIBRARY_API void rocksdb_options_set_atomic_flush( + rocksdb_options_t* opt, unsigned char); /* RateLimiter */ extern ROCKSDB_LIBRARY_API rocksdb_ratelimiter_t* rocksdb_ratelimiter_create(