Interface KafkaSerializationSchema<T>
-
- Type Parameters:
T- the type of values being serialized
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
KafkaSerializationSchemaWrapper
@PublicEvolving @Deprecated public interface KafkaSerializationSchema<T> extends Serializable
Deprecated.Will be turned into internal API whenFlinkKafkaProduceris removed.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 Deprecated Methods Modifier and Type Method Description default voidopen(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context)Deprecated.Initialization method for the schema.org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>serialize(T element, Long timestamp)Deprecated.Serializes given element and returns it as aProducerRecord.
-
-
-
Method Detail
-
open
default void open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context) throws ExceptionDeprecated.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
-
-