pub struct ReplicationPrimary { /* private fields */ }Implementations§
Source§impl ReplicationPrimary
impl ReplicationPrimary
pub fn start(shard_count: usize, config: ReplicationConfig) -> Result<Self>
pub fn shard_count(&self) -> usize
Sourcepub fn next_sequence(&self, shard_id: usize) -> u64
pub fn next_sequence(&self, shard_id: usize) -> u64
Allocates the next sequence for shard_id from the primary-owned
counter. Callers using an external sequence source (such as the engine
shard worker, which already mints sequences for the WAL) should pass
fully-formed mutations to Self::emit instead.
Sourcepub fn emit(&self, mutation: ReplicationMutation)
pub fn emit(&self, mutation: ReplicationMutation)
Enqueues a mutation for callers that do not own a shard-local batch buffer.
The sharded engine path uses ReplicationBatchBuilder so it can
append mutations to an ordered per-shard Vec and hand off ready
batches. This fallback keeps direct embedded callers correct without
adding shared batching state.
pub fn queue_depths(&self) -> Vec<usize>
pub fn max_queue_depth(&self) -> usize
pub fn total_queue_depth(&self) -> usize
pub fn per_shard_export_enabled(&self) -> bool
pub fn lane_count(&self) -> usize
pub fn shutdown(&self) -> Result<()>
pub fn subscribe(&self, channel_capacity: usize) -> Receiver<Bytes>
pub fn catch_up_since( &self, watermarks: &ShardWatermarks, ) -> Result<BacklogCatchUp>
Sourcepub fn current_watermarks(&self) -> ShardWatermarks
pub fn current_watermarks(&self) -> ShardWatermarks
Returns the watermarks for batches that have been emitted to subscribers and the backlog. Mutations that are still pending in shard-local batch builders or ready-batch channels are not reflected here.
pub fn latest_backlog_watermarks(&self) -> ShardWatermarks
pub fn metrics_snapshot(&self) -> ReplicationMetricsSnapshot
pub fn decode_subscriber_frame(bytes: &[u8]) -> Result<ReplicationFrame>
Trait Implementations§
Source§impl Debug for ReplicationPrimary
impl Debug for ReplicationPrimary
Source§impl Drop for ReplicationPrimary
impl Drop for ReplicationPrimary
Auto Trait Implementations§
impl Freeze for ReplicationPrimary
impl !RefUnwindSafe for ReplicationPrimary
impl Send for ReplicationPrimary
impl Sync for ReplicationPrimary
impl Unpin for ReplicationPrimary
impl UnsafeUnpin for ReplicationPrimary
impl UnwindSafe for ReplicationPrimary
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