pub struct BatchingConfig {
pub max_batch_size: usize,
}Expand description
Batching configuration for leader-side drain loops and buffer allocation.
A single value intentionally covers all drain loops because they all operate within the same heartbeat period and share the same order-of-magnitude concurrency:
raft.rscmd_rx drain (client propose ingestion)raft.rsrole_rx drain (commit index event coalescing)DefaultCommitHandlernew_commit_rx drain (state machine apply batching)
Also used as the initial Vec capacity for propose and linearizable-read buffers
(construction-time hint only; the propose buffer retains capacity across flushes
via mem::swap, while the read buffer resets each flush via mem::take).
§Tuning Guidelines
- Low latency priority: lower values → smaller batches, faster flush
- Throughput priority: higher values → larger batches, fewer RPCs
Fields§
§max_batch_size: usizeMaximum items to drain per heartbeat period across all drain loops.
Default: 100
Trait Implementations§
Source§impl Clone for BatchingConfig
impl Clone for BatchingConfig
Source§fn clone(&self) -> BatchingConfig
fn clone(&self) -> BatchingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatchingConfig
impl Debug for BatchingConfig
Source§impl Default for BatchingConfig
impl Default for BatchingConfig
Source§impl<'de> Deserialize<'de> for BatchingConfig
impl<'de> Deserialize<'de> for BatchingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BatchingConfig
impl RefUnwindSafe for BatchingConfig
impl Send for BatchingConfig
impl Sync for BatchingConfig
impl Unpin for BatchingConfig
impl UnsafeUnpin for BatchingConfig
impl UnwindSafe for BatchingConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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