Write all outstanding transaction records to disk. Note that this does **not** force the OS to sync the data to disk. Use [`Self::flush_and_sync`] or call [`Self::sync`] after this method to ensure all data is on disk. Returns the maximum transaction offset written to disk. The offset is `None` if the log is empty and no data was pending to be flushed. Repeatedly calling this method may return
(&self)
| 288 | /// |
| 289 | /// Repeatedly calling this method may return the same value. |
| 290 | pub fn flush(&self) -> io::Result<Option<u64>> { |
| 291 | let mut inner = self.inner.write().unwrap(); |
| 292 | trace!("flush commitlog"); |
| 293 | inner.flush()?; |
| 294 | |
| 295 | Ok(inner.max_committed_offset()) |
| 296 | } |
| 297 | |
| 298 | /// Write all outstanding transaction records to disk and flush OS buffers. |
| 299 | /// |