rajinisivaram commented on a change in pull request #10371:
URL: https://github.com/apache/kafka/pull/10371#discussion_r598724102
##########
File path: core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
##########
@@ -708,30 +711,38 @@ object ConsumerGroupCommand extends Logging {
options.timeoutMs(t)
}
- private def parseTopicPartitionsToReset(groupId: String, topicArgs:
Seq[String]): Seq[TopicPartition] = topicArgs.flatMap {
- case topicArg if topicArg.contains(":") =>
- val topicPartitions = topicArg.split(":")
- val topic = topicPartitions(0)
- topicPartitions(1).split(",").map(partition => new
TopicPartition(topic, partition.toInt))
- case topic =>
+ private def parseTopicPartitionsToReset(topicArgs: Seq[String]):
Seq[TopicPartition] = {
+ val (topicsWithPartitions, topics) = topicArgs.partition(_.contains(":"))
+ val specifiedPartitions = topicsWithPartitions.flatMap { arg =>
+ arg.split(":") match {
+ case Array(topic, partitions) =>
+ partitions.split(",").map(partition => new TopicPartition(topic,
partition.toInt))
Review comment:
@dajac Thanks for the review, updated. I also updated `deleteOffsets` to
use the same method for parsing topics with partitions. I didn't update the
admin client usage of `deleteOffsets` since its error handling looks different
and I didn't want to break any assumptions there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]