StandardCommandTransaction

Struct StandardCommandTransaction 

Source
pub struct StandardCommandTransaction {
    pub multi: TransactionMultiVersion,
    pub single: TransactionSingleVersion,
    /* private fields */
}
Expand description

An active command transaction that holds a multi command transaction and provides query/command access to single storage.

The transaction will auto-rollback on drop if not explicitly committed.

Fields§

§multi: TransactionMultiVersion§single: TransactionSingleVersion

Implementations§

Source§

impl StandardCommandTransaction

Source

pub fn new( multi: TransactionMultiVersion, single: TransactionSingleVersion, cdc: TransactionCdc, event_bus: EventBus, catalog: MaterializedCatalog, interceptors: Interceptors<Self>, ) -> Result<Self>

Creates a new active command transaction with a pre-commit callback

Source

pub fn event_bus(&self) -> &EventBus

Source

pub fn commit(&mut self) -> Result<CommitVersion>

Commit the transaction. Since single transactions are short-lived and auto-commit, this only commits the multi transaction.

Source

pub fn rollback(&mut self) -> Result<()>

Rollback the transaction.

Source

pub fn cdc(&self) -> &TransactionCdc

Get access to the CDC transaction interface

Source

pub fn pending_writes(&self) -> &PendingWrites

Get access to the pending writes in this transaction

This allows checking for key conflicts when committing FlowTransactions to ensure they operate on non-overlapping keyspaces.

Source

pub fn with_single_query<F, R>(&self, f: F) -> Result<R>

Execute a function with query access to the single transaction.

Source

pub fn with_single_command<F, R>(&self, f: F) -> Result<R>

Execute a function with query access to the single transaction.

Source

pub fn with_multi_query<F, R>(&self, f: F) -> Result<R>
where F: FnOnce(&mut StandardQueryTransaction) -> Result<R>,

Execute a function with a query transaction view. This creates a new query transaction using the stored multi-version storage. The query transaction will operate independently but share the same single/CDC storage.

Source

pub fn with_multi_query_as_of_exclusive<F, R>( &self, version: CommitVersion, f: F, ) -> Result<R>
where F: FnOnce(&mut StandardQueryTransaction) -> Result<R>,

Source

pub fn with_multi_query_as_of_inclusive<F, R>( &self, version: CommitVersion, f: F, ) -> Result<R>
where F: FnOnce(&mut StandardQueryTransaction) -> Result<R>,

Trait Implementations§

Source§

impl CatalogTrackNamespaceChangeOperations for StandardCommandTransaction

Source§

impl CatalogTrackRingBufferChangeOperations for StandardCommandTransaction

Source§

impl CatalogTrackTableChangeOperations for StandardCommandTransaction

Source§

impl CatalogTrackViewChangeOperations for StandardCommandTransaction

Source§

impl CommandTransaction for StandardCommandTransaction

Source§

type SingleVersionCommand<'a> = <TransactionSingleVersion as SingleVersionTransaction>::Command<'a>

Source§

fn begin_single_command(&self) -> Result<Self::SingleVersionCommand<'_>>

Source§

fn get_changes(&self) -> &TransactionalDefChanges

Get reference to catalog changes for this transaction
Source§

