ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/15] incubator-ignite git commit: # IGNITE-30 Make TcpDiscoveryAbstractMessage Serializable instead of Externalizable.
Date Wed, 08 Apr 2015 22:39:30 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-366 1d15081e7 -> a034277e7 (forced update)


# IGNITE-30 Make TcpDiscoveryAbstractMessage Serializable instead of Externalizable.


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

Branch: refs/heads/ignite-366
Commit: 1e55e2dc1a7e5be44697f9c4c78d32e25de6928f
Parents: 5f2d8c2
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Tue Apr 7 14:41:49 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Tue Apr 7 14:41:49 2015 +0300

----------------------------------------------------------------------
 .../messages/TcpDiscoveryAbstractMessage.java   | 24 +-------
 .../messages/TcpDiscoveryAuthFailedMessage.java | 25 ++++----
 .../TcpDiscoveryCheckFailedMessage.java         | 24 +-------
 .../TcpDiscoveryClientReconnectMessage.java     | 30 +---------
 .../TcpDiscoveryCustomEventMessage.java         | 23 +-------
 .../messages/TcpDiscoveryDiscardMessage.java    | 24 +-------
 .../TcpDiscoveryDuplicateIdMessage.java         | 24 +-------
 .../messages/TcpDiscoveryHandshakeRequest.java  |  8 ---
 .../messages/TcpDiscoveryHandshakeResponse.java | 22 -------
 .../messages/TcpDiscoveryHeartbeatMessage.java  | 44 +-------------
 .../TcpDiscoveryJoinRequestMessage.java         | 28 +--------
 .../TcpDiscoveryLoopbackProblemMessage.java     | 28 +--------
 .../TcpDiscoveryNodeAddFinishedMessage.java     | 24 +-------
 .../messages/TcpDiscoveryNodeAddedMessage.java  | 60 +-------------------
 .../messages/TcpDiscoveryNodeFailedMessage.java | 28 +--------
 .../messages/TcpDiscoveryNodeLeftMessage.java   |  8 ---
 .../tcp/messages/TcpDiscoveryPingRequest.java   | 25 +-------
 .../tcp/messages/TcpDiscoveryPingResponse.java  | 14 -----
 .../TcpDiscoveryStatusCheckMessage.java         | 30 +---------
 19 files changed, 33 insertions(+), 460 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
index 09c7522..1a00359 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
@@ -27,7 +27,7 @@ import java.util.*;
 /**
  * Base class to implement discovery messages.
  */
