From 633caccace3760713631a6b0c5b549fefda640f2 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Fri, 18 Aug 2017 19:03:55 -0700 Subject: [PATCH] ensure doctests are not elided by linker opts.set_disable_data_sync was removed from RocksDB (commit eb912a9), but our doctest didn't fail because the function opts.set_disable_data_sync was called in, badly_tuned_for_somebody_elses_disk, was elided by the linker. Remove this function to ensure the doctest actually exercises the code path. --- src/lib.rs | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ba26334..fa8d8cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,29 +119,24 @@ pub struct BlockBasedOptions { /// use rocksdb::{Options, DB}; /// use rocksdb::DBCompactionStyle; /// -/// fn badly_tuned_for_somebody_elses_disk() -> DB { -/// let path = "path/for/rocksdb/storageX"; -/// let mut opts = Options::default(); -/// opts.create_if_missing(true); -/// opts.set_max_open_files(10000); -/// opts.set_use_fsync(false); -/// opts.set_bytes_per_sync(8388608); -/// opts.set_disable_data_sync(false); -/// opts.optimize_for_point_lookup(1024); -/// opts.set_table_cache_num_shard_bits(6); -/// opts.set_max_write_buffer_number(32); -/// opts.set_write_buffer_size(536870912); -/// opts.set_target_file_size_base(1073741824); -/// opts.set_min_write_buffer_number_to_merge(4); -/// opts.set_level_zero_stop_writes_trigger(2000); -/// opts.set_level_zero_slowdown_writes_trigger(0); -/// opts.set_compaction_style(DBCompactionStyle::Universal); -/// opts.set_max_background_compactions(4); -/// opts.set_max_background_flushes(4); -/// opts.set_disable_auto_compactions(true); -/// -/// DB::open(&opts, path).unwrap() -/// } +/// let mut opts = Options::default(); +/// opts.create_if_missing(true); +/// opts.set_max_open_files(10000); +/// opts.set_use_fsync(false); +/// opts.set_bytes_per_sync(8388608); +/// opts.set_disable_data_sync(false); +/// opts.optimize_for_point_lookup(1024); +/// opts.set_table_cache_num_shard_bits(6); +/// opts.set_max_write_buffer_number(32); +/// opts.set_write_buffer_size(536870912); +/// opts.set_target_file_size_base(1073741824); +/// opts.set_min_write_buffer_number_to_merge(4); +/// opts.set_level_zero_stop_writes_trigger(2000); +/// opts.set_level_zero_slowdown_writes_trigger(0); +/// opts.set_compaction_style(DBCompactionStyle::Universal); +/// opts.set_max_background_compactions(4); +/// opts.set_max_background_flushes(4); +/// opts.set_disable_auto_compactions(true); /// ``` pub struct Options { inner: *mut ffi::rocksdb_options_t,