(root_path: &Path, version: VersionNumber)
| 19 | |
| 20 | impl DurableWALFile { |
| 21 | pub fn new(root_path: &Path, version: VersionNumber) -> Result<Self, BufIoError> { |
| 22 | let file_path: Arc<Path> = root_path.join(format!("{}.wal", *version)).into(); |
| 23 | |
| 24 | let file = OpenOptions::new() |
| 25 | .write(true) |
| 26 | .read(true) |
| 27 | .create(true) |
| 28 | .truncate(false) |
| 29 | .open(&file_path)?; |
| 30 | let bufman = BufferManager::new(file, 8192)?; |
| 31 | let cursor = bufman.open_cursor()?; |
| 32 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 33 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 34 | bufman.update_u32_with_cursor(cursor, 0)?; |
| 35 | |
| 36 | Ok(Self { |
| 37 | bufman, |
| 38 | cursor, |
| 39 | records_upserted: 0, |
| 40 | records_deleted: 0, |
| 41 | total_operations: 0, |
| 42 | }) |
| 43 | } |
| 44 | |
| 45 | pub fn records_upserted(&self) -> u32 { |
| 46 | self.records_upserted |
nothing calls this directly
no test coverage detected