Interface KafkaRecordSerializationSchema.KafkaSinkContext

    • 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 by getNumberOfParallelInstances()
        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