OUT - Type of the messages on the topic.public class KafkaSource<OUT>
extends org.apache.flink.streaming.api.functions.source.ConnectorSource<OUT>
IMPORTANT: This source is not participating in the checkpointing procedure
and hence gives no form of processing guarantees.
Use the PersistentKafkaSource
for a fault tolerant source that provides "exactly once" processing guarantees when used with
checkpointing enabled.
| Constructor and Description |
|---|
KafkaSource(String zookeeperAddress,
String topicId,
org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema)
Creates a KafkaSource that consumes a topic.
|
KafkaSource(String zookeeperAddress,
String topicId,
org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema,
long zookeeperSyncTimeMillis)
Creates a KafkaSource that consumes a topic.
|
KafkaSource(String zookeeperAddress,
String topicId,
String groupId,
org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema,
long zookeeperSyncTimeMillis)
Creates a KafkaSource that consumes a topic.
|
KafkaSource(String zookeeperAddress,
String topicId,
String groupId,
org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema,
long zookeeperSyncTimeMillis,
Properties customProperties)
Creates a KafkaSource that consumes a topic.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
open(org.apache.flink.configuration.Configuration config) |
void |
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<OUT> ctx) |
getProducedTypepublic KafkaSource(String zookeeperAddress, String topicId, String groupId, org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema, long zookeeperSyncTimeMillis)
zookeeperAddress - Address of the Zookeeper host (with port number).topicId - ID of the Kafka topic.groupId - ID of the consumer group.deserializationSchema - User defined deserialization schema.zookeeperSyncTimeMillis - Synchronization time with zookeeper.public KafkaSource(String zookeeperAddress, String topicId, String groupId, org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema, long zookeeperSyncTimeMillis, Properties customProperties)
zookeeperAddress - Address of the Zookeeper host (with port number).topicId - ID of the Kafka topic.groupId - ID of the consumer group.deserializationSchema - User defined deserialization schema.zookeeperSyncTimeMillis - Synchronization time with zookeeper.customProperties - Custom properties for Kafkapublic KafkaSource(String zookeeperAddress, String topicId, org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema, long zookeeperSyncTimeMillis)
zookeeperAddress - Address of the Zookeeper host (with port number).topicId - ID of the Kafka topic.deserializationSchema - User defined deserialization schema.zookeeperSyncTimeMillis - Synchronization time with zookeeper.public KafkaSource(String zookeeperAddress, String topicId, org.apache.flink.streaming.util.serialization.DeserializationSchema<OUT> deserializationSchema)
zookeeperAddress - Address of the Zookeeper host (with port number).topicId - ID of the Kafka topic.deserializationSchema - User defined deserialization schema.public void run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<OUT> ctx) throws Exception
Exceptionpublic void open(org.apache.flink.configuration.Configuration config)
throws Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class org.apache.flink.api.common.functions.AbstractRichFunctionExceptionpublic void cancel()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.