Atomic flush option (#380)

master
Matt Bell 4 years ago committed by GitHub
parent c5b5981578
commit 2ba70d304d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      src/db_options.rs

@ -1491,6 +1491,29 @@ impl Options {
}
}
/// Guarantee that all column families are flushed together atomically.
/// This option applies to both manual flushes (`db.flush()`) and automatic
/// background flushes caused when memtables are filled.
///
/// Note that this is only useful when the WAL is disabled. When using the
/// WAL, writes are always consistent across column families.
///
/// Default: false
///
/// # Example
///
/// ```
/// use rocksdb::Options;
///
/// let mut options = Options::default();
/// options.set_atomic_flush(true);
/// ```
pub fn set_atomic_flush(&mut self, atomic_flush: bool) {
unsafe {
ffi::rocksdb_options_set_atomic_flush(self.inner, atomic_flush as c_uchar);
}
}
/// Use to control write rate of flush and compaction. Flush has higher
/// priority than compaction.
/// If rate limiter is enabled, bytes_per_sync is set to 1MB by default.

Loading…
Cancel
Save