in pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/admin/PulsarKafkaAdminClient.java [98:114]
private boolean isPartitionedTopic(String topic) {
Boolean res = partitionedTopics.computeIfAbsent(topic, t -> {
try {
int numPartitions = admin.topics()
.getPartitionedTopicMetadata(t)
.partitions;
return numPartitions > 0;
} catch (PulsarAdminException e) {
log.error("getPartitionedTopicMetadata failed", e);
return null;
}
});
if (res == null) {
throw new RuntimeException("Could not get topic metadata");
}
return res;
}