Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ private[kafka010] sealed trait ConsumerStrategy extends Logging {
.build()

protected def retrieveAllPartitions(admin: Admin, topics: Set[String]): Set[TopicPartition] = {
admin.describeTopics(topics.asJava).all().get().asScala.filterNot(_._2.isInternal).flatMap {
case (topic, topicDescription) =>
topicDescription.partitions().asScala.map { topicPartitionInfo =>
val partition = topicPartitionInfo.partition()
logDebug(s"Partition found: $topic:$partition")
new TopicPartition(topic, partition)
}
}.toSet
admin.describeTopics(topics.asJava).allTopicNames().get().asScala.filterNot(_._2.isInternal)
.flatMap {
case (topic, topicDescription) =>
topicDescription.partitions().asScala.map { topicPartitionInfo =>
val partition = topicPartitionInfo.partition()
logDebug(s"Partition found: $topic:$partition")
new TopicPartition(topic, partition)
}
}.toSet
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class KafkaTestUtils(
}

private def getOffsets(topics: Set[String], offsetSpec: OffsetSpec): Map[TopicPartition, Long] = {
val listOffsetsParams = adminClient.describeTopics(topics.asJava).all().get().asScala
val listOffsetsParams = adminClient.describeTopics(topics.asJava).allTopicNames().get().asScala
.flatMap { topicDescription =>
topicDescription._2.partitions().asScala.map { topicPartitionInfo =>
new TopicPartition(topicDescription._1, topicPartitionInfo.partition())
Expand Down