pub struct KafkaInputFormat { /* private fields */ }
Implementations§
Source§impl KafkaInputFormat
impl KafkaInputFormat
pub fn new( client_config: ClientConfig, topics: Vec<String>, buffer_size: usize, offset_range: OffsetRange, deserializer_builder: Box<dyn KafkaRecordDeserializerBuilder>, parallelism: u16, fn_name: String, ) -> Self
Trait Implementations§
Source§impl CheckpointFunction for KafkaInputFormat
impl CheckpointFunction for KafkaInputFormat
Source§fn snapshot_state(
&mut self,
context: &FunctionSnapshotContext,
) -> Option<CheckpointHandle>
fn snapshot_state( &mut self, context: &FunctionSnapshotContext, ) -> Option<CheckpointHandle>
trigger the method when the operator
operate a Barrier
event
Source§fn initialize_state(
&mut self,
context: &FunctionSnapshotContext,
handle: &Option<CheckpointHandle>,
)
fn initialize_state( &mut self, context: &FunctionSnapshotContext, handle: &Option<CheckpointHandle>, )
trigger the method when a
operator
initializationfn consult_version( &mut self, context: &FunctionSnapshotContext, _handle: &Option<CheckpointHandle>, ) -> CheckpointId
Source§impl InputFormat for KafkaInputFormat
impl InputFormat for KafkaInputFormat
Source§fn open(&mut self, input_split: InputSplit, context: &Context) -> Result<()>
fn open(&mut self, input_split: InputSplit, context: &Context) -> Result<()>
Initialization of
InputFormat
, Each task will be called once when it starts.Source§fn record_iter(&mut self) -> Box<dyn Iterator<Item = Record> + Send>
fn record_iter(&mut self) -> Box<dyn Iterator<Item = Record> + Send>
return an
Iterator
of Record
, if the next
of Iterator
is None
,
the task of InputFormat
will be Terminated
.
the function is called by element_iter
, a user-friendly function,
usually you just need to implement itfn close(&mut self) -> Result<()>
fn schema(&self, _input_schema: FnSchema) -> FnSchema
fn parallelism(&self) -> u16
Source§impl InputSplitSource for KafkaInputFormat
impl InputSplitSource for KafkaInputFormat
Source§fn create_input_splits(&self, min_num_splits: u16) -> Result<Vec<InputSplit>>
fn create_input_splits(&self, min_num_splits: u16) -> Result<Vec<InputSplit>>
Create InputSplits by system parallelism[
min_num_splits
] Read moreSource§fn input_split_assigner(
&self,
input_splits: Vec<InputSplit>,
) -> InputSplitAssigner
fn input_split_assigner( &self, input_splits: Vec<InputSplit>, ) -> InputSplitAssigner
Create InputSplitAssigner by InputSplits[‘input_splits’] Read more
Source§impl NamedFunction for KafkaInputFormat
impl NamedFunction for KafkaInputFormat
Auto Trait Implementations§
impl Freeze for KafkaInputFormat
impl !RefUnwindSafe for KafkaInputFormat
impl !Send for KafkaInputFormat
impl !Sync for KafkaInputFormat
impl Unpin for KafkaInputFormat
impl !UnwindSafe for KafkaInputFormat
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> 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