ROADMAP v0.3.0 - Manual WAL flush for durability checkpoints and testing
(&self)
| 637 | /// Ensure all pending writes are flushed (for testing) |
| 638 | #[allow(dead_code)] // ROADMAP v0.3.0 - Manual WAL flush for durability checkpoints and testing |
| 639 | pub fn flush(&self) -> Result<(), WALError> { |
| 640 | let mut writer_guard = self.current_writer.lock().unwrap(); |
| 641 | if let Some(writer) = writer_guard.as_mut() { |
| 642 | writer |
| 643 | .flush() |
| 644 | .map_err(|e| WALError::IOError(format!("Failed to flush WAL: {}", e)))?; |
| 645 | writer |
| 646 | .get_mut() |
| 647 | .sync_all() |
| 648 | .map_err(|e| WALError::IOError(format!("Failed to sync WAL: {}", e)))?; |
| 649 | } |
| 650 | Ok(()) |
| 651 | } |
| 652 | |
| 653 | /// Read all entries from a specific WAL file |
| 654 | pub fn read_wal_file(&self, file_number: u64) -> Result<Vec<WALEntry>, WALError> { |
no test coverage detected