pub struct KubericRuntime { /* private fields */ }Expand description
The kuberic runtime. Wires the replicator actor, manages access status, enforces promotion/demotion ordering, and delivers events to the user.
Implementations§
Source§impl KubericRuntime
impl KubericRuntime
pub fn builder() -> KubericRuntimeBuilder
Sourcepub async fn open(&self, mode: OpenMode) -> Result<()>
pub async fn open(&self, mode: OpenMode) -> Result<()>
Open the replicator. In the new API, the user creates the replicator in the Open callback. This legacy runtime pre-creates everything and sends OpenContext for the user to create the replicator.
For backward compatibility with tests that use RuntimeBundle’s pre-created channels, this method sends a minimal OpenContext and the test’s Open handler returns a ReplicatorHandle that wraps the pre-created control_tx.
Sourcepub async fn change_role(
&self,
epoch: Epoch,
new_role: Role,
old_role: Role,
) -> Result<()>
pub async fn change_role( &self, epoch: Epoch, new_role: Role, old_role: Role, ) -> Result<()>
Change role with correct ordering:
- Promotion (to Primary): replicator first, then user
- Demotion (from Primary): user first, then replicator
pub async fn update_epoch(&self, epoch: Epoch) -> Result<()>
pub async fn update_catch_up_configuration( &self, current: ReplicaSetConfig, previous: ReplicaSetConfig, ) -> Result<()>
pub async fn update_current_configuration( &self, current: ReplicaSetConfig, ) -> Result<()>
pub async fn wait_for_catch_up_quorum( &self, mode: ReplicaSetQuorumMode, ) -> Result<()>
pub async fn build_replica(&self, replica: ReplicaInfo) -> Result<()>
pub async fn remove_replica(&self, replica_id: ReplicaId) -> Result<()>
pub async fn on_data_loss(&self) -> Result<DataLossAction>
pub fn read_status(&self) -> AccessStatus
pub fn write_status(&self) -> AccessStatus
pub fn current_progress(&self) -> Lsn
pub fn catch_up_capability(&self) -> Lsn
pub fn committed_lsn(&self) -> Lsn
Auto Trait Implementations§
impl Freeze for KubericRuntime
impl RefUnwindSafe for KubericRuntime
impl Send for KubericRuntime
impl Sync for KubericRuntime
impl Unpin for KubericRuntime
impl UnsafeUnpin for KubericRuntime
impl UnwindSafe for KubericRuntime
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
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>
Wrap the input message
T in a tonic::Request