ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/50] [abbrv] incubator-ignite git commit: ignite-1085: reimplemented
Date Fri, 17 Jul 2015 06:28:32 GMT
ignite-1085: reimplemented


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

Branch: refs/heads/ignite-752
Commit: 24aae82fabfebcbeb13516c3f3361ac5d726d20f
Parents: 7147f3d
Author: Denis Magda <dmagda@gridgain.com>
Authored: Wed Jul 15 13:53:53 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Wed Jul 15 13:53:53 2015 +0300

----------------------------------------------------------------------
 .../managers/discovery/GridDiscoveryManager.java | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24aae82f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index eae07ed..1bac4d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -376,6 +376,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             });
         }
 
+        final CountDownLatch startLatch = new CountDownLatch(1);
+
         spi.setListener(new DiscoverySpiListener() {
             @Override public void onDiscovery(
                 int type,
@@ -464,6 +466,13 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
                 // If this is a local join event, just save it and do not notify listeners.
                 if (type == EVT_NODE_JOINED && node.id().equals(locNode.id())) {
+                    updateTopologyVersionIfGreater(new AffinityTopologyVersion(locNode.order()),
+                        new DiscoCache(localNode(), getSpi().getRemoteNodes()));
+
+                    assert startLatch.getCount() == 1;
+
+                    startLatch.countDown();
+
                     DiscoveryEvent discoEvt = new DiscoveryEvent();
 
                     discoEvt.node(ctx.discovery().localNode());
@@ -527,6 +536,13 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
         startSpi();
 
+        try {
+            U.await(startLatch);
+        }
+        catch (IgniteInterruptedException e) {
+            throw new IgniteCheckedException("Failed to start discovery manager (thread has
been interrupted).", e);
+        }
+
         // Start segment check worker only if frequency is greater than 0.
         if (hasRslvrs && segChkFreq > 0) {
             segChkWrk = new SegmentCheckWorker();
@@ -538,9 +554,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
         locNode = spi.getLocalNode();
 
-        updateTopologyVersionIfGreater(new AffinityTopologyVersion(locNode.order()), new
DiscoCache(localNode(),
-            getSpi().getRemoteNodes()));
-
         checkAttributes(discoCache().remoteNodes());
 
         // Start discovery worker.


Mime
View raw message