Interface KafkaRecordSerializationSchema.KafkaSinkContext
- All Known Implementing Classes:
DefaultKafkaSinkContext
- Enclosing interface:
KafkaRecordSerializationSchema<T>
@Internal
public static interface KafkaRecordSerializationSchema.KafkaSinkContext
Context providing information of the kafka record target location.
-
Method Summary
Modifier and TypeMethodDescriptionintintGet the ID of the subtask the KafkaSink is running on.int[]getPartitionsForTopic(String topic) For a given topic id retrieve the available partitions.
-
Method Details
-
getParallelInstanceId
int getParallelInstanceId()Get the ID of the subtask the KafkaSink is running on. The numbering starts from 0 and goes up to parallelism-1. (parallelism as returned bygetNumberOfParallelInstances()- Returns:
- ID of subtask
-
getNumberOfParallelInstances
int getNumberOfParallelInstances()- Returns:
- number of parallel KafkaSink tasks.
-
getPartitionsForTopic
For a given topic id retrieve the available partitions.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.
- Parameters:
topic- kafka topic with partitions- Returns:
- the ids of the currently available partitions
-