public abstract class KafkaAvroTableSource extends KafkaTableSource implements org.apache.flink.table.sources.DefinedFieldMapping
StreamTableSource
.
The version-specific Kafka consumers need to extend this class and
override KafkaTableSource.createKafkaConsumer(String, Properties, DeserializationSchema)
}.
Modifier and Type | Class and Description |
---|---|
protected static class |
KafkaAvroTableSource.Builder<T extends KafkaAvroTableSource,B extends KafkaAvroTableSource.Builder>
Abstract builder for a
KafkaAvroTableSource to be extended by builders of subclasses of
KafkaAvroTableSource. |
Modifier | Constructor and Description |
---|---|
protected |
KafkaAvroTableSource(String topic,
Properties properties,
org.apache.flink.table.api.TableSchema schema,
Class<? extends org.apache.avro.specific.SpecificRecordBase> avroRecordClass)
Creates a generic Kafka Avro
StreamTableSource using a given SpecificRecord . |
Modifier and Type | Method and Description |
---|---|
String |
explainSource() |
protected AvroRowDeserializationSchema |
getDeserializationSchema()
Returns the deserialization schema.
|
Map<String,String> |
getFieldMapping() |
protected void |
setFieldMapping(Map<String,String> fieldMapping)
Configures a field mapping for this TableSource.
|
createKafkaConsumer, getDataStream, getKafkaConsumer, getProctimeAttribute, getReturnType, getRowtimeAttributeDescriptors, getTableSchema, setProctimeAttribute, setRowtimeAttributeDescriptors, setSpecificStartupOffsets, setStartupMode
protected KafkaAvroTableSource(String topic, Properties properties, org.apache.flink.table.api.TableSchema schema, Class<? extends org.apache.avro.specific.SpecificRecordBase> avroRecordClass)
StreamTableSource
using a given SpecificRecord
.topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.schema
- Schema of the produced table.avroRecordClass
- Class of the Avro record that is read from the Kafka topic.public Map<String,String> getFieldMapping()
getFieldMapping
in interface org.apache.flink.table.sources.DefinedFieldMapping
public String explainSource()
explainSource
in interface org.apache.flink.table.sources.TableSource<Row>
protected AvroRowDeserializationSchema getDeserializationSchema()
KafkaTableSource
getDeserializationSchema
in class KafkaTableSource
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.