Skip to main content

PreparedCommand

Struct PreparedCommand 

Source
pub struct PreparedCommand {
    pub commit_index: u64,
    pub writes: BTreeSet<Vec<u8>>,
    pub reads: DependencySet,
    pub sequenced: bool,
}
Expand description

Prepared metadata for one admitted command. The publisher keeps this alongside expanded operations so an admission overlay can validate read/write conflicts without re-expanding the command.

Fields§

§commit_index: u64

Reserved commit index, preserving command-log order.

§writes: BTreeSet<Vec<u8>>

Canonical keys written by the expanded operation set.

§reads: DependencySet

Keys/ranges read while preparing the command.

§sequenced: bool

Expanded under writer admission against the sequencer overlay, so its reads already observed every lower-index commit (published or pending). Such a command can share a publish group with the commits it read from: the group applies in commit-index order.

Implementations§

Source§

impl PreparedCommand

Source

pub fn from_ops(commit_index: u64, ops: &[Op]) -> Self

Build prepared metadata from an expanded operation set.

Source

pub fn conflicts_with(&self, other: &Self) -> bool

Whether this command’s reads overlap writes from other, or vice versa. The check is symmetric and suitable for optimistic admission.

The write-write check (large-transaction support, Part F) uses writes being a BTreeSet directly — other.writes.contains(key) is O(log n), not the nested linear scan this used to be. Filtering only self’s side is still exactly equivalent to filtering both: is_coordination_write is a pure function of the key’s own bytes, so if key already passed the filter, an identical byte sequence in other.writes has the same classification — there is no case where filtering the other side too would change the answer.

Read sets are probed against the ordered write set — one range query per recorded read — rather than testing every written key against a linear list of read ranges. The old form was O(writes × reads) per pair and, applied pairwise inside every publish group, starved bulk ingest for minutes (cloud-capacity F4 follow-up).

Trait Implementations§

Source§

impl Clone for PreparedCommand

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 PreparedCommand

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for PreparedCommand

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<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> Same for T

Source§

type Output = T

Should always be Self
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.