ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [36/50] [abbrv] ignite git commit: ignite-3054 - Review fix
Date Mon, 24 Apr 2017 15:03:59 GMT
ignite-3054 - Review fix


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

Branch: refs/heads/ignite-3054
Commit: e9c30f8749742bd341643c6fe12e6cc110fcdf43
Parents: 6581498
Author: dkarachentsev <dkarachentsev@gridgain.com>
Authored: Tue Dec 13 18:09:42 2016 +0300
Committer: dkarachentsev <dkarachentsev@gridgain.com>
Committed: Tue Dec 13 18:09:42 2016 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java       |  8 ++++++--
 .../ignite/spi/discovery/tcp/TcpDiscoverySpi.java  | 17 +++--------------
 2 files changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e9c30f87/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 9551acc..3980932 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
@@ -96,6 +96,7 @@ import org.apache.ignite.internal.util.nio.GridNioSession;
 import org.apache.ignite.internal.util.nio.GridNioSessionMetaKey;
 import org.apache.ignite.internal.util.nio.ssl.BlockingSslHandler;
 import org.apache.ignite.internal.util.nio.ssl.GridNioSslFilter;
+import org.apache.ignite.internal.util.nio.ssl.GridSslMeta;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.CX1;
@@ -5878,7 +5879,11 @@ class ServerImpl extends TcpDiscoveryImpl {
                 assert sock instanceof NioSslSocket;
 
                 // Put the engine to the meta map to allow nio server to use it:
-                meta.put(GridNioSessionMetaKey.SSL_META.ordinal(), ((NioSslSocket)sock).sslEngine);
+                GridSslMeta sslMeta = new GridSslMeta();
+
+                sslMeta.sslEngine(((NioSslSocket)sock).sslEngine);
+
+                meta.put(GridNioSessionMetaKey.SSL_META.ordinal(), sslMeta);
             }
 
             ses = clientNioSrv.createSession(ch, meta).get();
@@ -7590,7 +7595,6 @@ class ServerImpl extends TcpDiscoveryImpl {
             return delegate.getReuseAddress();
         }
 
-        // TODO: check if synchronized is really needed.
         /** {@inheritDoc} */
         @Override public void close() throws IOException {
             U.closeQuiet(sslIn);

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9c30f87/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 9b2c8cb..aa0c8f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -29,9 +29,7 @@ import java.net.Socket;
 import java.net.SocketException;
 import java.net.SocketTimeoutException;
 import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
-import java.nio.channels.SocketChannel;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -1485,20 +1483,11 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
         IOException err = null;
 
         try {
-            final SocketChannel ch = sock.getChannel();
+            OutputStream out = sock.getOutputStream();
 
-            // TODO: try remove this hack after all others issues are fixed.
-            // Use channel directly as a workaround, because output stream
-            // from NIO socket may block infinitely.
-            if (ch != null && !(sock instanceof ServerImpl.NioSslSocket))
-                ch.write(ByteBuffer.wrap(data));
-            else {
-                OutputStream out = sock.getOutputStream();
+            out.write(data);
 
-                out.write(data);
-
-                out.flush();
-            }
+            out.flush();
         }
         catch (IOException e) {
             err = e;


Mime
View raw message