MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / flush

Method flush

nodedb/src/engine/array/flush.rs:19–25  ·  view source on GitHub ↗

Flush the array's memtable to a new on-disk segment using a caller-supplied LSN as the segment's flush watermark. A no-op if the memtable is empty.

(&mut self, id: &ArrayId, wal_lsn: u64)

Source from the content-addressed store, hash-verified

17 /// caller-supplied LSN as the segment's flush watermark. A no-op if
18 /// the memtable is empty.
19 pub fn flush(&mut self, id: &ArrayId, wal_lsn: u64) -> ArrayEngineResult<Option<SegmentRef>> {
20 let Some(prepared) = self.prepare_flush(id)? else {
21 return Ok(None);
22 };
23 self.install_flushed_segment(id, prepared, wal_lsn)
24 .map(Some)
25 }
26
27 fn prepare_flush(&mut self, id: &ArrayId) -> ArrayEngineResult<Option<PreparedFlush>> {
28 let store = self.store_mut(id)?;

Calls 2

prepare_flushMethod · 0.80