ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/4] ignite git commit: IGNITE-2540: Removed unnecessary ArrayList from GridNioServer.DirectNioClientWorker write processing methods.
Date Thu, 04 Feb 2016 08:18:32 GMT
IGNITE-2540: Removed unnecessary ArrayList from GridNioServer.DirectNioClientWorker write processing
methods.


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

Branch: refs/heads/ignite-2407
Commit: afd3bc1e3c249ae86071f0d15b41c6eedbdeb050
Parents: 10a2b7a
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Feb 4 11:13:36 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Feb 4 11:13:36 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/afd3bc1e/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 84c8157..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
@@ -980,8 +980,6 @@ public class GridNioServer<T> {
 
                 NioOperationFuture<?> req = ses.removeMeta(NIO_OPERATION.ordinal());
 
-                List<NioOperationFuture<?>> doneFuts = null;
-
                 while (true) {
                     if (req == null) {
                         req = (NioOperationFuture<?>)ses.pollFuture();
@@ -1012,10 +1010,7 @@ public class GridNioServer<T> {
 
                     // Fill up as many messages as possible to write buffer.
                     while (finished) {
-                        if (doneFuts == null)
-                            doneFuts = new ArrayList<>();
-
-                        doneFuts.add(req);
+                        req.onDone();
 
                         req = (NioOperationFuture<?>)ses.pollFuture();
 
@@ -1059,13 +1054,6 @@ public class GridNioServer<T> {
                     if (!skipWrite) {
                         int cnt = sockCh.write(buf);
 
-                        if (!F.isEmpty(doneFuts)) {
-                            for (int i = 0; i < doneFuts.size(); i++)
-                                doneFuts.get(i).onDone();
-
-                            doneFuts.clear();
-                        }
-
                         if (log.isTraceEnabled())
                             log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']');
 
@@ -1185,13 +1173,8 @@ public class GridNioServer<T> {
             }
 
             // Fill up as many messages as possible to write buffer.
-            List<NioOperationFuture<?>> doneFuts = null;
-
             while (finished) {
-                if (doneFuts == null)
-                    doneFuts = new ArrayList<>();
-
-                doneFuts.add(req);
+                req.onDone();
 
                 req = (NioOperationFuture<?>)ses.pollFuture();
 
@@ -1218,13 +1201,6 @@ public class GridNioServer<T> {
             if (!skipWrite) {
                 int cnt = sockCh.write(buf);
 
-                if (!F.isEmpty(doneFuts)) {
-                    for (int i = 0; i < doneFuts.size(); i++)
-                        doneFuts.get(i).onDone();
-
-                    doneFuts.clear();
-                }
-
                 if (log.isTraceEnabled())
                     log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']');
 


Mime
View raw message