From ac098a4626a386ca0ab3662e907b23f9037ba9f9 Mon Sep 17 00:00:00 2001 From: Kent767 Date: Fri, 11 Aug 2017 12:13:46 -0700 Subject: [PATCH] expose set_skip_stats_update_on_db_open to C bindings Summary: It would be super helpful to not have to recompile rocksdb to get this performance tweak for mechanical disks. I have signed the CLA. Closes https://github.com/facebook/rocksdb/pull/2718 Differential Revision: D5606994 Pulled By: yiwu-arbug fbshipit-source-id: c05e92bad0d03bd38211af1e1ced0d0d1e02f634 --- db/c.cc | 4 ++++ include/rocksdb/c.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/db/c.cc b/db/c.cc index 6952660a1..788eab68a 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2102,6 +2102,10 @@ void rocksdb_options_enable_statistics(rocksdb_options_t* opt) { opt->rep.statistics = rocksdb::CreateDBStatistics(); } +void rocksdb_options_set_skip_stats_update_on_db_open(rocksdb_options_t* opt, unsigned char val) { + opt->rep.skip_stats_update_on_db_open = val; +} + void rocksdb_options_set_num_levels(rocksdb_options_t* opt, int n) { opt->rep.num_levels = n; } diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 077030775..838d7b0c9 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -763,6 +763,8 @@ rocksdb_options_set_max_bytes_for_level_multiplier_additional( rocksdb_options_t*, int* level_values, size_t num_levels); extern ROCKSDB_LIBRARY_API void rocksdb_options_enable_statistics( rocksdb_options_t*); +extern ROCKSDB_LIBRARY_API void rocksdb_options_set_skip_stats_update_on_db_open( + rocksdb_options_t* opt, unsigned char val); /* returns a pointer to a malloc()-ed, null terminated string */ extern ROCKSDB_LIBRARY_API char* rocksdb_options_statistics_get_string(