ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [16/50] incubator-ignite git commit: # ignite-537
Date Mon, 13 Apr 2015 07:03:18 GMT
# ignite-537


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

Branch: refs/heads/ignite-sprint-4
Commit: 98587c6cd66c42eee2fd8a27ad0715599ef8665b
Parents: 35537fa
Author: sboikov <semen.boikov@inria.fr>
Authored: Sat Apr 11 00:38:39 2015 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Sat Apr 11 00:38:39 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/TcpDiscoverySpi.java     |  7 ++++---
 .../tcp/messages/TcpDiscoveryCustomEventMessage.java  | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98587c6c/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 3301303..5392331 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
@@ -1257,7 +1257,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
 
             msgBytes = marsh.marshal(evt);
 
-            msgWorker.addMessage(new TcpDiscoveryCustomEventMessage(getLocalNodeId(), msgBytes));
+            msgWorker.addMessage(new TcpDiscoveryCustomEventMessage(getLocalNodeId(), evt,
msgBytes));
         }
         catch (IgniteCheckedException e) {
             throw new IgniteSpiException("Failed to marshal custom event: " + evt, e);
@@ -4600,10 +4600,11 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
 
                     TcpDiscoveryNode node = ring.node(msg.creatorNodeId());
 
-                    Serializable msgObj;
+                    Serializable msgObj = msg.message();
 
                     try {
-                        msgObj = marsh.unmarshal(msg.messageBytes(), customMessageClassLoader(node));
+                        if (msgObj == null)
+                            msgObj = marsh.unmarshal(msg.messageBytes(), customMessageClassLoader(node));
                     }
                     catch (IgniteCheckedException e) {
                         throw new IgniteSpiException("Failed to unmarshal discovery custom
message.", e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98587c6c/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java
index 3144b93..4e42f2d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java
@@ -19,6 +19,7 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
+import java.io.*;
 import java.util.*;
 
 /**
@@ -30,19 +31,30 @@ public class TcpDiscoveryCustomEventMessage extends TcpDiscoveryAbstractMessage
     private static final long serialVersionUID = 0L;
 
     /** */
+    private transient Serializable msg;
+
+    /** */
     private final byte[] msgBytes;
 
     /**
      * @param creatorNodeId Creator node id.
      * @param msgBytes Serialized message.
      */
-    public TcpDiscoveryCustomEventMessage(UUID creatorNodeId, byte[] msgBytes) {
+    public TcpDiscoveryCustomEventMessage(UUID creatorNodeId, Serializable msg, byte[] msgBytes)
{
         super(creatorNodeId);
 
+        this.msg = msg;
         this.msgBytes = msgBytes;
     }
 
     /**
+     * @return Message.
+     */
+    public Serializable message() {
+        return msg;
+    }
+
+    /**
      * @return Serialized message.
      */
     public byte[] messageBytes() {


Mime
View raw message