public class Kafka09AvroTableSource
extends org.apache.flink.streaming.connectors.kafka.KafkaAvroTableSource
StreamTableSource for Kafka 0.9.| Modifier and Type | Class and Description |
|---|---|
static class |
Kafka09AvroTableSource.Builder
A builder to configure and create a
Kafka09AvroTableSource. |
| Constructor and Description |
|---|
Kafka09AvroTableSource(String topic,
Properties properties,
org.apache.flink.table.api.TableSchema schema,
Class<? extends org.apache.avro.specific.SpecificRecordBase> record)
Creates a Kafka 0.9 Avro
StreamTableSource using a given SpecificRecord. |
| Modifier and Type | Method and Description |
|---|---|
static Kafka09AvroTableSource.Builder |
builder()
Returns a builder to configure and create a
Kafka09AvroTableSource. |
protected org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase<org.apache.flink.types.Row> |
createKafkaConsumer(String topic,
Properties properties,
org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row> deserializationSchema) |
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, getFieldMappingpublic Kafka09AvroTableSource(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 org.apache.flink.streaming.connectors.kafka.KafkaAvroTableSourcefieldMapping - A mapping from schema fields to Avro fields.public void setProctimeAttribute(String proctimeAttribute)
setProctimeAttribute in class org.apache.flink.streaming.connectors.kafka.KafkaTableSourceproctimeAttribute - 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 org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase<org.apache.flink.types.Row> createKafkaConsumer(String topic, Properties properties, org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row> deserializationSchema)
createKafkaConsumer in class org.apache.flink.streaming.connectors.kafka.KafkaTableSourcepublic static Kafka09AvroTableSource.Builder builder()
Kafka09AvroTableSource.Kafka09AvroTableSource.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.