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

Method create_file_header

graphlite/src/txn/wal.rs:602–622  ·  view source on GitHub ↗

Create WAL file header

(&self)

Source from the content-addressed store, hash-verified

600
601 /// Create WAL file header
602 fn create_file_header(&self) -> Result<Vec<u8>, WALError> {
603 let mut header = Vec::with_capacity(64);
604
605 // Magic number
606 header.extend_from_slice(&WAL_MAGIC.to_le_bytes());
607
608 // Version
609 header.extend_from_slice(&WAL_VERSION.to_le_bytes());
610
611 // Creation timestamp
612 let timestamp = SystemTime::now()
613 .duration_since(UNIX_EPOCH)
614 .unwrap_or_default()
615 .as_nanos() as u64;
616 header.extend_from_slice(&timestamp.to_le_bytes());
617
618 // Reserved space for future use (50 bytes to make total 64)
619 header.extend_from_slice(&[0u8; 50]);
620
621 Ok(header)
622 }
623
624 /// Get next global sequence number
625 pub fn next_global_sequence(&self) -> u64 {

Callers 1

rotate_wal_fileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected