Trait paxakos::autofill::Config [−][src]
pub trait Config {
type Node: Node;
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static;
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>;
fn batch_size(&self) -> usize;
fn delay(&self) -> Duration;
fn new_filler(&self) -> Self::Applicable;
fn retry_policy(&self) -> Self::RetryPolicy;
fn init(&mut self, node: &Self::Node) { ... }
fn update(&mut self, event: &EventFor<Self::Node>) { ... }
}
Expand description
Autofill configuration.
Associated Types
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static
The applicable that is used to fill gaps, usually a no-op.
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>
Type of retry policy to be used.
See retry_policy
.
Required methods
fn batch_size(&self) -> usize
fn batch_size(&self) -> usize
The number of gap rounds that may be filled concurrently.
fn new_filler(&self) -> Self::Applicable
fn new_filler(&self) -> Self::Applicable
Creates a new filler value.
fn retry_policy(&self) -> Self::RetryPolicy
fn retry_policy(&self) -> Self::RetryPolicy
Creates a retry policy.
Please note that a node that’s fallen too far behind may fail to catch
up using the gap filling approach. This is because other nodes may
respond with Conflict::Converged
without
providing a log entry. In these cases, the node must ask another node
for a recent snapshot and install it. To detect such cases, one may use
a retry policy that checks for AppendError::Converged
and whether
the node could be caught_up
.