Commit 21793570 authored by ngaut's avatar ngaut

address comments

parent 150bf4f5
......@@ -442,7 +442,7 @@ impl DB {
pub fn write_withou_wal(&self, batch: WriteBatch) -> Result<(), String> {
let mut wo = WriteOptions::new();
wo.disable_wal();
wo.disable_wal(true);
self.write_opt(batch, &wo)
}
......
......@@ -384,9 +384,13 @@ impl WriteOptions {
}
}
pub fn disable_wal(&mut self) {
pub fn disable_wal(&mut self, disable: bool) {
unsafe {
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 1);
if disable {
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 1);
} else {
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 0);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment