@PublicEvolving public class Kafka010AvroTableSource extends KafkaAvroTableSource
StreamTableSource
for Kafka 0.10.Modifier and Type | Class and Description |
---|---|
static class |
Kafka010AvroTableSource.Builder
A builder to configure and create a
Kafka010AvroTableSource . |
Constructor and Description |
---|
Kafka010AvroTableSource(String topic,
Properties properties,
org.apache.flink.table.api.TableSchema schema,
Class<? extends org.apache.avro.specific.SpecificRecordBase> record)
Creates a Kafka 0.10 Avro
StreamTableSource using a given SpecificRecord . |
Modifier and Type | Method and Description |
---|---|
static Kafka010AvroTableSource.Builder |
builder()
Returns a builder to configure and create a
Kafka010AvroTableSource . |
protected FlinkKafkaConsumerBase<Row> |
createKafkaConsumer(String topic,
Properties properties,
DeserializationSchema<Row> deserializationSchema)
Creates a version-specific Kafka consumer.
|
void |
setFieldMapping(Map<String,String> fieldMapping)
Sets a mapping from schema fields to fields of the produced Avro record.
|
void |
setProctimeAttribute(String proctimeAttribute)
Declares a field of the schema to be a processing time attribute.
|
void |
setRowtimeAttributeDescriptor(org.apache.flink.table.sources.RowtimeAttributeDescriptor rowtimeAttributeDescriptor)
Declares a field of the schema to be a rowtime attribute.
|
explainSource, getDeserializationSchema, getFieldMapping
equals, getDataStream, getKafkaConsumer, getProctimeAttribute, getReturnType, getRowtimeAttributeDescriptors, getTableSchema, hashCode, setRowtimeAttributeDescriptors, setSpecificStartupOffsets, setStartupMode
public Kafka010AvroTableSource(String topic, Properties properties, org.apache.flink.table.api.TableSchema schema, Class<? extends org.apache.avro.specific.SpecificRecordBase> record)
StreamTableSource
using a given SpecificRecord
.topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.schema
- Schema of the produced table.record
- Avro specific record.public void setFieldMapping(Map<String,String> fieldMapping)
A field mapping is required if the fields of produced tables should be named different than the fields of the Avro record. The key of the provided Map refers to the field of the table schema, the value to the field of the Avro record.
setFieldMapping
in class KafkaAvroTableSource
fieldMapping
- A mapping from schema fields to Avro fields.public void setProctimeAttribute(String proctimeAttribute)
setProctimeAttribute
in class KafkaTableSource
proctimeAttribute
- The name of the field that becomes the processing time field.public void setRowtimeAttributeDescriptor(org.apache.flink.table.sources.RowtimeAttributeDescriptor rowtimeAttributeDescriptor)
rowtimeAttributeDescriptor
- The descriptor of the rowtime attribute.protected FlinkKafkaConsumerBase<Row> createKafkaConsumer(String topic, Properties properties, DeserializationSchema<Row> deserializationSchema)
KafkaTableSource
createKafkaConsumer
in class KafkaTableSource
topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.deserializationSchema
- Deserialization schema to use for Kafka records.public static Kafka010AvroTableSource.Builder builder()
Kafka010AvroTableSource
.Kafka010AvroTableSource
.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.