Interface KafkaRecordSerializationSchema.KafkaSinkContext
-
- All Known Implementing Classes:
DefaultKafkaSinkContext
- Enclosing interface:
- KafkaRecordSerializationSchema<T>
@Internal public static interface KafkaRecordSerializationSchema.KafkaSinkContextContext providing information of the kafka record target location.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetNumberOfParallelInstances()intgetParallelInstanceId()Get the ID of the subtask the KafkaSink is running on.int[]getPartitionsForTopic(String topic)For a given topic id retrieve the available partitions.
-
-
-
Method Detail
-
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
int[] getPartitionsForTopic(String topic)
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
-
-