You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/02/03 13:31:32 UTC

[4/4] ignite git commit: IGNITE-2540: Further fixes.

IGNITE-2540: Further fixes.


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

Branch: refs/heads/ignite-2540
Commit: 1f924264f92c6ad9b0f4b403f7d246b5e626e4e5
Parents: aa5bfc7
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Feb 3 15:31:22 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Feb 3 15:31:22 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java | 29 ++------------------
 1 file changed, 2 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1f924264/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 69e3b63..c7679c0 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
@@ -836,9 +836,6 @@ public class GridNioServer<T> {
      * Client worker for direct mode.
      */
     private class DirectNioClientWorker extends AbstractNioClientWorker {
-        /** Done futures. */
-        private final List<NioOperationFuture<?>> doneFuts = new ArrayList<>();
-
         /**
          * @param idx Index of this worker in server's array.
          * @param gridName Grid name.
@@ -1013,7 +1010,7 @@ public class GridNioServer<T> {
 
                     // Fill up as many messages as possible to write buffer.
                     while (finished) {
-                        doneFuts.add(req);
+                        req.onDone();
 
                         req = (NioOperationFuture<?>)ses.pollFuture();
 
@@ -1057,15 +1054,6 @@ public class GridNioServer<T> {
                     if (!skipWrite) {
                         int cnt = sockCh.write(buf);
 
-                        int doneFutsSize = doneFuts.size();
-
-                        if (doneFutsSize > 0) {
-                            for (int i = 0; i < doneFutsSize; i++)
-                                doneFuts.get(i).onDone();
-
-                            doneFuts.clear();
-                        }
-
                         if (log.isTraceEnabled())
                             log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']');
 
@@ -1082,8 +1070,6 @@ public class GridNioServer<T> {
                         catch (IgniteInterruptedCheckedException e) {
                             throw new IOException("Thread has been interrupted.", e);
                         }
-
-                        doneFuts.clear();
                     }
 
                     ses.addMeta(NIO_OPERATION.ordinal(), req);
@@ -1188,7 +1174,7 @@ public class GridNioServer<T> {
 
             // Fill up as many messages as possible to write buffer.
             while (finished) {
-                doneFuts.add(req);
+                req.onDone();
 
                 req = (NioOperationFuture<?>)ses.pollFuture();
 
@@ -1215,15 +1201,6 @@ public class GridNioServer<T> {
             if (!skipWrite) {
                 int cnt = sockCh.write(buf);
 
-                int doneFutsSize = doneFuts.size();
-
-                if (doneFutsSize > 0) {
-                    for (int i = 0; i < doneFutsSize; i++)
-                        doneFuts.get(i).onDone();
-
-                    doneFuts.clear();
-                }
-
                 if (log.isTraceEnabled())
                     log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']');
 
@@ -1240,8 +1217,6 @@ public class GridNioServer<T> {
                 catch (IgniteInterruptedCheckedException e) {
                     throw new IOException("Thread has been interrupted.", e);
                 }
-
-                doneFuts.clear();
             }
 
             if (buf.hasRemaining() || !finished) {