timoninmaxim commented on a change in pull request #8206:
URL: https://github.com/apache/ignite/pull/8206#discussion_r489455381



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java
##########
@@ -114,46 +135,32 @@
         Function<ClientChannelConfiguration, ClientChannel> chFactory,
         ClientConfiguration clientCfg,
         IgniteBinary binary
-    ) throws ClientException {
+    ) {
         if (chFactory == null)
             throw new NullPointerException("chFactory");
 
         if (clientCfg == null)
             throw new NullPointerException("clientCfg");
 
+        this.clientCfg = clientCfg;
         this.chFactory = chFactory;
 
-        List<InetSocketAddress> addrs = 
parseAddresses(clientCfg.getAddresses());
-
-        channels = new ClientChannelHolder[addrs.size()];
-
-        for (int i = 0; i < channels.length; i++)
-            channels[i] = new ClientChannelHolder(new 
ClientChannelConfiguration(clientCfg, addrs.get(i)));
-
-        curChIdx = new Random().nextInt(channels.length); // We already 
verified there is at least one address.
-
-        partitionAwarenessEnabled = clientCfg.isPartitionAwarenessEnabled() && 
channels.length > 1;
+        partitionAwarenessEnabled = clientCfg.isPartitionAwarenessEnabled();
 
         affinityCtx = new ClientCacheAffinityContext(binary);
+    }
 
-        ClientConnectionException lastEx = null;
-
-        for (int i = 0; i < channels.length; i++) {
-            try {
-                channels[curChIdx].getOrCreateChannel();
-
-                if (partitionAwarenessEnabled)
-                    initAllChannelsAsync();
-
-                return;
-            } catch (ClientConnectionException e) {
-                lastEx = e;
-
-                rollCurrentChannel();
-            }
-        }
-
-        throw lastEx;
+    /**
+     * Establishing connections to servers. If partition awareness feature is 
enabled connections are created
+     * for every configured server. Otherwise only default channel is 
connected.
+     */
+    void initConnection() {
+        channelsInit(false);
+        if (!partitionAwarenessEnabled)

Review comment:
       It will inside `channelsInit`




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