@Internal public class KafkaPartitionDiscoverer extends AbstractPartitionDiscoverer
AbstractPartitionDiscoverer.ClosedException, AbstractPartitionDiscoverer.WakeupException| Constructor and Description |
|---|
KafkaPartitionDiscoverer(KafkaTopicsDescriptor topicsDescriptor,
int indexOfThisSubtask,
int numParallelSubtasks,
Properties kafkaProperties) |
| Modifier and Type | Method and Description |
|---|---|
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()
AbstractPartitionDiscovererinitializeConnections in class AbstractPartitionDiscovererprotected List<String> getAllTopics() throws AbstractPartitionDiscoverer.WakeupException
AbstractPartitionDiscoverergetAllTopics in class AbstractPartitionDiscovererAbstractPartitionDiscoverer.WakeupExceptionprotected List<KafkaTopicPartition> getAllPartitionsForTopics(List<String> topics) throws AbstractPartitionDiscoverer.WakeupException, RuntimeException
AbstractPartitionDiscoverergetAllPartitionsForTopics in class AbstractPartitionDiscovererAbstractPartitionDiscoverer.WakeupExceptionRuntimeExceptionprotected 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.
wakeupConnections in class AbstractPartitionDiscovererprotected void closeConnections()
throws Exception
AbstractPartitionDiscoverercloseConnections in class AbstractPartitionDiscovererExceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.