MCPcopy Create free account
hub / github.com/cosdata/cosdata / flush

Method flush

src/models/wal.rs:154–171  ·  view source on GitHub ↗
(self, root_path: &Path, version: VersionNumber)

Source from the content-addressed store, hash-verified

152 }
153
154 pub fn flush(self, root_path: &Path, version: VersionNumber) -> Result<(), BufIoError> {
155 let cursor = self.bufman.open_cursor()?;
156 self.bufman
157 .update_u32_with_cursor(cursor, self.records_upserted.load(Ordering::Acquire))?;
158 self.bufman
159 .update_u32_with_cursor(cursor, self.records_deleted.load(Ordering::Acquire))?;
160 self.bufman
161 .update_u32_with_cursor(cursor, self.total_operations.load(Ordering::Acquire))?;
162 self.bufman.close_cursor(cursor)?;
163 let file_path: Arc<Path> = root_path.join(format!("{}.wal", *version)).into();
164
165 let mut file = OpenOptions::new()
166 .write(true)
167 .create(true)
168 .truncate(false)
169 .open(&file_path)?;
170 self.bufman.flush(&mut file)
171 }
172
173 pub fn append(&self, op: VectorOp) -> Result<(), BufIoError> {
174 let mut buf = Vec::new();

Callers 15

mainFunction · 0.45
create_collectionFunction · 0.45
flush_allMethod · 0.45
serializeMethod · 0.45
get_app_envFunction · 0.45
pre_commitMethod · 0.45
initMethod · 0.45

Calls 4

open_cursorMethod · 0.80
loadMethod · 0.80
close_cursorMethod · 0.80