pub struct BulkWrite { /* private fields */ }Expand description
A plan-time eligible global bulk write (ADR-0209 §1).
Implementations§
Source§impl BulkWrite
impl BulkWrite
Sourcepub fn collect_targets(
&self,
graph: &Graph,
snapshot_ts: u64,
) -> Result<Option<BulkTargets>>
pub fn collect_targets( &self, graph: &Graph, snapshot_ts: u64, ) -> Result<Option<BulkTargets>>
Phase 1: snapshot the matched entity id space at snapshot_ts.
Returns Ok(None) when the catalog holds any constraint: batched
commits validate per batch, so constrained catalogs keep the
unbatched atomic path (ADR-0209 §1). A non-DETACH node delete
preflights DeleteConnectedNode across every target here, before
the first batch commits.
Sourcepub fn execute_chunk(
&self,
view: &ExecGraph<'_>,
targets: &BulkTargets,
cursor: &mut BulkCursor,
budget: u64,
params: &BTreeMap<String, Value>,
) -> Result<bool>
pub fn execute_chunk( &self, view: &ExecGraph<'_>, targets: &BulkTargets, cursor: &mut BulkCursor, budget: u64, params: &BTreeMap<String, Value>, ) -> Result<bool>
Phase 2: apply up to budget work units starting at cursor on
the caller’s write view (which carries the cancellation token).
Returns true when the target space is exhausted. The caller
commits the view’s scratch per chunk.
Source§impl BulkWrite
Plan-time detection of a batchable global bulk write (ADR-0209 §1).
impl BulkWrite
Plan-time detection of a batchable global bulk write (ADR-0209 §1).
Conservative by construction: any deviation from the recognized
shapes — a WHERE, an aggregating WITH, a graph-sensitive CREATE
expression, a RETURN after the write, multiple parts, UNION,
NEXT — yields None and the statement runs unbatched.
Sourcepub fn estimate_upper_bound(&self, graph: &Graph) -> Option<u64>
pub fn estimate_upper_bound(&self, graph: &Graph) -> Option<u64>
An O(1) upper bound on the touched-entity count, from the label
index (plan-time counts, ADR-0218): product of per-factor upper
bounds for row writes, sum over the named factors for a delete.
None when a factor has no cheap bound (unlabeled rels) — the
caller then pays the real collection. Overestimates are safe
(the cost is collecting anyway); underestimates would wrongly
skip batching, so every arm errs upward.