Skip to content

Commit

Permalink
filter no leader
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochen-zhou committed Dec 17, 2024
1 parent a139595 commit d188f6e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,13 @@ private Set<KafkaSourceSplit> getTopicInfo() throws ExecutionException, Interrup
}
log.info("Discovered topics: {}", topics);
Collection<TopicPartition> partitions =
adminClient.describeTopics(topics).all().get().values().stream()
adminClient.describeTopics(topics).allTopicNames().get().values().stream()
.flatMap(
t ->
t.partitions().stream()
.filter(
partitionInfo ->
partitionInfo.leader() != null)
.map(
p ->
new TopicPartition(
Expand Down

0 comments on commit d188f6e

Please sign in to comment.