frankvicky commented on code in PR #17614: URL: https://github.com/apache/kafka/pull/17614#discussion_r1886094138
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/CloseOptionInternal.java: ########## @@ -0,0 +1,44 @@ +/* + * 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.consumer.internals; + +import org.apache.kafka.clients.consumer.Consumer; +import org.apache.kafka.clients.consumer.GroupMembershipOperation; + +import java.time.Duration; +import java.util.Optional; + +/** + * This class represents an internal version of {@link Consumer.CloseOption}, used for internal processing of consumer shutdown options. + * + * <p>While {@link Consumer.CloseOption} is the user-facing class, {@code CloseOptionInternal} is intended for accessing internal fields + * and performing operations within the Kafka codebase. This class should not be used directly by users. + * It extends {@link Consumer.CloseOption} and provides getters for the {@link GroupMembershipOperation} and timeout values.</p> + */ +public class CloseOptionInternal extends Consumer.CloseOption { Review Comment: Based on our previous discussion in mail thread about `CloseOptions` API design, I understand your concerns about exposing getters. As mentioned, it keeps the user-facing API clean with minimal complexity cost, and the performance impact is negligible since it's not on the hot code path and deals with short-lived objects. However, if we now feel this complexity isn't necessary, I'm happy to modify it in this 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
