pub struct BatchPartitioner { /* private fields */ }
Expand description
A utility that can be used to partition batches based on Partitioning
Implementations§
Source§impl BatchPartitioner
impl BatchPartitioner
Sourcepub fn try_new(partitioning: Partitioning, timer: Time) -> Result<Self>
pub fn try_new(partitioning: Partitioning, timer: Time) -> Result<Self>
Create a new BatchPartitioner
with the provided Partitioning
The time spent repartitioning will be recorded to timer
Sourcepub fn partition<F>(&mut self, batch: RecordBatch, f: F) -> Result<()>
pub fn partition<F>(&mut self, batch: RecordBatch, f: F) -> Result<()>
Partition the provided RecordBatch
into one or more partitioned RecordBatch
based on the Partitioning
specified on construction
f
will be called for each partitioned RecordBatch
with the corresponding
partition index. Any error returned by f
will be immediately returned by this
function without attempting to publish further RecordBatch
The time spent repartitioning, not including time spent in f
will be recorded
to the metrics::Time
provided on construction
Auto Trait Implementations§
impl Freeze for BatchPartitioner
impl !RefUnwindSafe for BatchPartitioner
impl Send for BatchPartitioner
impl Sync for BatchPartitioner
impl Unpin for BatchPartitioner
impl !UnwindSafe for BatchPartitioner
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> 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>
Converts
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>
Converts
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