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)
| 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)?; |