public class Kafka011JsonTableSource extends KafkaJsonTableSource
StreamTableSource
for Kafka 0.11.Modifier and Type | Class and Description |
---|---|
static class |
Kafka011JsonTableSource.Builder
A builder to configure and create a
Kafka011JsonTableSource . |
Constructor and Description |
---|
Kafka011JsonTableSource(String topic,
Properties properties,
org.apache.flink.table.api.TableSchema tableSchema,
org.apache.flink.table.api.TableSchema jsonSchema)
Creates a Kafka 0.11 JSON
StreamTableSource . |
Modifier and Type | Method and Description |
---|---|
static Kafka011JsonTableSource.Builder |
builder()
Returns a builder to configure and create a
Kafka011JsonTableSource . |
protected FlinkKafkaConsumerBase<Row> |
createKafkaConsumer(String topic,
Properties properties,
DeserializationSchema<Row> deserializationSchema)
Creates a version-specific Kafka consumer.
|
void |
setFailOnMissingField(boolean failOnMissingField)
Sets the flag that specifies the behavior in case of missing fields.
|
void |
setFieldMapping(Map<String,String> fieldMapping)
Sets the mapping from table schema fields to JSON schema fields.
|
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
getDataStream, getKafkaConsumer, getProctimeAttribute, getReturnType, getRowtimeAttributeDescriptors, getTableSchema, setRowtimeAttributeDescriptors, setSpecificStartupOffsets, setStartupMode
public Kafka011JsonTableSource(String topic, Properties properties, org.apache.flink.table.api.TableSchema tableSchema, org.apache.flink.table.api.TableSchema jsonSchema)
StreamTableSource
.topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.tableSchema
- The schema of the table.jsonSchema
- The schema of the JSON messages to decode from Kafka.public void setFailOnMissingField(boolean failOnMissingField)
setFailOnMissingField
in class KafkaJsonTableSource
failOnMissingField
- Flag that specifies the TableSource behavior in case of missing fields.public void setFieldMapping(Map<String,String> fieldMapping)
setFieldMapping
in class KafkaJsonTableSource
fieldMapping
- The mapping from table schema fields to JSON schema 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 Kafka011JsonTableSource.Builder builder()
Kafka011JsonTableSource
.Kafka011JsonTableSource
.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.