ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/6] ignite git commit: ignite-4154
Date Wed, 02 Nov 2016 11:01:27 GMT
ignite-4154


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

Branch: refs/heads/ignite-4154-2
Commit: f74c9f4e24dc49176fc19e84069bfc10c53133e5
Parents: 17b8291
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Nov 2 09:57:25 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Nov 2 09:57:25 2016 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 53 ++++----------------
 .../messages/TcpDiscoveryNodeAddedMessage.java  |  7 +++
 2 files changed, 17 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f74c9f4e/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 9179ddb..e182177 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -2159,56 +2159,23 @@ class ServerImpl extends TcpDiscoveryImpl {
         void discard(IgniteUuid id, boolean custom) {
             if (custom)
                 customDiscardId = id;
-            else
+            else {
                 discardId = id;
 
-            cleanup();
-        }
-
-        /**
-         *
-         */
-        void cleanup() {
-            if (discardId != null && !msgs.containsKey(discardId))
-                return;
-
-            if (customDiscardId != null && !msgs.containsKey(customDiscardId))
-                return;
-
-            Iterator<TcpDiscoveryAbstractMessage> msgIt = msgs.values().iterator();
-
-            boolean skipMsg = discardId != null;
-            boolean skipCustomMsg = customDiscardId != null;
+                TcpDiscoveryAbstractMessage msg = msgs.get(id);
 
-            while (msgIt.hasNext()) {
-                TcpDiscoveryAbstractMessage msg0 = msgIt.next();
+                if (msg instanceof TcpDiscoveryNodeAddedMessage) {
+                    TcpDiscoveryNodeAddedMessage msg0 = (TcpDiscoveryNodeAddedMessage)msg;
 
-                if (msg0 instanceof TcpDiscoveryCustomEventMessage) {
-                    if (skipCustomMsg) {
-                        assert customDiscardId != null;
-
-                        if (F.eq(customDiscardId, msg0.id()))
-                            skipCustomMsg = false;
-                        else
-                            msgIt.remove();
-
-                        continue;
-                    }
+                    msg0.oldNodesDiscoveryData(null);
+                    msg0.newNodeDiscoveryData(null);
                 }
-                else {
-                    if (skipMsg) {
-                        assert discardId != null;
+                else if (msg instanceof TcpDiscoveryNodeAddFinishedMessage) {
+                    TcpDiscoveryNodeAddFinishedMessage msg0 = (TcpDiscoveryNodeAddFinishedMessage)msg;
 
-                        if (F.eq(discardId, msg0.id()))
-                            skipMsg = false;
-                        else
-                            msgIt.remove();
-
-                        continue;
-                    }
+                    msg0.clientDiscoData(null);
+                    msg0.clientNodeAttributes(null);
                 }
-
-                break;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f74c9f4e/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 bd52c04..7b8e5c8 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
@@ -229,6 +229,13 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage
{
     }
 
     /**
+     * @param newNodeDiscoData Discovery data from new node.
+     */
+    public void newNodeDiscoveryData(Map<Integer, byte[]> newNodeDiscoData) {
+        this.newNodeDiscoData = newNodeDiscoData;
+    }
+
+    /**
      * @return Discovery data from old nodes.
      */
     public Map<UUID, Map<Integer, byte[]>> oldNodesDiscoveryData() {


Mime
View raw message