Interface KafkaSerializationSchema<T>
-
- Type Parameters:
T- the type of values being serialized
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
KafkaSerializationSchemaWrapper
@PublicEvolving public interface KafkaSerializationSchema<T> extends Serializable
AKafkaSerializationSchemadefines how to serialize values of typeTintoProducerRecords.Please also implement
KafkaContextAwareif 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidopen(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context)Initialization method for the schema.org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>serialize(T element, Long timestamp)Serializes given element and returns it as aProducerRecord.
-
-
-
Method Detail
-
open
default void open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context) throws ExceptionInitialization 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
-
-