MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / flush

Method flush

graphlite/src/txn/wal.rs:639–651  ·  view source on GitHub ↗

ROADMAP v0.3.0 - Manual WAL flush for durability checkpoints and testing

(&self)

Source from the content-addressed store, hash-verified

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> {

Callers 2

write_entryMethod · 0.45
rotate_wal_fileMethod · 0.45

Calls 2

unwrapMethod · 0.80
get_mutMethod · 0.80

Tested by

no test coverage detected