T
- The type of elements produced by the fetcher.public class Kafka09Fetcher<T> extends AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
checkpointLock, NO_TIMESTAMPS_WATERMARKS, PERIODIC_WATERMARKS, PUNCTUATED_WATERMARKS, sourceContext, timestampWatermarkMode, unassignedPartitionsQueue
Constructor and Description |
---|
Kafka09Fetcher(SourceFunction.SourceContext<T> sourceContext,
Map<KafkaTopicPartition,Long> assignedPartitionsWithInitialOffsets,
SerializedValue<AssignerWithPeriodicWatermarks<T>> watermarksPeriodic,
SerializedValue<AssignerWithPunctuatedWatermarks<T>> watermarksPunctuated,
ProcessingTimeService processingTimeProvider,
long autoWatermarkInterval,
ClassLoader userCodeClassLoader,
String taskNameWithSubtasks,
KeyedDeserializationSchema<T> deserializer,
Properties kafkaProperties,
long pollTimeout,
MetricGroup subtaskMetricGroup,
MetricGroup consumerMetricGroup,
boolean useMetrics) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
protected KafkaConsumerCallBridge |
createCallBridge() |
org.apache.kafka.common.TopicPartition |
createKafkaPartitionHandle(KafkaTopicPartition partition)
Creates the Kafka version specific representation of the given
topic partition.
|
protected void |
doCommitInternalOffsetsToKafka(Map<KafkaTopicPartition,Long> offsets,
KafkaCommitCallback commitCallback) |
protected void |
emitRecord(T record,
KafkaTopicPartitionState<org.apache.kafka.common.TopicPartition> partition,
long offset,
org.apache.kafka.clients.consumer.ConsumerRecord<?,?> consumerRecord) |
protected String |
getFetcherName()
Gets the name of this fetcher, for thread naming and logging purposes.
|
void |
runFetchLoop() |
addDiscoveredPartitions, commitInternalOffsetsToKafka, emitRecord, emitRecordWithTimestamp, emitRecordWithTimestampAndPeriodicWatermark, emitRecordWithTimestampAndPunctuatedWatermark, snapshotCurrentState, subscribedPartitionStates
public Kafka09Fetcher(SourceFunction.SourceContext<T> sourceContext, Map<KafkaTopicPartition,Long> assignedPartitionsWithInitialOffsets, SerializedValue<AssignerWithPeriodicWatermarks<T>> watermarksPeriodic, SerializedValue<AssignerWithPunctuatedWatermarks<T>> watermarksPunctuated, ProcessingTimeService processingTimeProvider, long autoWatermarkInterval, ClassLoader userCodeClassLoader, String taskNameWithSubtasks, KeyedDeserializationSchema<T> deserializer, Properties kafkaProperties, long pollTimeout, MetricGroup subtaskMetricGroup, MetricGroup consumerMetricGroup, boolean useMetrics) throws Exception
Exception
public void runFetchLoop() throws Exception
runFetchLoop
in class AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
Exception
public void cancel()
cancel
in class AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
protected void emitRecord(T record, KafkaTopicPartitionState<org.apache.kafka.common.TopicPartition> partition, long offset, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> consumerRecord) throws Exception
Exception
protected String getFetcherName()
protected KafkaConsumerCallBridge createCallBridge()
public org.apache.kafka.common.TopicPartition createKafkaPartitionHandle(KafkaTopicPartition partition)
AbstractFetcher
createKafkaPartitionHandle
in class AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
partition
- The Flink representation of the Kafka topic partition.protected void doCommitInternalOffsetsToKafka(Map<KafkaTopicPartition,Long> offsets, @Nonnull KafkaCommitCallback commitCallback) throws Exception
doCommitInternalOffsetsToKafka
in class AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
Exception
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.