Struct re_chunk::batcher::ChunkBatcherConfig
source · pub struct ChunkBatcherConfig {
pub flush_tick: Duration,
pub flush_num_bytes: u64,
pub flush_num_rows: u64,
pub chunk_max_rows_if_unsorted: u64,
pub max_commands_in_flight: Option<u64>,
pub max_chunks_in_flight: Option<u64>,
pub hooks: BatcherHooks,
}
Expand description
Defines the different thresholds of the associated ChunkBatcher
.
See Self::default
and Self::from_env
.
Fields§
§flush_tick: Duration
Duration of the periodic tick.
flush_num_bytes: u64
Flush if the accumulated payload has a size in bytes equal or greater than this.
The resulting Chunk
might be larger than flush_num_bytes
!
flush_num_rows: u64
Flush if the accumulated payload has a number of rows equal or greater than this.
chunk_max_rows_if_unsorted: u64
Split a chunk if it contains >= rows than this threshold and one or more of its timelines are unsorted.
max_commands_in_flight: Option<u64>
Size of the internal channel of commands.
Unbounded if left unspecified.
max_chunks_in_flight: Option<u64>
Size of the internal channel of Chunk
s.
Unbounded if left unspecified.
hooks: BatcherHooks
Callbacks you can install on the ChunkBatcher
.
Implementations§
source§impl ChunkBatcherConfig
impl ChunkBatcherConfig
sourcepub const NEVER: Self = _
pub const NEVER: Self = _
Never flushes unless manually told to (or hitting one the builtin invariants).
sourcepub const ENV_FLUSH_TICK: &'static str = "RERUN_FLUSH_TICK_SECS"
pub const ENV_FLUSH_TICK: &'static str = "RERUN_FLUSH_TICK_SECS"
Environment variable to configure Self::flush_tick
.
sourcepub const ENV_FLUSH_NUM_BYTES: &'static str = "RERUN_FLUSH_NUM_BYTES"
pub const ENV_FLUSH_NUM_BYTES: &'static str = "RERUN_FLUSH_NUM_BYTES"
Environment variable to configure Self::flush_num_bytes
.
sourcepub const ENV_FLUSH_NUM_ROWS: &'static str = "RERUN_FLUSH_NUM_ROWS"
pub const ENV_FLUSH_NUM_ROWS: &'static str = "RERUN_FLUSH_NUM_ROWS"
Environment variable to configure Self::flush_num_rows
.
sourcepub const ENV_CHUNK_MAX_ROWS_IF_UNSORTED: &'static str = "RERUN_CHUNK_MAX_ROWS_IF_UNSORTED"
pub const ENV_CHUNK_MAX_ROWS_IF_UNSORTED: &'static str = "RERUN_CHUNK_MAX_ROWS_IF_UNSORTED"
Environment variable to configure Self::chunk_max_rows_if_unsorted
.
sourceconst ENV_MAX_CHUNK_ROWS_IF_UNSORTED: &'static str = "RERUN_MAX_CHUNK_ROWS_IF_UNSORTED"
👎Deprecated: use RERUN_CHUNK_MAX_ROWS_IF_UNSORTED
instead
const ENV_MAX_CHUNK_ROWS_IF_UNSORTED: &'static str = "RERUN_MAX_CHUNK_ROWS_IF_UNSORTED"
RERUN_CHUNK_MAX_ROWS_IF_UNSORTED
insteadEnvironment variable to configure Self::chunk_max_rows_if_unsorted
.
sourcepub fn from_env() -> ChunkBatcherResult<Self>
pub fn from_env() -> ChunkBatcherResult<Self>
Creates a new ChunkBatcherConfig
using the default values, optionally overridden
through the environment.
See Self::apply_env
.
sourcepub fn apply_env(&self) -> ChunkBatcherResult<Self>
pub fn apply_env(&self) -> ChunkBatcherResult<Self>
Returns a copy of self
, overriding existing fields with values from the environment if
they are present.
See Self::ENV_FLUSH_TICK
, Self::ENV_FLUSH_NUM_BYTES
, Self::ENV_FLUSH_NUM_BYTES
.
Trait Implementations§
source§impl Clone for ChunkBatcherConfig
impl Clone for ChunkBatcherConfig
source§fn clone(&self) -> ChunkBatcherConfig
fn clone(&self) -> ChunkBatcherConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChunkBatcherConfig
impl Debug for ChunkBatcherConfig
source§impl Default for ChunkBatcherConfig
impl Default for ChunkBatcherConfig
source§impl PartialEq for ChunkBatcherConfig
impl PartialEq for ChunkBatcherConfig
source§fn eq(&self, other: &ChunkBatcherConfig) -> bool
fn eq(&self, other: &ChunkBatcherConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ChunkBatcherConfig
Auto Trait Implementations§
impl Freeze for ChunkBatcherConfig
impl !RefUnwindSafe for ChunkBatcherConfig
impl Send for ChunkBatcherConfig
impl Sync for ChunkBatcherConfig
impl Unpin for ChunkBatcherConfig
impl !UnwindSafe for ChunkBatcherConfig
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more