-public abstract class TcpDiscoveryAbstractMessage implements Externalizable {
+public abstract class TcpDiscoveryAbstractMessage implements Serializable {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -41,7 +41,7 @@ public abstract class TcpDiscoveryAbstractMessage implements Externalizable
{
     protected static final int CLIENT_RECON_SUCCESS_FLAG_POS = 2;
 
     /** Sender of the message (transient). */
-    private UUID senderNodeId;
+    private transient UUID senderNodeId;
 
     /** Message ID. */
     private IgniteUuid id;
@@ -233,26 +233,6 @@ public abstract class TcpDiscoveryAbstractMessage implements Externalizable
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        U.writeGridUuid(out, id);
-        U.writeUuid(out, verifierNodeId);
-        out.writeLong(topVer);
-        U.writeUuid(out, destClientNodeId);
-        out.writeInt(flags);
-        out.writeShort(pendingIdx);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        id = U.readGridUuid(in);
-        verifierNodeId = U.readUuid(in);
-        topVer = in.readLong();
-        destClientNodeId = U.readUuid(in);
-        flags = in.readInt();
-        pendingIdx = in.readShort();
-    }
-
-    /** {@inheritDoc} */
     @Override public final boolean equals(Object obj) {
         if (this == obj)
             return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java
index 2d20be9..0eb3df0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java
@@ -31,14 +31,7 @@ public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /** Coordinator address. */
-    private InetAddress addr;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryAuthFailedMessage() {
-        // No-op.
-    }
+    private transient InetAddress addr;
 
     /**
      * Constructor.
@@ -59,16 +52,20 @@ public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage
{
         return addr;
     }
 
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
+    /**
+     * Serialize this message.
+     */
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        out.defaultWriteObject();
 
         U.writeByteArray(out, addr.getAddress());
     }
 
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
+    /**
+     * Deserialize this message.
+     */
+    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
+        in.defaultReadObject();
 
         addr = InetAddress.getByAddress(U.readByteArray(in));
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCheckFailedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCheckFailedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCheckFailedMessage.java
index d35bffb..0905c58 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCheckFailedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCheckFailedMessage.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -30,14 +29,7 @@ public class TcpDiscoveryCheckFailedMessage extends TcpDiscoveryAbstractMessage
     private static final long serialVersionUID = 0L;
 
     /** Coordinator version. */
-    private String err;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryCheckFailedMessage() {
-        // No-op.
-    }
+    private final String err;
 
     /**
      * Constructor.
@@ -59,20 +51,6 @@ public class TcpDiscoveryCheckFailedMessage extends TcpDiscoveryAbstractMessage
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeString(out, err);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        err = U.readString(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryCheckFailedMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java
index db68ae3..86aee1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java
@@ -21,7 +21,6 @@ import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -32,23 +31,16 @@ public class TcpDiscoveryClientReconnectMessage extends TcpDiscoveryAbstractMess
     private static final long serialVersionUID = 0L;
 
     /** New router nodeID. */
-    private UUID routerNodeId;
+    private final UUID routerNodeId;
 
     /** Last message ID. */
-    private IgniteUuid lastMsgId;
+    private final IgniteUuid lastMsgId;
 
     /** Pending messages. */
     @GridToStringExclude
     private Collection<TcpDiscoveryAbstractMessage> msgs;
 
     /**
-     * For {@link Externalizable}.
-     */
-    public TcpDiscoveryClientReconnectMessage() {
-        // No-op.
-    }
-
-    /**
      * @param creatorNodeId Creator node ID.
      * @param routerNodeId New router node ID.
      * @param lastMsgId Last message ID.
@@ -103,24 +95,6 @@ public class TcpDiscoveryClientReconnectMessage extends TcpDiscoveryAbstractMess
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeUuid(out, routerNodeId);
-        U.writeGridUuid(out, lastMsgId);
-        U.writeCollection(out, msgs);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        routerNodeId = U.readUuid(in);
-        lastMsgId = U.readGridUuid(in);
-        msgs = U.readCollection(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryClientReconnectMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/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 b0c7400..234efaa 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
@@ -29,14 +29,7 @@ public class TcpDiscoveryCustomEventMessage extends TcpDiscoveryAbstractMessage
     private static final long serialVersionUID = 0L;
 
     /** */
-    private Serializable msg;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryCustomEventMessage() {
-        // No-op.
-    }
+    private final Serializable msg;
 
     /**
      * @param creatorNodeId Creator node id.
@@ -53,18 +46,4 @@ public class TcpDiscoveryCustomEventMessage extends TcpDiscoveryAbstractMessage
     public Serializable message() {
         return msg;
     }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(msg);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        msg = (Serializable)in.readObject();
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDiscardMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDiscardMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDiscardMessage.java
index 1989038..9510b9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDiscardMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDiscardMessage.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -32,14 +31,7 @@ public class TcpDiscoveryDiscardMessage extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /** ID of the message to discard (this and all preceding). */
-    private IgniteUuid msgId;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryDiscardMessage() {
-        // No-op.
-    }
+    private final IgniteUuid msgId;
 
     /**
      * Constructor.
@@ -63,20 +55,6 @@ public class TcpDiscoveryDiscardMessage extends TcpDiscoveryAbstractMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeGridUuid(out, msgId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        msgId = U.readGridUuid(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryDiscardMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDuplicateIdMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDuplicateIdMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDuplicateIdMessage.java
index fcf9f00..978acb2 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDuplicateIdMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryDuplicateIdMessage.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -32,14 +31,7 @@ public class TcpDiscoveryDuplicateIdMessage extends TcpDiscoveryAbstractMessage
     private static final long serialVersionUID = 0L;
 
     /** Node with duplicate ID. */
-    private TcpDiscoveryNode node;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryDuplicateIdMessage() {
-        // No-op.
-    }
+    private final TcpDiscoveryNode node;
 
     /**
      * Constructor.
@@ -63,20 +55,6 @@ public class TcpDiscoveryDuplicateIdMessage extends TcpDiscoveryAbstractMessage
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(node);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        node = (TcpDiscoveryNode)in.readObject();
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryDuplicateIdMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeRequest.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeRequest.java
index 6debe77..99f919b 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeRequest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -30,13 +29,6 @@ public class TcpDiscoveryHandshakeRequest extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryHandshakeRequest() {
-        // No-op.
-    }
-
-    /**
      * Constructor.
      *
      * @param creatorNodeId Creator node ID.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
index f110d06..5c2f798 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -33,13 +32,6 @@ public class TcpDiscoveryHandshakeResponse extends TcpDiscoveryAbstractMessage
{
     private long order;
 
     /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryHandshakeResponse() {
-        // No-op.
-    }
-
-    /**
      * Constructor.
      *
      * @param creatorNodeId Creator node ID.
@@ -70,20 +62,6 @@ public class TcpDiscoveryHandshakeResponse extends TcpDiscoveryAbstractMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeLong(order);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        order = in.readLong();
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryHandshakeResponse.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHeartbeatMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHeartbeatMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHeartbeatMessage.java
index 65eea9f..8b07ba4 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHeartbeatMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHeartbeatMessage.java
@@ -47,17 +47,10 @@ public class TcpDiscoveryHeartbeatMessage extends TcpDiscoveryAbstractMessage
{
 
     /** Map to store nodes metrics. */
     @GridToStringExclude
-    private Map<UUID, MetricsSet> metrics;
+    private final Map<UUID, MetricsSet> metrics = new HashMap<>();
 
     /** Client node IDs. */
-    private Collection<UUID> clientNodeIds;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryHeartbeatMessage() {
-        // No-op.
-    }
+    private final Collection<UUID> clientNodeIds = new HashSet<>();
 
     /**
      * Constructor.
@@ -66,9 +59,6 @@ public class TcpDiscoveryHeartbeatMessage extends TcpDiscoveryAbstractMessage
{
      */
     public TcpDiscoveryHeartbeatMessage(UUID creatorNodeId) {
         super(creatorNodeId);
-
-        metrics = U.newHashMap(1);
-        clientNodeIds = new HashSet<>();
     }
 
     /**
@@ -156,36 +146,6 @@ public class TcpDiscoveryHeartbeatMessage extends TcpDiscoveryAbstractMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeInt(metrics.size());
-
-        if (!metrics.isEmpty()) {
-            for (Map.Entry<UUID, MetricsSet> e : metrics.entrySet()) {
-                U.writeUuid(out, e.getKey());
-                out.writeObject(e.getValue());
-            }
-        }
-
-        U.writeCollection(out, clientNodeIds);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        int metricsSize = in.readInt();
-
-        metrics = U.newHashMap(metricsSize);
-
-        for (int i = 0; i < metricsSize; i++)
-            metrics.put(U.readUuid(in), (MetricsSet)in.readObject());
-
-        clientNodeIds = U.readCollection(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryHeartbeatMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryJoinRequestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryJoinRequestMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryJoinRequestMessage.java
index e267a29..5e6b892 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryJoinRequestMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryJoinRequestMessage.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -32,17 +31,10 @@ public class TcpDiscoveryJoinRequestMessage extends TcpDiscoveryAbstractMessage
     private static final long serialVersionUID = 0L;
 
     /** New node that wants to join the topology. */
-    private TcpDiscoveryNode node;
+    private final TcpDiscoveryNode node;
 
     /** Discovery data. */
-    private Map<Integer, Object> discoData;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryJoinRequestMessage() {
-        // No-op.
-    }
+    private final Map<Integer, Object> discoData;
 
     /**
      * Constructor.
@@ -88,22 +80,6 @@ public class TcpDiscoveryJoinRequestMessage extends TcpDiscoveryAbstractMessage
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(node);
-        U.writeMap(out, discoData);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        node = (TcpDiscoveryNode)in.readObject();
-        discoData = U.readMap(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryJoinRequestMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryLoopbackProblemMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryLoopbackProblemMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryLoopbackProblemMessage.java
index fb2c2f3..c8bed37 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryLoopbackProblemMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryLoopbackProblemMessage.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -31,17 +30,10 @@ public class TcpDiscoveryLoopbackProblemMessage extends TcpDiscoveryAbstractMess
     private static final long serialVersionUID = 0L;
 
     /** Remote node addresses. */
-    private Collection<String> addrs;
+    private final Collection<String> addrs;
 
     /** Remote node host names. */
-    private Collection<String> hostNames;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryLoopbackProblemMessage() {
-        // No-op.
-    }
+    private final Collection<String> hostNames;
 
     /**
      * Constructor.
@@ -73,22 +65,6 @@ public class TcpDiscoveryLoopbackProblemMessage extends TcpDiscoveryAbstractMess
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeCollection(out, addrs);
-        U.writeCollection(out, hostNames);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        addrs = U.readCollection(in);
-        hostNames = U.readCollection(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryLoopbackProblemMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java
index f536b9e..5a71eb3 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -32,14 +31,7 @@ public class TcpDiscoveryNodeAddFinishedMessage extends TcpDiscoveryAbstractMess
     private static final long serialVersionUID = 0L;
 
     /** Added node ID. */
-    private UUID nodeId;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryNodeAddFinishedMessage() {
-        // No-op.
-    }
+    private final UUID nodeId;
 
     /**
      * Constructor.
@@ -63,20 +55,6 @@ public class TcpDiscoveryNodeAddFinishedMessage extends TcpDiscoveryAbstractMess
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeUuid(out, nodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        nodeId = U.readUuid(in);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryNodeAddFinishedMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
index b870495..7b1704e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
@@ -24,7 +24,6 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
 import org.jetbrains.annotations.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -39,7 +38,7 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /** Added node. */
-    private TcpDiscoveryNode node;
+    private final TcpDiscoveryNode node;
 
     /** Pending messages from previous node. */
     private Collection<TcpDiscoveryAbstractMessage> msgs;
@@ -61,14 +60,7 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage
{
     private Map<UUID, Map<Integer, Object>> oldNodesDiscoData;
 
     /** Start time of the first grid node. */
-    private long gridStartTime;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryNodeAddedMessage() {
-        // No-op.
-    }
+    private final long gridStartTime;
 
     /**
      * Constructor.
@@ -208,54 +200,6 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(node);
-        U.writeCollection(out, msgs);
-        U.writeGridUuid(out, discardMsgId);
-        U.writeCollection(out, top);
-        U.writeMap(out, topHist);
-        out.writeLong(gridStartTime);
-        U.writeMap(out, newNodeDiscoData);
-
-        out.writeInt(oldNodesDiscoData != null ? oldNodesDiscoData.size() : -1);
-
-        if (oldNodesDiscoData != null) {
-            for (Map.Entry<UUID, Map<Integer, Object>> entry : oldNodesDiscoData.entrySet())
{
-                U.writeUuid(out, entry.getKey());
-
-                U.writeMap(out, entry.getValue());
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        node = (TcpDiscoveryNode)in.readObject();
-        msgs = U.readCollection(in);
-        discardMsgId = U.readGridUuid(in);
-        top = U.readCollection(in);
-        topHist = U.readTreeMap(in);
-        gridStartTime = in.readLong();
-        newNodeDiscoData = U.readMap(in);
-
-        int oldNodesDiscoDataSize = in.readInt();
-
-        if (oldNodesDiscoDataSize >= 0) {
-            oldNodesDiscoData = new LinkedHashMap<>(oldNodesDiscoDataSize);
-
-            for (int i = 0; i < oldNodesDiscoDataSize; i++) {
-                UUID nodeId = U.readUuid(in);
-
-                oldNodesDiscoData.put(nodeId, U.<Integer, Object>readMap(in));
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryNodeAddedMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeFailedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeFailedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeFailedMessage.java
index 8fe7fbe..8cb8414 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeFailedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeFailedMessage.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -33,17 +32,10 @@ public class TcpDiscoveryNodeFailedMessage extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /** ID of the failed node. */
-    private UUID failedNodeId;
+    private final UUID failedNodeId;
 
     /** Internal order of the failed node. */
-    private long order;
-
-    /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryNodeFailedMessage() {
-        // No-op.
-    }
+    private final long order;
 
     /**
      * Constructor.
@@ -79,22 +71,6 @@ public class TcpDiscoveryNodeFailedMessage extends TcpDiscoveryAbstractMessage
{
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeUuid(out, failedNodeId);
-        out.writeLong(order);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        failedNodeId = U.readUuid(in);
-        order = in.readLong();
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryNodeFailedMessage.class, this, "super", super.toString());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeLeftMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeLeftMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeLeftMessage.java
index 0217385..3c2a7ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeLeftMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeLeftMessage.java
@@ -19,7 +19,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 
 import org.apache.ignite.internal.util.typedef.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -33,13 +32,6 @@ public class TcpDiscoveryNodeLeftMessage extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryNodeLeftMessage() {
-        // No-op.
-    }
-
-    /**
      * Constructor.
      *
      * @param creatorNodeId ID of the node that is about to leave the topology.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingRequest.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingRequest.java
index c42a2ee..de5b0a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingRequest.java
@@ -17,10 +17,8 @@
 
 package org.apache.ignite.spi.discovery.tcp.messages;
 
-import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -31,14 +29,7 @@ public class TcpDiscoveryPingRequest extends TcpDiscoveryAbstractMessage
{
     private static final long serialVersionUID = 0L;
 
     /** Pinged client node ID. */
-    private UUID clientNodeId;
-
-    /**
-     * For {@link Externalizable}.
-     */
-    public TcpDiscoveryPingRequest() {
-        // No-op.
-    }
+    private final UUID clientNodeId;
 
     /**
      * @param creatorNodeId Creator node ID.
@@ -56,18 +47,4 @@ public class TcpDiscoveryPingRequest extends TcpDiscoveryAbstractMessage
{
     @Nullable public UUID clientNodeId() {
         return clientNodeId;
     }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        U.writeUuid(out, clientNodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        clientNodeId = U.readUuid(in);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingResponse.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingResponse.java
index 0f7713f..6396764 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryPingResponse.java
@@ -57,18 +57,4 @@ public class TcpDiscoveryPingResponse extends TcpDiscoveryAbstractMessage
{
     public boolean clientExists() {
         return clientExists;
     }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeBoolean(clientExists);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        clientExists = in.readBoolean();
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e55e2dc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryStatusCheckMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryStatusCheckMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryStatusCheckMessage.java
index 4c0db2f..bec7093 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryStatusCheckMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryStatusCheckMessage.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.discovery.tcp.messages;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -42,22 +41,15 @@ public class TcpDiscoveryStatusCheckMessage extends TcpDiscoveryAbstractMessage
     public static final int STATUS_RECON = 2;
 
     /** Creator node. */
-    private TcpDiscoveryNode creatorNode;
+    private final TcpDiscoveryNode creatorNode;
 
     /** Failed node id. */
-    private UUID failedNodeId;
+    private final UUID failedNodeId;
 
     /** Creator node status (initialized by coordinator). */
     private int status;
 
     /**
-     * Public default no-arg constructor for {@link Externalizable} interface.
-     */
-    public TcpDiscoveryStatusCheckMessage() {
-        // No-op.
-    }
-
-    /**
      * Constructor.
      *
      * @param creatorNode Creator node.
@@ -107,24 +99,6 @@ public class TcpDiscoveryStatusCheckMessage extends TcpDiscoveryAbstractMessage
     }
 
     /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(creatorNode);
-        U.writeUuid(out, failedNodeId);
-        out.writeInt(status);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        super.readExternal(in);
-
-        creatorNode = (TcpDiscoveryNode)in.readObject();
-        failedNodeId = U.readUuid(in);
-        status = in.readInt();
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(TcpDiscoveryStatusCheckMessage.class, this, "super", super.toString());
     }


Mime
View raw message