pub struct TransactorNode { /* private fields */ }Expand description
A running transactor node hosting every database under one data directory.
Implementations§
Source§impl TransactorNode
impl TransactorNode
Sourcepub fn open(config: NodeConfig) -> Result<Arc<Self>, NodeError>
pub fn open(config: NodeConfig) -> Result<Arc<Self>, NodeError>
Opens a node over config.data_dir, recovering every database found
there (acquiring its lease, waiting out held leases up to the
configured bound).
§Errors
Returns an error when the store cannot be opened or a database cannot be recovered.
Sourcepub fn config(&self) -> &NodeConfig
pub fn config(&self) -> &NodeConfig
Node configuration.
Sourcepub fn shutdown_watch(&self) -> Receiver<Option<String>>
pub fn shutdown_watch(&self) -> Receiver<Option<String>>
Watch channel that reports a shutdown reason when the node deposes.
Sourcepub fn create_db(
self: &Arc<Self>,
name: &str,
schema_edn: &[u8],
) -> Result<bool, NodeError>
pub fn create_db( self: &Arc<Self>, name: &str, schema_edn: &[u8], ) -> Result<bool, NodeError>
Creates a database with the supplied EDN schema forms; returns
false when it already exists.
§Errors
Returns an error for invalid names/schema or store failures.
Sourcepub fn delete_db(&self, name: &str) -> Result<bool, NodeError>
pub fn delete_db(&self, name: &str) -> Result<bool, NodeError>
Deletes a database: unhosts it, releases its lease, and removes its
roots and log. Blobs remain until Self::gc_deleted.
§Errors
Returns an error when roots or the log cannot be removed.
Sourcepub async fn gc_deleted(&self) -> Result<u64, NodeError>
pub async fn gc_deleted(&self) -> Result<u64, NodeError>
Sweeps blobs unreachable from any live database root (including everything left behind by deleted databases and superseded indexes).
§Errors
Returns an error when the store cannot be enumerated or swept.
Sourcepub async fn gc_deleted_with_retention(
&self,
retention: Duration,
) -> Result<u64, NodeError>
pub async fn gc_deleted_with_retention( &self, retention: Duration, ) -> Result<u64, NodeError>
Sweeps unreachable blobs older than the caller-supplied retention.
§Errors
Returns an error when the store cannot be enumerated or swept.
Sourcepub async fn transact(
&self,
name: &str,
tx_data: &[u8],
) -> Result<TransactResponse, NodeError>
pub async fn transact( &self, name: &str, tx_data: &[u8], ) -> Result<TransactResponse, NodeError>
Auto Trait Implementations§
impl !Freeze for TransactorNode
impl !RefUnwindSafe for TransactorNode
impl !UnwindSafe for TransactorNode
impl Send for TransactorNode
impl Sync for TransactorNode
impl Unpin for TransactorNode
impl UnsafeUnpin for TransactorNode
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request