mimaison commented on a change in pull request #8238:
URL: https://github.com/apache/kafka/pull/8238#discussion_r418314384



##########
File path: core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
##########
@@ -84,6 +87,15 @@ object ConsumerGroupCommand extends Logging {
     }
   }
 
+  def consumerGroupStatesFromString(input: String): List[ConsumerGroupState] = 
{
+    val parsedStates = input.split(',').map(s => 
ConsumerGroupState.parse(s.trim.toLowerCase.capitalize)).toSet.toList
+    if (parsedStates.contains(ConsumerGroupState.UNKNOWN)) {
+      val validStates = ConsumerGroupState.values().filter(_ != 
ConsumerGroupState.UNKNOWN)
+      throw new IllegalArgumentException(s"Invalid state list '$input'. Valid 
states are: ${validStates.mkString(",")}")

Review comment:
       I've added logic to address the top issue.
   
   The second one affects most tools and would require much larger changes so 
probably best to address in a different PR.




----------------------------------------------------------------
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]


Reply via email to