public class DefaultKafkaSinkContext extends Object implements KafkaRecordSerializationSchema.KafkaSinkContext
ProducerRecord.| Constructor and Description |
|---|
DefaultKafkaSinkContext(int subtaskId,
int numberOfParallelInstances,
Properties kafkaProducerConfig) |
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfParallelInstances() |
int |
getParallelInstanceId()
Get the ID of the subtask the KafkaSink is running on.
|
int[] |
getPartitionsForTopic(String topic)
For a given topic id retrieve the available partitions.
|
public DefaultKafkaSinkContext(int subtaskId,
int numberOfParallelInstances,
Properties kafkaProducerConfig)
public int getParallelInstanceId()
KafkaRecordSerializationSchema.KafkaSinkContextKafkaRecordSerializationSchema.KafkaSinkContext.getNumberOfParallelInstances()getParallelInstanceId in interface KafkaRecordSerializationSchema.KafkaSinkContextpublic int getNumberOfParallelInstances()
getNumberOfParallelInstances in interface KafkaRecordSerializationSchema.KafkaSinkContextpublic int[] getPartitionsForTopic(String topic)
KafkaRecordSerializationSchema.KafkaSinkContextAfter the first retrieval the returned partitions are cached. If the partitions are updated the job has to be restarted to make the change visible.
getPartitionsForTopic in interface KafkaRecordSerializationSchema.KafkaSinkContexttopic - kafka topic with partitionsCopyright © 2022–2024 The Apache Software Foundation. All rights reserved.