@PublicEvolving public class Kafka010JsonTableSink extends KafkaJsonTableSink
KafkaTableSink
that serializes data in JSON format.fieldNames, fieldTypes, partitioner, properties, serializationSchema, topic
Constructor and Description |
---|
Kafka010JsonTableSink(String topic,
Properties properties)
Creates
KafkaTableSink to write table rows as JSON-encoded records to a Kafka 0.10
topic with fixed partition assignment. |
Kafka010JsonTableSink(String topic,
Properties properties,
FlinkKafkaPartitioner<Row> partitioner)
Creates
KafkaTableSink to write table rows as JSON-encoded records to a Kafka 0.10
topic with custom partition assignment. |
Modifier and Type | Method and Description |
---|---|
protected Kafka010JsonTableSink |
createCopy()
Create a deep copy of this sink.
|
protected FlinkKafkaProducerBase<Row> |
createKafkaProducer(String topic,
Properties properties,
SerializationSchema<Row> serializationSchema,
FlinkKafkaPartitioner<Row> partitioner)
Returns the version-specific Kafka producer.
|
createSerializationSchema
configure, emitDataStream, getFieldNames, getFieldTypes, getOutputType
public Kafka010JsonTableSink(String topic, Properties properties)
KafkaTableSink
to write table rows as JSON-encoded records to a Kafka 0.10
topic with fixed partition assignment.
Each parallel TableSink instance will write its rows to a single Kafka partition.
topic
- topic in Kafka to which table is writtenproperties
- properties to connect to Kafkapublic Kafka010JsonTableSink(String topic, Properties properties, FlinkKafkaPartitioner<Row> partitioner)
KafkaTableSink
to write table rows as JSON-encoded records to a Kafka 0.10
topic with custom partition assignment.topic
- topic in Kafka to which table is writtenproperties
- properties to connect to Kafkapartitioner
- Kafka partitionerprotected FlinkKafkaProducerBase<Row> createKafkaProducer(String topic, Properties properties, SerializationSchema<Row> serializationSchema, FlinkKafkaPartitioner<Row> partitioner)
KafkaTableSink
createKafkaProducer
in class KafkaTableSink
topic
- Kafka topic to produce to.properties
- Properties for the Kafka producer.serializationSchema
- Serialization schema to use to create Kafka records.partitioner
- Partitioner to select Kafka partition.protected Kafka010JsonTableSink createCopy()
KafkaTableSink
createCopy
in class KafkaTableSink
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.