ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-3220-1
Date Mon, 22 Aug 2016 07:37:52 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3220-1 43b64c06e -> 826a22615


Merge remote-tracking branch 'remotes/origin/master' into ignite-3220-1

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java


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

Branch: refs/heads/ignite-3220-1
Commit: 826a22615625c05a6e3e5cba9cad73481407faa2
Parents: 43b64c0
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Aug 22 10:37:45 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Aug 22 10:37:45 2016 +0300

----------------------------------------------------------------------
 .../communication/tcp/TcpCommunicationSpi.java  | 25 ++++++++++++++++----
 1 file changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/826a2261/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 7b4c732..016f600 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
@@ -382,7 +382,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                                 recoveryData.onNodeLeft();
                         }
 
-                        DisconnectedSessionInfo disconnectData = new DisconnectedSessionInfo(recoveryData,
+                        DisconnectedSessionInfo disconnectData = new DisconnectedSessionInfo(id,
+                            recoveryData,
                             reconnect);
 
                         commWorker.addProcessDisconnectRequest(disconnectData);
@@ -824,6 +825,17 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
     /** Clients. */
     private final ConcurrentMap<ConnectionId, GridCommunicationClient> clients = GridConcurrentFactory.newMap();
 
+    /** */
+    private int connectionsPerNode = 2;
+
+    public int getConnectionsPerNode() {
+        return connectionsPerNode;
+    }
+
+    public void setConnectionsPerNode(int connectionsPerNode) {
+        this.connectionsPerNode = connectionsPerNode;
+    }
+
     /**
      *
      */
@@ -859,6 +871,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
             res = 31 * res + id.hashCode();
             return res;
         }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(ConnectionId.class, this);
+        }
     }
 
     /** SPI listener. */
@@ -1454,7 +1471,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
             sb.append("Communication SPI clients: ").append(U.nl());
 
-            for (Map.Entry<UUID, GridCommunicationClient> entry : clients.entrySet())
{
+            for (Map.Entry<ConnectionId, GridCommunicationClient> entry : clients.entrySet())
{
                 sb.append("    [node=").append(entry.getKey())
                     .append(", client=").append(entry.getValue())
                     .append(']').append(U.nl());
@@ -1998,8 +2015,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         sendMessage0(node, msg, ackC);
     }
 
-    private final int CONNECTIONS_PER_NODE = 2;
-
     /**
      * @param node Destination node.
      * @param msg Message to send.
@@ -2027,7 +2042,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         else {
             GridCommunicationClient client = null;
 
-            ConnectionId id = new ConnectionId(((GridIoMessage)msg).connectionIndex() % CONNECTIONS_PER_NODE,
node.id());
+            ConnectionId id = new ConnectionId(((GridIoMessage)msg).connectionIndex() % connectionsPerNode,
node.id());
 
             try {
                 boolean retry;


Mime
View raw message