You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/07/04 09:56:38 UTC

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6595: IGNITE-11685 Java thin client: Handle multiple async requests in parallel

alex-plekhanov commented on a change in pull request #6595: IGNITE-11685 Java thin client: Handle multiple async requests in parallel
URL: https://github.com/apache/ignite/pull/6595#discussion_r300324983
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java
 ##########
 @@ -216,19 +191,30 @@ public ProtocolVersion serverVersion() {
     }
 
     /** */
-    private void changeServer() {
-        if (!backups.isEmpty()) {
-            backups.addLast(primary);
+    private synchronized ClientChannel channel() {
+        if (ch == null)
+            ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get();
 
-            primary = backups.removeFirst();
-        }
+        return ch;
+    }
 
-        try {
-            ch.close();
-        }
-        catch (Exception ignored) {
-        }
+    /** */
+    private synchronized void changeServer(ClientChannel oldCh) {
+        if (oldCh == ch && ch != null) {
+            if (!backups.isEmpty()) {
 
 Review comment:
   I don't fully understand what kind of improvement do you mean?
   I haven't change naming, there was such naming before PR. I think naming will be changed as far as "Best effort affinity" for java thin client will be implemented.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services