Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB685173CF for ; Mon, 13 Apr 2015 06:40:55 +0000 (UTC) Received: (qmail 8173 invoked by uid 500); 13 Apr 2015 06:40:55 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 8107 invoked by uid 500); 13 Apr 2015 06:40:55 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 8091 invoked by uid 99); 13 Apr 2015 06:40:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 06:40:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Apr 2015 06:40:52 +0000 Received: (qmail 7510 invoked by uid 99); 13 Apr 2015 06:40:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 06:40:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 520F7E0AB7; Mon, 13 Apr 2015 06:40:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 13 Apr 2015 06:40:46 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [15/50] incubator-ignite git commit: # ignite-537 X-Virus-Checked: Checked by ClamAV on apache.org # 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-709 Commit: 98587c6cd66c42eee2fd8a27ad0715599ef8665b Parents: 35537fa Author: sboikov Authored: Sat Apr 11 00:38:39 2015 +0300 Committer: sboikov 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() {