ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [06/26] incubator-ignite git commit: # gg-9791 - Communication fixes
Date Sat, 21 Feb 2015 01:46:19 GMT
# gg-9791 - Communication fixes


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

Branch: refs/heads/sprint-2
Commit: 63245b0e80774dcdbe78308adce119c13f238526
Parents: 5d27722
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Wed Feb 18 17:58:51 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Wed Feb 18 17:58:51 2015 -0800

----------------------------------------------------------------------
 .../ignite/internal/direct/DirectByteBufferStream.java   | 11 ++++++-----
 .../ignite/internal/direct/DirectMessageReader.java      |  5 +++--
 .../internal/managers/communication/GridIoManager.java   |  2 +-
 .../apache/ignite/testframework/GridSpiTestContext.java  |  2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63245b0e/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
index d496807..62cd990 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
@@ -210,7 +210,7 @@ public class DirectByteBufferStream {
     private final MessageFactory msgFactory;
 
     /** */
-    private final MessageReader msgReader;
+    private final MessageFormatter msgFormatter;
 
     /** */
     private ByteBuffer buf;
@@ -268,11 +268,11 @@ public class DirectByteBufferStream {
 
     /**
      * @param msgFactory Message factory.
-     * @param msgReader Message reader.
+     * @param msgFormatter Message formatter.
      */
-    public DirectByteBufferStream(MessageFactory msgFactory, MessageReader msgReader) {
+    public DirectByteBufferStream(MessageFactory msgFactory, MessageFormatter msgFormatter)
{
         this.msgFactory = msgFactory;
-        this.msgReader = msgReader;
+        this.msgFormatter = msgFormatter;
     }
 
     /**
@@ -917,7 +917,8 @@ public class DirectByteBufferStream {
 
             msg = type == Byte.MIN_VALUE ? null : msgFactory.create(type);
 
-            msg.setReader(msgReader);
+            if (msg != null)
+                msg.setReader(msgFormatter.reader(msgFactory));
 
             msgTypeDone = true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63245b0e/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
index 3e336af..445a854 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
@@ -36,9 +36,10 @@ public class DirectMessageReader implements MessageReader {
 
     /**
      * @param msgFactory Message factory.
+     * @param msgFormatter Message formatter.
      */
-    public DirectMessageReader(MessageFactory msgFactory) {
-        this.stream = new DirectByteBufferStream(msgFactory, this);
+    public DirectMessageReader(MessageFactory msgFactory, MessageFormatter msgFormatter)
{
+        this.stream = new DirectByteBufferStream(msgFactory, msgFormatter);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63245b0e/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 3be34f7..f794fb7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -224,7 +224,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                 }
 
                 @Override public MessageReader reader(MessageFactory factory) {
-                    return new DirectMessageReader(msgFactory);
+                    return new DirectMessageReader(msgFactory, this);
                 }
             };
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63245b0e/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
index e1aaa71..ad59f18 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
@@ -520,7 +520,7 @@ public class GridSpiTestContext implements IgniteSpiContext {
                 }
 
                 @Override public MessageReader reader(MessageFactory factory) {
-                    return new DirectMessageReader(factory);
+                    return new DirectMessageReader(factory, this);
                 }
             };
         }


Mime
View raw message