IN
- Type of the messages to write into Kafka.public class FlinkKafkaProducer08<IN> extends FlinkKafkaProducerBase<IN>
asyncException, callback, defaultTopicId, flushOnCheckpoint, KEY_DISABLE_METRICS, logFailuresOnly, partitioner, partitions, pendingRecords, pendingRecordsLock, producer, producerConfig, schema, stateStore
Constructor and Description |
---|
FlinkKafkaProducer08(String topicId,
KeyedSerializationSchema<IN> serializationSchema,
Properties producerConfig)
Creates a FlinkKafkaProducer for a given topic.
|
FlinkKafkaProducer08(String topicId,
KeyedSerializationSchema<IN> serializationSchema,
Properties producerConfig,
KafkaPartitioner<IN> customPartitioner)
The main constructor for creating a FlinkKafkaProducer.
|
FlinkKafkaProducer08(String topicId,
SerializationSchema<IN> serializationSchema,
Properties producerConfig)
Creates a FlinkKafkaProducer for a given topic.
|
FlinkKafkaProducer08(String topicId,
SerializationSchema<IN> serializationSchema,
Properties producerConfig,
KafkaPartitioner<IN> customPartitioner)
The main constructor for creating a FlinkKafkaProducer.
|
FlinkKafkaProducer08(String brokerList,
String topicId,
KeyedSerializationSchema<IN> serializationSchema)
Creates a FlinkKafkaProducer for a given topic.
|
FlinkKafkaProducer08(String brokerList,
String topicId,
SerializationSchema<IN> serializationSchema)
Creates a FlinkKafkaProducer for a given topic.
|
Modifier and Type | Method and Description |
---|---|
protected void |
flush()
Flush pending records.
|
checkErroneous, close, getKafkaProducer, getPropertiesFromBrokerList, initializeState, invoke, numPendingRecords, open, setFlushOnCheckpoint, setLogFailuresOnly, snapshotState
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public FlinkKafkaProducer08(String brokerList, String topicId, SerializationSchema<IN> serializationSchema)
brokerList
- Comma separated addresses of the brokerstopicId
- ID of the Kafka topic.serializationSchema
- User defined (keyless) serialization schema.public FlinkKafkaProducer08(String topicId, SerializationSchema<IN> serializationSchema, Properties producerConfig)
topicId
- ID of the Kafka topic.serializationSchema
- User defined (keyless) serialization schema.producerConfig
- Properties with the producer configuration.public FlinkKafkaProducer08(String topicId, SerializationSchema<IN> serializationSchema, Properties producerConfig, KafkaPartitioner<IN> customPartitioner)
topicId
- The topic to write data toserializationSchema
- A (keyless) serializable serialization schema for turning user objects into a kafka-consumable byte[]producerConfig
- Configuration properties for the KafkaProducer. 'bootstrap.servers.' is the only required argument.customPartitioner
- A serializable partitioner for assining messages to Kafka partitions.public FlinkKafkaProducer08(String brokerList, String topicId, KeyedSerializationSchema<IN> serializationSchema)
brokerList
- Comma separated addresses of the brokerstopicId
- ID of the Kafka topic.serializationSchema
- User defined serialization schema supporting key/value messagespublic FlinkKafkaProducer08(String topicId, KeyedSerializationSchema<IN> serializationSchema, Properties producerConfig)
topicId
- ID of the Kafka topic.serializationSchema
- User defined serialization schema supporting key/value messagesproducerConfig
- Properties with the producer configuration.public FlinkKafkaProducer08(String topicId, KeyedSerializationSchema<IN> serializationSchema, Properties producerConfig, KafkaPartitioner<IN> customPartitioner)
topicId
- The topic to write data toserializationSchema
- A serializable serialization schema for turning user objects into a kafka-consumable byte[] supporting key/value messagesproducerConfig
- Configuration properties for the KafkaProducer. 'bootstrap.servers.' is the only required argument.customPartitioner
- A serializable partitioner for assining messages to Kafka partitions.protected void flush()
FlinkKafkaProducerBase
flush
in class FlinkKafkaProducerBase<IN>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.