fn with_single_command<F, R>(&self, f: F) -> Result<R, Error>
where F: FnOnce(&mut Self::SingleVersionCommand<'_>) -> Result<R, Error>,

Source§

impl Drop for StandardCommandTransaction

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ExecuteCommand<StandardCommandTransaction> for Executor

Source§

impl ExecuteCommand<StandardCommandTransaction> for StandardEngine

Source§

impl<'a> From<&'a mut StandardCommandTransaction> for StandardTransaction<'a>

Source§

fn from(txn: &'a mut StandardCommandTransaction) -> Self

Converts to this type from the input type.
Source§

impl MaterializedCatalogTransaction for StandardCommandTransaction

Source§

impl MultiVersionCommandTransaction for StandardCommandTransaction

Source§

fn set(&mut self, key: &EncodedKey, row: EncodedValues) -> Result<()>

Source§

fn remove(&mut self, key: &EncodedKey) -> Result<()>

Source§

fn commit(self) -> Result<CommitVersion>

Source§

fn rollback(self) -> Result<()>

Source§

impl MultiVersionQueryTransaction for StandardCommandTransaction

Source§

fn version(&self) -> CommitVersion

Source§

fn id(&self) -> TransactionId

Source§

fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionValues>>

Source§

fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>

Source§

fn range_batched( &mut self, range: EncodedKeyRange, batch_size: u64, ) -> Result<BoxedMultiVersionIter<'_>>

Source§

fn range_rev_batched( &mut self, range: EncodedKeyRange, batch_size: u64, ) -> Result<BoxedMultiVersionIter<'_>>

Source§

fn prefix(&mut self, prefix: &EncodedKey) -> Result<BoxedMultiVersionIter<'_>>

Source§

fn prefix_rev( &mut self, prefix: &EncodedKey, ) -> Result<BoxedMultiVersionIter<'_>>

Source§

fn read_as_of_version_exclusive(&mut self, version: CommitVersion) -> Result<()>

Source§

fn range( &mut self, range: EncodedKeyRange, ) -> Result<Box<dyn Iterator<Item = MultiVersionValues> + Send + '_>, Error>

Source§

fn range_rev( &mut self, range: EncodedKeyRange, ) -> Result<Box<dyn Iterator<Item = MultiVersionValues> + Send + '_>, Error>

Source§

fn read_as_of_version_inclusive( &mut self, version: CommitVersion, ) -> Result<(), Error>

Source§

impl QueryTransaction for StandardCommandTransaction

Source§

type SingleVersionQuery<'a> = <TransactionSingleVersion as SingleVersionTransaction>::Query<'a>

Source§

type CdcQuery<'a> = <TransactionCdc as CdcTransaction>::Query<'a>

Source§

fn begin_single_query(&self) -> Result<Self::SingleVersionQuery<'_>>

Source§

fn begin_cdc_query(&self) -> Result<Self::CdcQuery<'_>>

Source§

fn with_single_query<F, R>(&self, f: F) -> Result<R, Error>
where F: FnOnce(&mut Self::SingleVersionQuery<'_>) -> Result<R, Error>,

Source§

fn with_cdc_query<F, R>(&self, f: F) -> Result<R, Error>
where F: FnOnce(&mut Self::CdcQuery<'_>) -> Result<R, Error>,

Source§

impl TransactionalNamespaceChanges for StandardCommandTransaction

Source§

impl TransactionalRingBufferChanges for StandardCommandTransaction

Source§

impl TransactionalTableChanges for StandardCommandTransaction

Source§

fn find_table(&self, id: TableId) -> Option<&TableDef>

Source§

fn find_table_by_name<'a>( &self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Option<&TableDef>

Source§

fn is_table_deleted(&self, id: TableId) -> bool

Source§

fn is_table_deleted_by_name<'a>( &self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> bool

Source§

impl TransactionalViewChanges for StandardCommandTransaction

Source§

fn find_view(&self, id: ViewId) -> Option<&ViewDef>

Source§

fn find_view_by_name<'a>( &self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Option<&ViewDef>

Source§

fn is_view_deleted(&self, id: ViewId) -> bool

Source§

fn is_view_deleted_by_name<'a>( &self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> bool

Source§

impl WithEventBus for StandardCommandTransaction

Source§

impl WithInterceptors<StandardCommandTransaction> for StandardCommandTransaction

Source§

fn table_pre_insert_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePreInsertInterceptor<StandardCommandTransaction>>

Access table pre-insert interceptor chain
Source§

fn table_post_insert_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePostInsertInterceptor<StandardCommandTransaction>>

Access table post-insert interceptor chain
Source§

fn table_pre_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePreUpdateInterceptor<StandardCommandTransaction>>

Access table pre-update interceptor chain
Source§

fn table_post_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePostUpdateInterceptor<StandardCommandTransaction>>

Access table post-update interceptor chain
Source§

fn table_pre_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePreDeleteInterceptor<StandardCommandTransaction>>

Access table pre-delete interceptor chain
Source§

fn table_post_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TablePostDeleteInterceptor<StandardCommandTransaction>>

Access table post-delete interceptor chain
Source§

fn ring_buffer_pre_insert_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPreInsertInterceptor<StandardCommandTransaction>>

Access ring buffer pre-insert interceptor chain
Source§

fn ring_buffer_post_insert_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPostInsertInterceptor<StandardCommandTransaction>>

Access ring buffer post-insert interceptor chain
Source§

fn ring_buffer_pre_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPreUpdateInterceptor<StandardCommandTransaction>>

Access ring buffer pre-update interceptor chain
Source§

fn ring_buffer_post_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPostUpdateInterceptor<StandardCommandTransaction>>

Access ring buffer post-update interceptor chain
Source§

fn ring_buffer_pre_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPreDeleteInterceptor<StandardCommandTransaction>>

Access ring buffer pre-delete interceptor chain
Source§

fn ring_buffer_post_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn RingBufferPostDeleteInterceptor<StandardCommandTransaction>>

Access ring buffer post-delete interceptor chain
Source§

fn pre_commit_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn PreCommitInterceptor<StandardCommandTransaction>>

Access pre-commit interceptor chain
Source§

fn post_commit_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn PostCommitInterceptor<StandardCommandTransaction>>

Access post-commit interceptor chain
Source§

fn namespace_def_post_create_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn NamespaceDefPostCreateInterceptor<StandardCommandTransaction>>

Access namespace post-create interceptor chain
Source§

fn namespace_def_pre_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn NamespaceDefPreUpdateInterceptor<StandardCommandTransaction>>

Access namespace pre-update interceptor chain
Source§

fn namespace_def_post_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn NamespaceDefPostUpdateInterceptor<StandardCommandTransaction>>

Access namespace post-update interceptor chain
Source§

fn namespace_def_pre_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn NamespaceDefPreDeleteInterceptor<StandardCommandTransaction>>

Access namespace pre-delete interceptor chain
Source§

fn table_def_post_create_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TableDefPostCreateInterceptor<StandardCommandTransaction>>

Access table definition post-create interceptor chain
Source§

fn table_def_pre_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TableDefPreUpdateInterceptor<StandardCommandTransaction>>

Access table definition pre-update interceptor chain
Source§

fn table_def_post_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TableDefPostUpdateInterceptor<StandardCommandTransaction>>

Access table definition post-update interceptor chain
Source§

fn table_def_pre_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn TableDefPreDeleteInterceptor<StandardCommandTransaction>>

Access table definition pre-delete interceptor chain
Source§

fn view_def_post_create_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn ViewDefPostCreateInterceptor<StandardCommandTransaction>>

Access view post-create interceptor chain
Source§

fn view_def_pre_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn ViewDefPreUpdateInterceptor<StandardCommandTransaction>>

Access view pre-update interceptor chain
Source§

fn view_def_post_update_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn ViewDefPostUpdateInterceptor<StandardCommandTransaction>>

Access view post-update interceptor chain
Source§

fn view_def_pre_delete_interceptors( &mut self, ) -> &mut Chain<StandardCommandTransaction, dyn ViewDefPreDeleteInterceptor<StandardCommandTransaction>>

Access view pre-delete interceptor chain
Source§

impl Execute<StandardCommandTransaction, StandardQueryTransaction> for Executor

Source§

impl TransactionalChanges for StandardCommandTransaction

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<QT> CatalogFlowQueryOperations for QT

Source§

fn find_flow(&mut self, id: FlowId) -> Result<Option<FlowDef>, Error>

Source§

fn find_flow_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<Option<FlowDef>, Error>

Source§

fn get_flow(&mut self, id: FlowId) -> Result<FlowDef, Error>

Source§

fn get_flow_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<FlowDef, Error>

Source§

impl<CT> CatalogNamespaceCommandOperations for CT

Source§

impl<QT> CatalogNamespaceQueryOperations for QT

Source§

impl<CT> CatalogRingBufferCommandOperations for CT

Source§

impl<QT> CatalogRingBufferQueryOperations for QT

Source§

impl<T> CatalogSourceQueryOperations for T

Source§

fn find_source_by_name<'a>( &mut self, _namespace: NamespaceId, _source: impl IntoFragment<'a>, ) -> Result<Option<SourceDef>, Error>

Source§

fn find_source(&mut self, _id: SourceId) -> Result<Option<SourceDef>, Error>

Source§

fn get_source_by_name<'a>( &mut self, _namespace: NamespaceId, _name: impl IntoFragment<'a>, ) -> Result<SourceDef, Error>

Source§

impl<CT> CatalogTableCommandOperations for CT

Source§

fn create_table(&mut self, to_create: TableToCreate) -> Result<TableDef, Error>

Source§

impl<QT> CatalogTableQueryOperations for QT

Source§

fn find_table(&mut self, id: TableId) -> Result<Option<TableDef>, Error>

Source§

fn find_table_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<Option<TableDef>, Error>

Source§

fn get_table(&mut self, id: TableId) -> Result<TableDef, Error>

Source§

fn get_table_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<TableDef, Error>

Source§

impl<CT> CatalogViewCommandOperations for CT

Source§

fn create_view(&mut self, to_create: ViewToCreate) -> Result<ViewDef, Error>

Source§

impl<QT> CatalogViewQueryOperations for QT

Source§

fn find_view(&mut self, id: ViewId) -> Result<Option<ViewDef>, Error>

Source§

fn find_view_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<Option<ViewDef>, Error>

Source§

fn get_view(&mut self, id: ViewId) -> Result<ViewDef, Error>

Source§

fn get_view_by_name<'a>( &mut self, namespace: NamespaceId, name: impl IntoFragment<'a>, ) -> Result<ViewDef, Error>

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<CT> NamespaceDefInterceptor<CT> for CT

Source§

fn post_create(&mut self, post: &NamespaceDef) -> Result<(), Error>

Intercept namespace post-create operations
Source§

fn pre_update(&mut self, pre: &NamespaceDef) -> Result<(), Error>

Intercept namespace pre-update operations
Source§

fn post_update( &mut self, pre: &NamespaceDef, post: &NamespaceDef, ) -> Result<(), Error>

Intercept namespace post-update operations
Source§

fn pre_delete(&mut self, pre: &NamespaceDef) -> Result<(), Error>

Intercept namespace pre-delete operations
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<CT> RingBufferInterceptor<CT> for CT

Source§

fn pre_insert( &mut self, ring_buffer: &RingBufferDef, row: &EncodedValues, ) -> Result<(), Error>

Intercept ring buffer pre-insert operations
Source§

fn post_insert( &mut self, ring_buffer: &RingBufferDef, id: RowNumber, row: &EncodedValues, ) -> Result<(), Error>

Intercept ring buffer post-insert operations
Source§

fn pre_update( &mut self, ring_buffer: &RingBufferDef, id: RowNumber, row: &EncodedValues, ) -> Result<(), Error>

Intercept ring buffer pre-update operations
Source§

fn post_update( &mut self, ring_buffer: &RingBufferDef, id: RowNumber, row: &EncodedValues, old_row: &EncodedValues, ) -> Result<(), Error>

Intercept ring buffer post-update operations
Source§

fn pre_delete( &mut self, ring_buffer: &RingBufferDef, id: RowNumber, ) -> Result<(), Error>

Intercept ring buffer pre-delete operations
Source§

fn post_delete( &mut self, ring_buffer: &RingBufferDef, id: RowNumber, deleted_row: &EncodedValues, ) -> Result<(), Error>

Intercept ring buffer post-delete operations
Source§

impl<CT> TableDefInterceptor<CT> for CT

Source§

fn post_create(&mut self, post: &TableDef) -> Result<(), Error>

Intercept table definition post-create operations
Source§

fn pre_update(&mut self, pre: &TableDef) -> Result<(), Error>

Intercept table definition pre-update operations
Source§

fn post_update(&mut self, pre: &TableDef, post: &TableDef) -> Result<(), Error>

Intercept table definition post-update operations
Source§

fn pre_delete(&mut self, pre: &TableDef) -> Result<(), Error>

Intercept table definition pre-delete operations
Source§

impl<CT> TableInterceptor<CT> for CT

Source§

fn pre_insert( &mut self, table: &TableDef, row: &EncodedValues, ) -> Result<(), Error>

Intercept table pre-insert operations
Source§

fn post_insert( &mut self, table: &TableDef, id: RowNumber, row: &EncodedValues, ) -> Result<(), Error>

Intercept table post-insert operations
Source§

fn pre_update( &mut self, table: &TableDef, id: RowNumber, row: &EncodedValues, ) -> Result<(), Error>

Intercept table pre-update operations
Source§

fn post_update( &mut self, table: &TableDef, id: RowNumber, row: &EncodedValues, old_row: &EncodedValues, ) -> Result<(), Error>

Intercept table post-update operations
Source§

fn pre_delete(&mut self, table: &TableDef, id: RowNumber) -> Result<(), Error>

Intercept table pre-delete operations
Source§

fn post_delete( &mut self, table: &TableDef, id: RowNumber, deleted_row: &EncodedValues, ) -> Result<(), Error>

Intercept table post-delete operations
Source§

impl<CT> TransactionInterceptor<CT> for CT

Source§

fn pre_commit(&mut self) -> Result<(), Error>

Intercept pre-commit operations
Source§

fn post_commit( &mut self, id: TransactionId, version: CommitVersion, changes: TransactionalDefChanges, ) -> Result<(), Error>

Intercept post-commit operations
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<CT> ViewDefInterceptor<CT> for CT

Source§

fn post_create(&mut self, post: &ViewDef) -> Result<(), Error>

Intercept view post-create operations
Source§

fn pre_update(&mut self, pre: &ViewDef) -> Result<(), Error>

Intercept view pre-update operations
Source§

fn post_update(&mut self, pre: &ViewDef, post: &ViewDef) -> Result<(), Error>

Intercept view post-update operations
Source§

fn pre_delete(&mut self, pre: &ViewDef) -> Result<(), Error>

Intercept view pre-delete operations
Source§

impl<QT> CatalogQueryTransaction for QT