From fc40d10b86520ea5365d5e67aca4db7c22f115d4 Mon Sep 17 00:00:00 2001 From: Diego Ongaro Date: Thu, 1 Feb 2018 18:17:42 -0800 Subject: [PATCH] Expose advise_random_on_open option --- src/db_options.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/db_options.rs b/src/db_options.rs index 8f3a1b2..3e5206b 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -930,6 +930,17 @@ impl Options { } } + /// When set to true, reading SST files will opt out of the filesystem's + /// readahead. Setting this to false may improve sequential iteration + /// performance. + /// + /// Default: `true` + pub fn set_advise_random_on_open(&mut self, advise: bool) { + unsafe { + ffi::rocksdb_options_set_advise_random_on_open(self.inner, advise as c_uchar) + } + } + /// Sets the number of levels for this database. pub fn set_num_levels(&mut self, n: c_int) { unsafe {