ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [10/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling
Date Mon, 22 Dec 2014 23:40:04 GMT
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: 5ed5176eff3df499014e7084c5bb3f46aa319c6c
Parents: ac71f06
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Thu Dec 18 17:12:26 2014 +0300
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Thu Dec 18 17:12:26 2014 +0300

----------------------------------------------------------------------
 .../spi/collision/jobstealing/JobStealingRequest.java  |  2 +-
 .../util/direct/GridTcpCommunicationMessageState.java  | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5ed5176e/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 6e43563..1b3a91e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,7 +69,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter
{
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(null, directType()))
+            if (!commState.writeType(directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5ed5176e/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index ee60070..5a3e74d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -78,6 +78,19 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param type Message type.
+     * @return Whether message type was written.
+     */
+    public final boolean writeType(byte type) {
+        if (stream.remaining() == 0)
+            return false;
+
+        stream.writeByte(type);
+
+        return true;
+    }
+
+    /**
      * @param name Field name.
      * @param b Byte value.
      * @return Whether value was written.


Mime
View raw message