pub struct WriteScratch { /* private fields */ }Expand description
Per-attempt write buffer. The shared Graph is not mutated until apply_redo.
workspace is not cloned. A clone keeps the created entities and takes
its own reservation once, at clone time, so dropping the original
releases the original reservation once.
Implementations§
Source§impl WriteScratch
impl WriteScratch
pub fn new( snapshot_ts: u64, node_id_alloc: Arc<AtomicU64>, rel_id_alloc: Arc<AtomicU64>, ) -> Self
pub fn snapshot_ts(&self) -> u64
pub fn take_redo(&mut self) -> Vec<RedoOp>
Sourcepub fn take_redo_with_workspace(
&mut self,
) -> Result<(Vec<RedoOp>, WorkspaceCharge)>
pub fn take_redo_with_workspace( &mut self, ) -> Result<(Vec<RedoOp>, WorkspaceCharge)>
Drain the redo and hand its live workspace reservation to the caller.
The scratch’s execution allocation is still represented by the redo vector while WAL commit serializes and applies it. The caller holds this charge through that boundary, then drops it once the commit has either been rejected or acknowledged.
Sourcepub fn redo_since(&self, from: usize) -> Option<Vec<RedoOp>>
pub fn redo_since(&self, from: usize) -> Option<Vec<RedoOp>>
The redo ops at or after from: what the statements run since that
position appended. None when from is past the end — the log
shrank under the caller’s cursor, which the caller refuses rather
than reading as nothing. Reads without draining, so a caller
bounding the transaction’s prospective commit measures the same ops
that commit will.