@Internal public class KafkaPartitionDiscoverer extends AbstractPartitionDiscoverer
AbstractPartitionDiscoverer.ClosedException, AbstractPartitionDiscoverer.WakeupException| 构造器和说明 |
|---|
KafkaPartitionDiscoverer(KafkaTopicsDescriptor topicsDescriptor,
int indexOfThisSubtask,
int numParallelSubtasks,
Properties kafkaProperties) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
closeConnections()
Close all established connections.
|
protected List<KafkaTopicPartition> |
getAllPartitionsForTopics(List<String> topics)
Fetch the list of all partitions for a specific topics list from Kafka.
|
protected List<String> |
getAllTopics()
Fetch the list of all topics from Kafka.
|
protected void |
initializeConnections()
Establish the required connections in order to fetch topics and partitions metadata.
|
protected void |
wakeupConnections()
Attempt to eagerly wakeup from blocking calls to Kafka in
AbstractPartitionDiscoverer.getAllTopics() and AbstractPartitionDiscoverer.getAllPartitionsForTopics(List). |
close, discoverPartitions, open, setAndCheckDiscoveredPartition, wakeuppublic KafkaPartitionDiscoverer(KafkaTopicsDescriptor topicsDescriptor, int indexOfThisSubtask, int numParallelSubtasks, Properties kafkaProperties)
protected void initializeConnections()
AbstractPartitionDiscovererprotected List<String> getAllTopics() throws AbstractPartitionDiscoverer.WakeupException
AbstractPartitionDiscovererprotected List<KafkaTopicPartition> getAllPartitionsForTopics(List<String> topics) throws AbstractPartitionDiscoverer.WakeupException, RuntimeException
AbstractPartitionDiscovererprotected void wakeupConnections()
AbstractPartitionDiscovererAbstractPartitionDiscoverer.getAllTopics() and AbstractPartitionDiscoverer.getAllPartitionsForTopics(List).
If the invocation indeed results in interrupting an actual blocking Kafka call, the
implementations of AbstractPartitionDiscoverer.getAllTopics() and AbstractPartitionDiscoverer.getAllPartitionsForTopics(List) are responsible of throwing a
AbstractPartitionDiscoverer.WakeupException.
protected void closeConnections()
throws Exception
AbstractPartitionDiscoverercloseConnections 在类中 AbstractPartitionDiscovererExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.