Interface KafkaContextAware<T>
-
- All Known Implementing Classes:
KafkaSerializationSchemaWrapper
@PublicEvolving @Deprecated public interface KafkaContextAware<T>
Deprecated.Will be turned into internal API whenFlinkKafkaProduceris removed.An interface forKafkaSerializationSchemasthat 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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StringgetTargetTopic(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 Detail
-
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
String getTargetTopic(T element)
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[]).
-
-