Interface KafkaSerializationSchema<T>
- Type Parameters:
T- the type of values being serialized
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
KafkaSerializationSchemaWrapper
Deprecated.
A
KafkaSerializationSchema defines how to serialize values of type T into ProducerRecords.
Please also implement KafkaContextAware if your serialization schema needs information
about the available partitions and the number of parallel subtasks along with the subtask ID on
which the Kafka Producer is running.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidopen(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context) Deprecated.Initialization method for the schema.org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]> Deprecated.Serializes given element and returns it as aProducerRecord.
-
Method Details
-
open
default void open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context) throws Exception Deprecated.Initialization method for the schema. It is called before the actual working methodsserialize(Object, Long)and thus suitable for one time setup work.The provided
SerializationSchema.InitializationContextcan be used to access additional features such as e.g. registering user metrics.- Parameters:
context- Contextual information that can be used during initialization.- Throws:
Exception
-
serialize
org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]> serialize(T element, @Nullable Long timestamp) Deprecated.Serializes given element and returns it as aProducerRecord.- Parameters:
element- element to be serializedtimestamp- timestamp (can be null)- Returns:
- Kafka
ProducerRecord
-
FlinkKafkaProduceris removed.