Skip to main content

Replicator

Trait Replicator 

Source
pub trait Replicator: Send + Sync {
    // Required method
    fn replicate(
        &self,
        batch: &CommitBatch,
        payload: &[u8],
    ) -> Result<(), String>;

    // Provided method
    fn acknowledged_commit_index(&self) -> Option<u64> { ... }
}
Expand description

Replication seam: when installed on a Store, local commits build the canonical CommitBatch and route it through the leader. The leader replicates to the quorum and every node (leader included) applies it through Store::apply_replicated_batch, which returns after the batch is durably applied locally. Serialized payload is stored with the outcome so idempotent retries can reproduce the caller’s response.

Required Methods§

Source

fn replicate(&self, batch: &CommitBatch, payload: &[u8]) -> Result<(), String>

Replicate batch with its serialized payload to the quorum.

§Errors

Returns a human-readable reason if replication fails.

Provided Methods§

Source

fn acknowledged_commit_index(&self) -> Option<u64>

Highest commit index durably acknowledged by the replication quorum.

Implementations that cannot expose a watermark return None; the retention worker then leaves the replica consumer unregistered rather than guessing that a lagging replica is caught up.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§