ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [48/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-3054
Date Mon, 24 Apr 2017 15:04:11 GMT
Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-3054


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

Branch: refs/heads/ignite-3054
Commit: 78786bcdfd65079ed3b44a43c9b0373b4745f6af
Parents: 87205f9
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Apr 24 17:28:15 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Apr 24 17:34:17 2017 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 14 +++----------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 15 +++++---------
 .../messages/TcpDiscoveryAbstractMessage.java   | 21 --------------------
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |  2 +-
 4 files changed, 9 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/78786bcd/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 425560e..eeba6f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -618,7 +618,6 @@ class ClientImpl extends TcpDiscoveryImpl {
                 TcpDiscoveryHandshakeRequest req = new TcpDiscoveryHandshakeRequest(locNodeId);
 
                 req.client(true);
-                req.asyncMode(true);
 
                 spi.writeToSocket(sock, req, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
 
@@ -626,8 +625,6 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                 UUID rmtNodeId = res.creatorNodeId();
 
-                final boolean async = res.asyncMode();
-
                 assert rmtNodeId != null;
                 assert !getLocalNodeId().equals(rmtNodeId);
 
@@ -654,10 +651,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                 msg.client(true);
 
-                if (async)
-                    writeToSocketWithLength(msg, sock, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
-                else
-                    spi.writeToSocket(sock, msg, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
+                writeToSocketWithLength(msg, sock, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
 
                 spi.stats.onMessageSent(msg, U.currentTimeMillis() - tstamp);
 
@@ -669,7 +663,7 @@ class ClientImpl extends TcpDiscoveryImpl {
                     spi.readReceipt(sock,
                     timeoutHelper.nextTimeoutChunk(ackTimeout0)),
                     res.clientAck(),
-                    res.asyncMode());
+                    true);
             }
             catch (IOException | IgniteCheckedException e) {
                 U.closeQuiet(sock);
@@ -1447,8 +1441,6 @@ class ClientImpl extends TcpDiscoveryImpl {
                                             ", msg=" + msg + ']');
 
                                     if (res.success()) {
-                                        res.asyncMode(joinRes.asyncMode);
-
                                         msgWorker.addMessage(res);
 
                                         if (msgs != null) {
@@ -2255,7 +2247,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                     currSock = reconnector.sockStream;
 
-                    sockWriter.setSocket(currSock.socket(), reconnector.clientAck, msg.asyncMode());
+                    sockWriter.setSocket(currSock.socket(), reconnector.clientAck, true);
                     sockReader.setSocket(currSock, locNode.clientRouterNodeId());
 
                     reconnector = null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/78786bcd/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 0aa6625..5fa58ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -366,12 +366,12 @@ class ServerImpl extends TcpDiscoveryImpl {
         if (tcpSrvr == null)
             tcpSrvr = new TcpServer();
 
-        clientNioSrv = createClientNioServer(gridName);
+        clientNioSrv = createClientNioServer(igniteInstanceName);
         clientNioSrv.start();
 
         nioClientProcessingPool = new IgniteThreadPoolExecutor(
             "disco-client-nio-msg-processor",
-            gridName,
+            igniteInstanceName,
             spi.getClientNioThreads(),
             spi.getClientNioThreads() * 2,
             60_000L,
@@ -477,7 +477,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 .socketReceiveBufferSize(0)
                 .socketSendBufferSize(0)
                 .idleTimeout(Long.MAX_VALUE)
-                .gridName(gridName)
+                .igniteInstanceName(gridName)
                 .daemon(false)
                 .writeTimeout(writeTimeout)
                 .build();
@@ -4838,7 +4838,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                     failedNodesMsgSent.remove(failedNode.id());
 
                     if (!msg.force()) { // ClientMessageWorker will stop after sending force
fail message.
-                        final ClientMessageProcessor worker = clientMsgWorkers.remove(node.id());
+                        final ClientMessageProcessor worker = clientMsgWorkers.remove(failedNode.id());
 
                         if (worker != null) {
                             if (worker instanceof ClientMessageWorker) {
@@ -6454,12 +6454,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                     if (req.client()) {
                         res.clientAck(true);
 
-                        // If client proposes async mode accept it.
-                        if (req.asyncMode()) {
-                            res.asyncMode(true);
-
-                            asyncMode = true;
-                        }
+                        asyncMode = true;
                     }
 
                     // It can happen if a remote node is stopped and it has a loopback address
in the list of addresses,

http://git-wip-us.apache.org/repos/asf/ignite/blob/78786bcd/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
index 1cb6a0d..e982b2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
@@ -49,9 +49,6 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable
{
     protected static final int CLIENT_ACK_FLAG_POS = 4;
 
     /** */
-    protected static final int ASYNC_MODE_POS = 5;
-
-    /** */
     protected static final int FORCE_FAIL_FLAG_POS = 8;
 
     /** Sender of the message (transient). */
@@ -304,24 +301,6 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable
{
         return failedNodes;
     }
 
-    /**
-     * Set async mode flag.
-     *
-     * @param async Async mode flag.
-     */
-    public void asyncMode(boolean async) {
-        setFlag(ASYNC_MODE_POS, async);
-    }
-
-    /**
-     * Gets async mode flag.
-     *
-     * @return Async mode flag.
-     */
-    public boolean asyncMode() {
-        return getFlag(ASYNC_MODE_POS);
-    }
-
     /** {@inheritDoc} */
     @Override public boolean equals(Object obj) {
         if (this == obj)

http://git-wip-us.apache.org/repos/asf/ignite/blob/78786bcd/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index bddd369..62d64b6 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -2216,7 +2216,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         /** {@inheritDoc} */
         @Override protected GridNioFuture<?> sendMessage(final GridNioSession ses,
final TcpDiscoveryAbstractMessage msg,
             @Nullable final byte[] msgBytes) {
-            final GridNioFutureImpl fut = new GridNioFutureImpl();
+            final GridNioFutureImpl fut = new GridNioFutureImpl(null);
 
             final Runnable task = new Runnable() {
                 @Override public void run() {


Mime
View raw message