T
- The type of elements produced by the fetcher.public class Kafka08Fetcher<T> extends AbstractFetcher<T,kafka.common.TopicAndPartition>
useMetrics
Constructor and Description |
---|
Kafka08Fetcher(SourceFunction.SourceContext<T> sourceContext,
List<KafkaTopicPartition> assignedPartitions,
SerializedValue<AssignerWithPeriodicWatermarks<T>> watermarksPeriodic,
SerializedValue<AssignerWithPunctuatedWatermarks<T>> watermarksPunctuated,
StreamingRuntimeContext runtimeContext,
KeyedDeserializationSchema<T> deserializer,
Properties kafkaProperties,
long invalidOffsetBehavior,
long autoCommitInterval,
boolean useMetrics) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
commitSpecificOffsetsToKafka(Map<KafkaTopicPartition,Long> offsets)
Commits the given partition offsets to the Kafka brokers (or to ZooKeeper for
older Kafka versions).
|
kafka.common.TopicAndPartition |
createKafkaPartitionHandle(KafkaTopicPartition partition)
Creates the Kafka version specific representation of the given
topic partition.
|
void |
runFetchLoop() |
addOffsetStateGauge, emitRecord, restoreOffsets, snapshotCurrentState, subscribedPartitions
public Kafka08Fetcher(SourceFunction.SourceContext<T> sourceContext, List<KafkaTopicPartition> assignedPartitions, SerializedValue<AssignerWithPeriodicWatermarks<T>> watermarksPeriodic, SerializedValue<AssignerWithPunctuatedWatermarks<T>> watermarksPunctuated, StreamingRuntimeContext runtimeContext, KeyedDeserializationSchema<T> deserializer, Properties kafkaProperties, long invalidOffsetBehavior, long autoCommitInterval, boolean useMetrics) throws Exception
Exception
public void runFetchLoop() throws Exception
runFetchLoop
in class AbstractFetcher<T,kafka.common.TopicAndPartition>
Exception
public void cancel()
cancel
in class AbstractFetcher<T,kafka.common.TopicAndPartition>
public kafka.common.TopicAndPartition createKafkaPartitionHandle(KafkaTopicPartition partition)
AbstractFetcher
createKafkaPartitionHandle
in class AbstractFetcher<T,kafka.common.TopicAndPartition>
partition
- The Flink representation of the Kafka topic partition.public void commitSpecificOffsetsToKafka(Map<KafkaTopicPartition,Long> offsets) throws Exception
AbstractFetcher
commitSpecificOffsetsToKafka
in class AbstractFetcher<T,kafka.common.TopicAndPartition>
offsets
- The offsets to commit to Kafka.Exception
- This method forwards exceptions.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.