kirktrue commented on code in PR #14359: URL: https://github.com/apache/kafka/pull/14359#discussion_r1323626613
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/NodeStatusDetector.java: ########## @@ -0,0 +1,58 @@ +/* + * 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.KafkaClient; +import org.apache.kafka.clients.NetworkClientUtils; +import org.apache.kafka.common.Node; +import org.apache.kafka.common.errors.AuthenticationException; +import org.apache.kafka.common.utils.Time; + +/** + * Use {@code NodeStatusDetector} to determine the status of a given broker {@link Node}. It's also + * possible to check for previous authentication errors if the node isn't available. + * + * @see ConsumerNetworkClient + * @see NetworkClientDelegate + */ +public interface NodeStatusDetector { Review Comment: One implementation is using the existing `ConsumerNetworkClient` which is closely related to the network/threading model of the existing `KafkaConsumer`. The newer implementation is `NetworkClientDelegate` which does not need the synchronization and odds-and-ends that `ConsumerNetworkClient` needs. `NodeStatusDetector` gives us a general interface that a good chunk of the refactored code in `AbstractFetch` and elsewhere can use without having to tie us to a single implementation. -- 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]
