public class DefaultKafkaSinkContext extends Object implements KafkaRecordSerializationSchema.KafkaSinkContext
ProducerRecord.| 构造器和说明 |
|---|
DefaultKafkaSinkContext(int subtaskId,
int numberOfParallelInstances,
Properties kafkaProducerConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.getNumberOfParallelInstances()getParallelInstanceId 在接口中 KafkaRecordSerializationSchema.KafkaSinkContextpublic int getNumberOfParallelInstances()
getNumberOfParallelInstances 在接口中 KafkaRecordSerializationSchema.KafkaSinkContextpublic int[] getPartitionsForTopic(String topic)
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 在接口中 KafkaRecordSerializationSchema.KafkaSinkContexttopic - kafka topic with partitionsCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.