Commit 21793570 authored by ngaut's avatar ngaut

address comments

parent 150bf4f5
...@@ -442,7 +442,7 @@ impl DB { ...@@ -442,7 +442,7 @@ impl DB {
pub fn write_withou_wal(&self, batch: WriteBatch) -> Result<(), String> { pub fn write_withou_wal(&self, batch: WriteBatch) -> Result<(), String> {
let mut wo = WriteOptions::new(); let mut wo = WriteOptions::new();
wo.disable_wal(); wo.disable_wal(true);
self.write_opt(batch, &wo) self.write_opt(batch, &wo)
} }
......
...@@ -384,9 +384,13 @@ impl WriteOptions { ...@@ -384,9 +384,13 @@ impl WriteOptions {
} }
} }
pub fn disable_wal(&mut self) { pub fn disable_wal(&mut self, disable: bool) {
unsafe { unsafe {
if disable {
rocksdb_ffi::rocksdb_writeoptions_disable_WAL(self.inner, 1); 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