Merge pull request #263 from iSynaptic/gh-203

Adding set_readahead_size setter to ReadOptions...
master
Jordan Terrell 6 years ago committed by GitHub
commit a489cafe96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/db.rs

@ -1721,6 +1721,23 @@ impl ReadOptions {
pub fn set_total_order_seek(&mut self, v: bool) {
unsafe { ffi::rocksdb_readoptions_set_total_order_seek(self.inner, v as c_uchar) }
}
/// If non-zero, an iterator will create a new table reader which
/// performs reads of the given size. Using a large size (> 2MB) can
/// improve the performance of forward iteration on spinning disks.
/// Default: 0
///
/// ```
/// use rocksdb::{ReadOptions};
///
/// let mut opts = ReadOptions::default();
/// opts.set_readahead_size(4_194_304); // 4mb
/// ```
pub fn set_readahead_size(&mut self, v: usize) {
unsafe {
ffi::rocksdb_readoptions_set_readahead_size(self.inner, v as size_t);
}
}
}
impl Default for ReadOptions {

Loading…
Cancel
Save