Interface KafkaContextAware<T>
- All Known Implementing Classes:
KafkaSerializationSchemaWrapper
Deprecated.
An interface for
KafkaSerializationSchemas that need information
about the context where the Kafka Producer is running along with information about the available
partitions.
You only need to override the methods for the information that you need. However, getTargetTopic(Object) is required because it is used to determine the available partitions.
-
Method Summary
Modifier and TypeMethodDescriptiongetTargetTopic(T element) Deprecated.Returns the topic that the presented element should be sent to.default voidsetNumParallelInstances(int numParallelInstances) Deprecated.Sets the parallelism with which the parallel task of the Kafka Producer runs.default voidsetParallelInstanceId(int parallelInstanceId) Deprecated.Sets the number of the parallel subtask that the Kafka Producer is running on.default voidsetPartitions(int[] partitions) Deprecated.Sets the available partitions for the topic returned fromgetTargetTopic(Object).
-
Method Details
-
setParallelInstanceId
default void setParallelInstanceId(int parallelInstanceId) Deprecated.Sets the number of the parallel subtask that the Kafka Producer is running on. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned bysetNumParallelInstances(int)). -
setNumParallelInstances
default void setNumParallelInstances(int numParallelInstances) Deprecated.Sets the parallelism with which the parallel task of the Kafka Producer runs. -
setPartitions
default void setPartitions(int[] partitions) Deprecated.Sets the available partitions for the topic returned fromgetTargetTopic(Object). -
getTargetTopic
Deprecated.Returns the topic that the presented element should be sent to. This is not used for setting the topic (this is done via theProducerRecordthat is returned fromKafkaSerializationSchema.serialize(Object, Long), it is only used for getting the available partitions that are presented tosetPartitions(int[]).
-
FlinkKafkaProduceris removed.