chia7712 commented on code in PR #17626:
URL: https://github.com/apache/kafka/pull/17626#discussion_r1827675396


##########
clients/src/main/java/org/apache/kafka/clients/admin/ListGroupsOptions.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kafka.clients.admin;
+
+import org.apache.kafka.common.GroupType;
+import org.apache.kafka.common.annotation.InterfaceStability;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * Options for {@link Admin#listGroups()}.
+ * <p>
+ * The API of this class is evolving, see {@link Admin} for details.
+ */
[email protected]
+public class ListGroupsOptions extends AbstractOptions<ListGroupsOptions> {
+
+    private Set<GroupType> types = Collections.emptySet();
+
+    /**
+     * If types is set, only groups of these types will be returned by 
listGroups().
+     * Otherwise, all groups are returned.
+     */
+    public ListGroupsOptions withTypes(Set<GroupType> types) {

Review Comment:
   > I prefer to use an enum in order to stay consistent with the rest of our 
public api and because using strings is error prone. If users want to use new 
features, they will likely upgrade their clients anyway.
   
   Okay, I also prefer enums and agree that strings can be error-prone, but I'd 
like to discuss this further. I assumed `ListGroup` was intended as a generic 
method capable of displaying all past and future group types. This also means 
that users would need to upgrade their admin tools to correctly parse 
GroupType, even if the RPC version remains unchanged.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to