public class Kafka09JsonTableSink extends KafkaJsonTableSink
KafkaTableSink
that serializes data in JSON format.fieldNames, fieldTypes, partitioner, properties, serializationSchema, topic
Constructor and Description |
---|
Kafka09JsonTableSink(String topic,
Properties properties)
Creates
KafkaTableSink to write table rows as JSON-encoded records to a Kafka 0.9
topic with fixed partition assignment. |
Kafka09JsonTableSink(String topic,
Properties properties,
FlinkKafkaPartitioner<Row> partitioner)
Creates
KafkaTableSink to write table rows as JSON-encoded records to a Kafka 0.9
topic with custom partition assignment. |
Kafka09JsonTableSink(String topic,
Properties properties,
KafkaPartitioner<Row> partitioner)
Deprecated.
This is a deprecated constructor that does not correctly handle partitioning when
producing to multiple topics. Use
Kafka09JsonTableSink(String, Properties, FlinkKafkaPartitioner) instead. |
Modifier and Type | Method and Description |
---|---|
protected Kafka09JsonTableSink |
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-specifid Kafka producer.
|
createSerializationSchema
configure, emitDataStream, getFieldNames, getFieldTypes, getOutputType
public Kafka09JsonTableSink(String topic, Properties properties)
KafkaTableSink
to write table rows as JSON-encoded records to a Kafka 0.9
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 Kafka09JsonTableSink(String topic, Properties properties, FlinkKafkaPartitioner<Row> partitioner)
KafkaTableSink
to write table rows as JSON-encoded records to a Kafka 0.9
topic with custom partition assignment.topic
- topic in Kafka to which table is writtenproperties
- properties to connect to Kafkapartitioner
- Kafka partitioner@Deprecated public Kafka09JsonTableSink(String topic, Properties properties, KafkaPartitioner<Row> partitioner)
Kafka09JsonTableSink(String, Properties, FlinkKafkaPartitioner)
instead.KafkaTableSink
to write table rows as JSON-encoded records to a Kafka 0.9
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 Kafka09JsonTableSink createCopy()
KafkaTableSink
createCopy
in class KafkaTableSink
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.