ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [5/8] incubator-ignite git commit: # ignite-901
Date Fri, 10 Jul 2015 13:56:34 GMT
# ignite-901


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

Branch: refs/heads/ignite-901
Commit: a6222c93d25099757bcfa9fc85305d6ece4d6ebd
Parents: 00d151b
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jul 10 12:11:46 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jul 10 12:11:46 2015 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         | 26 +++++++++++---------
 .../processors/cache/GridCacheProcessor.java    |  2 +-
 .../IgniteClientReconnectCacheTest.java         |  4 +--
 3 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6222c93/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 8e7fc97..2293462 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
@@ -294,17 +294,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
     }
 
     /** {@inheritDoc} */
-    @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
{
-        locJoinEvt = new GridFutureAdapter<>();
-
-        discoCacheHist.clear();
-
-        topHist.clear();
-
-        registeredCaches.clear();
-    }
-
-    /** {@inheritDoc} */
     @Override protected void onKernalStart0() throws IgniteCheckedException {
         if (Boolean.TRUE.equals(ctx.config().isClientMode()) && !getSpi().isClientMode())
             ctx.performance().add("Enable client mode for TcpDiscoverySpi " +
@@ -385,6 +374,14 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                 Map<Long, Collection<ClusterNode>> snapshots,
                 @Nullable DiscoverySpiCustomMessage spiCustomMsg
             ) {
+                if (type == EVT_NODE_JOINED && node.isLocal() && ctx.clientDisconnected())
{
+                    discoCacheHist.clear();
+
+                    topHist.clear();
+
+                    topSnap.set(new Snapshot(AffinityTopologyVersion.ZERO, null));
+                }
+
                 DiscoveryCustomMessage customMsg = spiCustomMsg == null ? null
                     : ((CustomMessageWrapper)spiCustomMsg).delegate();
 
@@ -466,7 +463,8 @@ 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())) {
-                    gridStartTime = spi.getGridStartTime();
+                    if (gridStartTime == 0)
+                        gridStartTime = spi.getGridStartTime();
 
                     DiscoveryEvent discoEvt = new DiscoveryEvent();
 
@@ -495,6 +493,10 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                     assert node.isClient() : node;
 
                     ((IgniteKernal)ctx.grid()).onDisconnected();
+
+                    locJoinEvt = new GridFutureAdapter<>();
+
+                    registeredCaches.clear();
                 }
                 else if (type == EVT_CLIENT_NODE_RECONNECTED) {
                     assert locNode.isClient() : locNode;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6222c93/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index f58ef6d..767b62a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -951,7 +951,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /** {@inheritDoc} */
     @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException
{
-        List<GridCacheAdapter> reconnected = new ArrayList<>();
+        List<GridCacheAdapter> reconnected = new ArrayList<>(caches.size());
 
         for (GridCacheAdapter cache : caches.values()) {
             String name = cache.name();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6222c93/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
index 36ea63f..aae7162 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
@@ -966,9 +966,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
     /**
      *
      */
-    static class TestClass1 implements Serializable {
-        int val;
-    }
+    static class TestClass1 implements Serializable {}
 
     /**
      *


Mime
View raw message