T - The type of elements produced by the fetcher.@Internal public class KafkaFetcher<T> extends AbstractFetcher<T,org.apache.kafka.common.TopicPartition>
checkpointLock, sourceContext, unassignedPartitionsQueue, watermarkOutput| 构造器和说明 |
|---|
KafkaFetcher(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T> sourceContext,
Map<KafkaTopicPartition,Long> assignedPartitionsWithInitialOffsets,
org.apache.flink.util.SerializedValue<org.apache.flink.api.common.eventtime.WatermarkStrategy<T>> watermarkStrategy,
org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeProvider,
long autoWatermarkInterval,
ClassLoader userCodeClassLoader,
String taskNameWithSubtasks,
KafkaDeserializationSchema<T> deserializer,
Properties kafkaProperties,
long pollTimeout,
org.apache.flink.metrics.MetricGroup subtaskMetricGroup,
org.apache.flink.metrics.MetricGroup consumerMetricGroup,
boolean useMetrics) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
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 String |
getFetcherName()
Gets the name of this fetcher, for thread naming and logging purposes.
|
protected void |
partitionConsumerRecordsHandler(List<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> partitionRecords,
KafkaTopicPartitionState<T,org.apache.kafka.common.TopicPartition> partition) |
void |
runFetchLoop() |
addDiscoveredPartitions, commitInternalOffsetsToKafka, emitRecordsWithTimestamps, snapshotCurrentState, subscribedPartitionStatespublic KafkaFetcher(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T> sourceContext, Map<KafkaTopicPartition,Long> assignedPartitionsWithInitialOffsets, org.apache.flink.util.SerializedValue<org.apache.flink.api.common.eventtime.WatermarkStrategy<T>> watermarkStrategy, org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeProvider, long autoWatermarkInterval, ClassLoader userCodeClassLoader, String taskNameWithSubtasks, KafkaDeserializationSchema<T> deserializer, Properties kafkaProperties, long pollTimeout, org.apache.flink.metrics.MetricGroup subtaskMetricGroup, org.apache.flink.metrics.MetricGroup consumerMetricGroup, boolean useMetrics) throws Exception
Exceptionpublic void runFetchLoop()
throws Exception
runFetchLoop 在类中 AbstractFetcher<T,org.apache.kafka.common.TopicPartition>Exceptionpublic void cancel()
cancel 在类中 AbstractFetcher<T,org.apache.kafka.common.TopicPartition>protected String getFetcherName()
protected void partitionConsumerRecordsHandler(List<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> partitionRecords, KafkaTopicPartitionState<T,org.apache.kafka.common.TopicPartition> partition) throws Exception
Exceptionpublic org.apache.kafka.common.TopicPartition createKafkaPartitionHandle(KafkaTopicPartition partition)
AbstractFetchercreateKafkaPartitionHandle 在类中 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 在类中 AbstractFetcher<T,org.apache.kafka.common.TopicPartition>ExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.