timoninmaxim commented on a change in pull request #8206: URL: https://github.com/apache/ignite/pull/8206#discussion_r482855961
########## File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelFacade.java ########## @@ -0,0 +1,199 @@ +/* + * 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.ignite.internal.client.thin; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; +import java.util.function.Function; +import org.apache.ignite.IgniteBinary; +import org.apache.ignite.client.ClientAuthenticationException; +import org.apache.ignite.client.ClientAuthorizationException; +import org.apache.ignite.client.ClientException; +import org.apache.ignite.configuration.ClientConfiguration; + +/** + * Communication channel with failover and partition awareness. + */ +final class ReliableChannelFacade implements AutoCloseable { Review comment: I think that `ReliableChannel` was overloaded, it was responsible for 2 things the same time: communication and affinity awareness. Due to that there were some non-intuitive conditions for me while I debug the code. So I split the original class on 2 parts: 1. `ReliableChannel` now is responsible for sending **any** request to Ignite nodes. If some channel is failure it tries to use another one, roll channels, etc. It just provides infrastructure for communication between client and servers. 2. `ReliableChannelFacade` provides logic with affinity awareness: send **affinity** requests, choose affinity node for a request. ---------------------------------------------------------------- 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]
