pub struct StagedAtomic { /* private fields */ }Expand description
A journal store that lends a (simulated) transaction.
Wraps any store and adds the capability. Every other method delegates, so a test gets a real journal with one extra thing it can do.
Implementations§
Source§impl StagedAtomic
impl StagedAtomic
pub fn wrap(inner: Arc<dyn JournalStore>) -> Arc<Self> ⓘ
Sourcepub fn lose_commit_acknowledgement(&self)
pub fn lose_commit_acknowledgement(&self)
From now on, every commit lands and its acknowledgement vanishes.
Models the nastier half of the in-doubt window: the transaction
committed — statements applied, records appended — and the client
was never told. This is the world in which a cheap abort is wrong: the
writes are standing, permanent, with no reversal registered and none
possible, and a group that settles Aborted over them has the journal
claiming taken back whole about work nobody took back. The runtime’s
only honest answer is quarantine, and this switch is how a test asks
the question.
Trait Implementations§
Source§impl AtomicJournal for StagedAtomic
impl AtomicJournal for StagedAtomic
Source§fn append_atomic<'life0, 'life1, 'async_trait>(
&'life0 self,
_run: RunId,
epoch: Epoch,
work: &'life1 dyn AtomicWork,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_atomic<'life0, 'life1, 'async_trait>(
&'life0 self,
_run: RunId,
epoch: Epoch,
work: &'life1 dyn AtomicWork,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run
work and append what it returns, in one transaction, fenced by
epoch exactly as an ordinary append is. Read moreSource§impl Debug for StagedAtomic
impl Debug for StagedAtomic
Source§impl JournalStore for StagedAtomic
impl JournalStore for StagedAtomic
Whether more than one plane instance can write to this store. Read more
Source§fn seals(&self) -> bool
fn seals(&self) -> bool
Whether this store seals payloads on append, rewriting what it is
handed. Read more
Source§fn atomic(&self) -> Option<&dyn AtomicJournal>
fn atomic(&self) -> Option<&dyn AtomicJournal>
This store’s own transaction, when a co-located resource can join it. Read more
Source§fn append<'life0, 'async_trait>(
&'life0 self,
epoch: Epoch,
batch: Vec<Append>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
epoch: Epoch,
batch: Vec<Append>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a batch, sealing each record into the chain. Read more
Source§fn read<'life0, 'async_trait>(
&'life0 self,
run: RunId,
from: Seq,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
run: RunId,
from: Seq,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read a run’s records from
from (inclusive, 1-based) onward. Read moreSource§fn read_page<'life0, 'async_trait>(
&'life0 self,
run: RunId,
from: Seq,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_page<'life0, 'async_trait>(
&'life0 self,
run: RunId,
from: Seq,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
owner: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
owner: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Take ownership of a run, returning the fencing epoch to write under. Read more
Source§fn renew<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
owner: &'life1 str,
epoch: Epoch,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn renew<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
owner: &'life1 str,
epoch: Epoch,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extend a lease this caller still holds, without ever claiming one. Read more
Source§fn release_lease<'life0, 'async_trait>(
&'life0 self,
run: RunId,
epoch: Epoch,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release_lease<'life0, 'async_trait>(
&'life0 self,
run: RunId,
epoch: Epoch,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Hand a lease back, so the next instance need not wait out the TTL. Read more
Source§fn abandoned_runs<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abandoned_runs<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Runs whose lease expired without being released — the runs an
instance died holding. Read more
Source§fn waiting_runs<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<WaitingRun>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn waiting_runs<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<WaitingRun>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The runs that are waiting, and what each one waits for. Read more
Source§fn admitted_as<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admitted_as<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The run that holds this admission key, if one does. Read more
Source§fn forget_admissions<'life0, 'async_trait>(
&'life0 self,
older_than: Timestamp,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn forget_admissions<'life0, 'async_trait>(
&'life0 self,
older_than: Timestamp,
) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retire admission keys claimed before
older_than. Returns how many. Read moreSource§fn runs_by_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
outcome: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn runs_by_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
outcome: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Concluded runs whose latest conclusion is
outcome, newest first. Read moreSource§fn count_by_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
outcome: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_by_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
outcome: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
How many runs currently rest on this conclusion. Read more
Source§fn runs_by_id<'life0, 'async_trait>(
&'life0 self,
after: Option<RunId>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn runs_by_id<'life0, 'async_trait>(
&'life0 self,
after: Option<RunId>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every run this tenant holds records for, by run id ascending, one
bounded page strictly after
after. Read moreSource§fn recent_runs<'life0, 'async_trait>(
&'life0 self,
after: Option<(u64, RunId)>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recent_runs<'life0, 'async_trait>(
&'life0 self,
after: Option<(u64, RunId)>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Runs ordered by last durable append, newest first, one bounded page. Read more
Source§fn recent_runs_from<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
after: Option<(u64, RunId)>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn recent_runs_from<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
after: Option<(u64, RunId)>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
recent_runs, narrowed to the runs one producer
admitted: those whose RunAdmitted carries an admission key whose
source half (origin_source) is
source. Read moreSource§fn case_history<'life0, 'async_trait>(
&'life0 self,
case: CaseId,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn case_history<'life0, 'async_trait>(
&'life0 self,
case: CaseId,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every record belonging to a case, oldest first. Read more
Source§fn head<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Head, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn head<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Head, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The run’s current chain head.
Source§fn seal<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
epoch: Epoch,
outcome: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Digest, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn seal<'life0, 'life1, 'async_trait>(
&'life0 self,
run: RunId,
epoch: Epoch,
outcome: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Digest, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Close the chain and return its terminal hash — what a signature covers. Read more
Source§fn checkpoint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Checkpoint, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn checkpoint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Checkpoint, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A commitment to the set of sealed runs. Read more
Source§fn consistency_proof<'life0, 'async_trait>(
&'life0 self,
old_size: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Digest>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn consistency_proof<'life0, 'async_trait>(
&'life0 self,
old_size: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Digest>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prove the log has only grown since a checkpoint of
old_size. Read moreSource§fn inclusion_proof<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inclusion_proof<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prove a sealed run is in the log this checkpoint commits to. Read more
Source§fn inclusion_proof_at<'life0, 'async_trait>(
&'life0 self,
run: RunId,
size: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inclusion_proof_at<'life0, 'async_trait>(
&'life0 self,
run: RunId,
size: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prove a sealed run is in the log as it stood at
size leaves — the
checkpoint an earlier checkpoint returned, not the
live one. Read moreSource§fn log_positions<'life0, 'life1, 'async_trait>(
&'life0 self,
runs: &'life1 [RunId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<(u64, Digest)>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn log_positions<'life0, 'life1, 'async_trait>(
&'life0 self,
runs: &'life1 [RunId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<(u64, Digest)>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Where each of
runs sits in the log — its index and leaf — or None
for a run that is not sealed, in the order asked. Read moreSource§fn request_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run: RunId,
actor: &'life1 Operator,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run: RunId,
actor: &'life1 Operator,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Ask a run to stop, durably. Read more
Source§fn cancellation<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<Cancellation>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancellation<'life0, 'async_trait>(
&'life0 self,
run: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<Cancellation>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The pending stop request for a run, if one was made. Read more
Auto Trait Implementations§
impl !Freeze for StagedAtomic
impl !RefUnwindSafe for StagedAtomic
impl !UnwindSafe for StagedAtomic
impl Send for StagedAtomic
impl Sync for StagedAtomic
impl Unpin for StagedAtomic
impl UnsafeUnpin for StagedAtomic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.