Skip to main content

BulkWrite

Struct BulkWrite 

Source
pub struct BulkWrite { /* private fields */ }
Expand description

A plan-time eligible global bulk write (ADR-0209 §1).

Implementations§

Source§

impl BulkWrite

Source

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.

Source

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).

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.

Source

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.

Trait Implementations§

Source§

impl Clone for BulkWrite

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BulkWrite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for BulkWrite

§

impl Freeze for BulkWrite

§

impl Move for BulkWrite

§

impl RefUnwindSafe for BulkWrite

§

impl Send for BulkWrite
where RawTable<(String, ())>: Send, RawVecInner: Send, Arc<str>: Send, Arc<Vec<Value>>: Send, Arc<BTreeMap<String, Value>>: Send, Arc<Node>: Send, Arc<Relationship>: Send, Arc<Path>: Send, NonZero<i32>: Send, BoxRaw<CivilZonedFields>: Send, Arc<[f32]>: Send, Arc<[f64]>: Send, Arc<[i64]>: Send, Arc<[u8]>: Send, BoxRaw<Expr>: Send, BoxRaw<LabelExpr>: Send, BoxRaw<TypeExpr>: Send, BoxRaw<Clause>: Send, BoxRaw<SearchClause>: Send, BoxRaw<Query>: Send,

§

impl Sync for BulkWrite
where RawTable<(String, ())>: Sync, RawVecInner: Sync, Arc<str>: Sync, Arc<Vec<Value>>: Sync, Arc<BTreeMap<String, Value>>: Sync, Arc<Node>: Sync, Arc<Relationship>: Sync, Arc<Path>: Sync, NonZero<i32>: Sync, BoxRaw<CivilZonedFields>: Sync, Arc<[f32]>: Sync, Arc<[f64]>: Sync, Arc<[i64]>: Sync, Arc<[u8]>: Sync, BoxRaw<Expr>: Sync, BoxRaw<LabelExpr>: Sync, BoxRaw<TypeExpr>: Sync, BoxRaw<Clause>: Sync, BoxRaw<SearchClause>: Sync, BoxRaw<Query>: Sync,

§

impl Unpin for BulkWrite

§

impl UnsafeUnpin for BulkWrite

§

impl UnwindSafe for BulkWrite

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V