()
| 98 | |
| 99 | impl WALFile { |
| 100 | pub fn new() -> Result<Self, BufIoError> { |
| 101 | let bufman = FilelessBufferManager::new(8192)?; |
| 102 | let cursor = bufman.open_cursor()?; |
| 103 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 104 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 105 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 106 | |
| 107 | Ok(Self { |
| 108 | bufman, |
| 109 | cursor, |
| 110 | read_lock: Mutex::new(()), |
| 111 | records_upserted: AtomicU32::new(0), |
| 112 | records_deleted: AtomicU32::new(0), |
| 113 | total_operations: AtomicU32::new(0), |
| 114 | }) |
| 115 | } |
| 116 | |
| 117 | pub fn from_existing(root_path: &Path, version: VersionNumber) -> Result<Self, BufIoError> { |
| 118 | let file_path: Arc<Path> = root_path.join(format!("{}.wal", *version)).into(); |
nothing calls this directly
no test coverage detected