pub struct DistributedTdbStore { /* private fields */ }Expand description
Distributed TDB Store
High-level interface for distributed RDF storage with integrated transaction coordination, deadlock detection, and replication.
Implementations§
Source§impl DistributedTdbStore
impl DistributedTdbStore
Sourcepub fn new(node_id: String, config: DistributedConfig) -> Self
pub fn new(node_id: String, config: DistributedConfig) -> Self
Create a new Distributed TDB Store with no network transport configured.
Note: because no NetworkTransport is supplied, the underlying
TransactionCoordinator and ReplicationManager cannot honestly
reach any other node: commit_distributed_transaction() will fail
with TdbError::DistributedTransportNotConfigured for every
protocol rather than fabricating success. Use
DistributedTdbStore::with_transport (with a real network-backed
transport, or
crate::consensus::transport::LoopbackSimulationTransport for
single-node tests) to actually drive distributed commits.
Sourcepub fn with_transport(
node_id: String,
config: DistributedConfig,
transport: Arc<dyn NetworkTransport>,
) -> Self
pub fn with_transport( node_id: String, config: DistributedConfig, transport: Arc<dyn NetworkTransport>, ) -> Self
Create a new Distributed TDB Store backed by a real (or
explicitly-simulated) NetworkTransport, shared by both the
transaction coordinator and the replication manager. This is the
constructor production code should use to actually drive distributed
commits and replication.
Sourcepub async fn register_node(
&mut self,
node_id: &str,
endpoint: &str,
) -> Result<()>
pub async fn register_node( &mut self, node_id: &str, endpoint: &str, ) -> Result<()>
Register a node in the distributed system
Sourcepub async fn begin_distributed_transaction(&mut self) -> Result<String>
pub async fn begin_distributed_transaction(&mut self) -> Result<String>
Begin a distributed transaction
Sourcepub async fn begin_distributed_transaction_with_protocol(
&mut self,
protocol: CommitProtocol,
) -> Result<String>
pub async fn begin_distributed_transaction_with_protocol( &mut self, protocol: CommitProtocol, ) -> Result<String>
Begin a distributed transaction with specific protocol
Sourcepub async fn commit_distributed_transaction(
&mut self,
txn_id: &str,
) -> Result<bool>
pub async fn commit_distributed_transaction( &mut self, txn_id: &str, ) -> Result<bool>
Commit a distributed transaction
Sourcepub async fn abort_distributed_transaction(
&mut self,
txn_id: &str,
) -> Result<()>
pub async fn abort_distributed_transaction( &mut self, txn_id: &str, ) -> Result<()>
Abort a distributed transaction
Sourcepub async fn execute_saga(&mut self, saga: SagaOrchestrator) -> Result<bool>
pub async fn execute_saga(&mut self, saga: SagaOrchestrator) -> Result<bool>
Create and execute a saga
Sourcepub fn active_transaction_count(&self) -> usize
pub fn active_transaction_count(&self) -> usize
Get active transaction count
Sourcepub fn stats(&self) -> DistributedStoreStats
pub fn stats(&self) -> DistributedStoreStats
Get statistics
Sourcepub fn coordinator_stats(&self) -> CoordinatorStats
pub fn coordinator_stats(&self) -> CoordinatorStats
Get coordinator statistics
Sourcepub fn replication_stats(&self) -> Option<ReplicationStats>
pub fn replication_stats(&self) -> Option<ReplicationStats>
Get replication statistics (if enabled)
Sourcepub async fn check_health(&self) -> Result<HealthStatus>
pub async fn check_health(&self) -> Result<HealthStatus>
Check system health
Auto Trait Implementations§
impl !RefUnwindSafe for DistributedTdbStore
impl !UnwindSafe for DistributedTdbStore
impl Freeze for DistributedTdbStore
impl Send for DistributedTdbStore
impl Sync for DistributedTdbStore
impl Unpin for DistributedTdbStore
impl UnsafeUnpin for DistributedTdbStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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 more