You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/09/27 15:26:58 UTC

[68/68] [abbrv] ignite git commit: ignite-comm-opts2

ignite-comm-opts2


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d3ecf936
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d3ecf936
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d3ecf936

Branch: refs/heads/ignite-comm-opts2
Commit: d3ecf9369dbfbd15033297650955e6996cce9b0e
Parents: 8fbfe4d
Author: sboikov <sb...@gridgain.com>
Authored: Tue Sep 27 16:01:36 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Sep 27 16:01:36 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java | 24 ++++++++------------
 .../util/nio/GridSelectorNioSessionImpl.java    |  2 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  2 ++
 3 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d3ecf936/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 1f88e14..ba8ae50 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -464,10 +464,8 @@ public class GridNioServer<T> {
             if (ses.removeFuture(fut))
                 fut.connectionClosed();
         }
-        else {
-            if (!ses.processWrite.get() && ses.processWrite.compareAndSet(false, true))
+        else if (!ses.procWrite.get() && ses.procWrite.compareAndSet(false, true))
                 clientWorkers.get(ses.selectorIndex()).offer(fut);
-        }
 
         if (msgQueueLsnr != null)
             msgQueueLsnr.apply(ses, msgCnt);
@@ -700,17 +698,17 @@ public class GridNioServer<T> {
         assert req.operation() == NioOperation.REGISTER : req;
         assert req.socketChannel() != null : req;
 
-        int workes = clientWorkers.size();
+        int workers = clientWorkers.size();
 
         int balanceIdx;
 
-        if (workes > 1) {
+        if (workers > 1) {
             if (req.accepted()) {
                 balanceIdx = readBalanceIdx;
 
                 readBalanceIdx += 2;
 
-                if (readBalanceIdx >= workes)
+                if (readBalanceIdx >= workers)
                     readBalanceIdx = 0;
             }
             else {
@@ -718,7 +716,7 @@ public class GridNioServer<T> {
 
                 writeBalanceIdx += 2;
 
-                if (writeBalanceIdx >= workes)
+                if (writeBalanceIdx >= workers)
                     writeBalanceIdx = 1;
             }
         }
@@ -1209,17 +1207,15 @@ public class GridNioServer<T> {
                 req = (NioOperationFuture<?>)ses.pollFuture();
 
                 if (req == null && buf.position() == 0) {
-                    if (ses.processWrite.get()) {
-                        boolean set = ses.processWrite.compareAndSet(true, false);
+                    if (ses.procWrite.get()) {
+                        boolean set = ses.procWrite.compareAndSet(true, false);
 
                         assert set;
 
-                        if (ses.writeQueue().isEmpty()) {
+                        if (ses.writeQueue().isEmpty())
                             key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
-                        }
-                        else {
-                            ses.processWrite.set(true);
-                        }
+                        else
+                            ses.procWrite.set(true);
                     }
 
                     return;

http://git-wip-us.apache.org/repos/asf/ignite/blob/d3ecf936/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
index b36184c..6b00281 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java
@@ -66,7 +66,7 @@ class GridSelectorNioSessionImpl extends GridNioSessionImpl {
     private final IgniteLogger log;
 
     /** */
-    public final AtomicBoolean processWrite = new AtomicBoolean();
+    final AtomicBoolean procWrite = new AtomicBoolean();
 
     /**
      * Creates session instance.

http://git-wip-us.apache.org/repos/asf/ignite/blob/d3ecf936/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 60aa374..fc4f5b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -2644,6 +2644,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
      * Establish TCP connection to remote node and returns client.
      *
      * @param node Remote node.
+     * @param connIdx Connection index.
      * @return Client.
      * @throws IgniteCheckedException If failed.
      */
@@ -2918,6 +2919,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
      * @param rmtNodeId Remote node.
      * @param timeout Timeout for handshake.
      * @param ssl SSL engine if used cryptography, otherwise {@code null}.
+     * @param handshakeConnIdx Non null connection index if need send it in handshake.
      * @throws IgniteCheckedException If handshake failed or wasn't completed withing timeout.
      * @return Handshake response.
      */