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.KafkaSinkContext
KafkaRecordSerializationSchema.KafkaSinkContext.getNumberOfParallelInstances()
getParallelInstanceId
in interface KafkaRecordSerializationSchema.KafkaSinkContext
public int getNumberOfParallelInstances()
getNumberOfParallelInstances
in interface KafkaRecordSerializationSchema.KafkaSinkContext
public int[] getPartitionsForTopic(String topic)
KafkaRecordSerializationSchema.KafkaSinkContext
After 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.KafkaSinkContext
topic
- kafka topic with partitionsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.