pub struct ReplicationManager { /* private fields */ }Expand description
Manages replica placement for data items.
Implementations§
Source§impl ReplicationManager
impl ReplicationManager
Sourcepub fn replicate(&mut self, data: &[u8], factor: u32, nodes: &[u64]) -> Vec<u64>
pub fn replicate(&mut self, data: &[u8], factor: u32, nodes: &[u64]) -> Vec<u64>
Replicate data to factor nodes selected from nodes.
Selection is deterministic: the first factor nodes from the slice are
used. The mapping is stored internally and the selected node IDs are
returned.
If nodes has fewer entries than factor, all provided nodes are used.
Sourcepub fn replica_nodes(&self, data: &[u8]) -> Option<&[u64]>
pub fn replica_nodes(&self, data: &[u8]) -> Option<&[u64]>
Return the nodes holding replicas for the given data.
Sourcepub fn record_count(&self) -> usize
pub fn record_count(&self) -> usize
Total number of tracked replication records.
Trait Implementations§
Source§impl Debug for ReplicationManager
impl Debug for ReplicationManager
Source§impl Default for ReplicationManager
impl Default for ReplicationManager
Source§fn default() -> ReplicationManager
fn default() -> ReplicationManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReplicationManager
impl RefUnwindSafe for ReplicationManager
impl Send for ReplicationManager
impl Sync for ReplicationManager
impl Unpin for ReplicationManager
impl UnsafeUnpin for ReplicationManager
impl UnwindSafe for ReplicationManager
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