ignite-5075

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

Branch: refs/heads/ignite-5075
Commit: 194446dd87b454eea501c042909b58bc9be2eb72
Parents: 11fc7ca
Author: sboikov <sboi...@gridgain.com>
Authored: Wed May 17 19:03:13 2017 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Wed May 17 19:03:13 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       | 60 ++++++++++----------
 .../CacheClientReconnectDiscoveryData.java      | 11 ++--
 .../processors/cache/ClusterCachesInfo.java     | 37 ++++++------
 .../cache/DynamicCacheDescriptor.java           | 12 ++--
 .../processors/cache/ExchangeActions.java       | 25 +++++---
 .../processors/cache/GridCacheProcessor.java    | 23 ++++----
 .../CacheDiscoveryDataConcurrentJoinTest.java   | 13 ++---
 .../testsuites/IgniteCacheTestSuite4.java       | 16 +++++-
 8 files changed, 110 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index cdc83ec..f53ff07 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -49,7 +49,6 @@ import 
org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.IgniteInClosureX;
 import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiInClosure;
@@ -323,31 +322,29 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
      * @param exchActions Cache change requests to execute on exchange.
      */
     private void updateCachesInfo(ExchangeActions exchActions) {
-        for (ExchangeActions.ActionData action : exchActions.stopRequests()) {
+        for (ExchangeActions.ActionData action : 
exchActions.cacheStopRequests()) {
             DynamicCacheDescriptor desc = 
registeredCaches.remove(action.descriptor().cacheId());
 
             assert desc != null : action.request().cacheName();
         }
 
-        for (ExchangeActions.ActionData action : 
exchActions.newAndClientCachesStartRequests()) {
+        for (ExchangeActions.ActionData action : 
exchActions.cacheStartRequests()) {
             DynamicCacheChangeRequest req = action.request();
 
-            if (!req.clientStartOnly()) {
-                Integer cacheId = CU.cacheId(req.cacheName());
+            Integer cacheId = action.descriptor().cacheId();
 
-                DynamicCacheDescriptor desc = new 
DynamicCacheDescriptor(cctx.kernalContext(),
-                    req.startCacheConfiguration(),
-                    req.cacheType(),
-                    false,
-                    action.descriptor().receivedFrom(),
-                    action.descriptor().staticallyConfigured(),
-                    req.deploymentId(),
-                    req.schema());
+            DynamicCacheDescriptor desc = new 
DynamicCacheDescriptor(cctx.kernalContext(),
+                req.startCacheConfiguration(),
+                req.cacheType(),
+                false,
+                action.descriptor().receivedFrom(),
+                action.descriptor().staticallyConfigured(),
+                req.deploymentId(),
+                req.schema());
 
-                DynamicCacheDescriptor old = registeredCaches.put(cacheId, 
desc);
+            DynamicCacheDescriptor old = registeredCaches.put(cacheId, desc);
 
-                assert old == null : old;
-            }
+            assert old == null : old;
         }
     }
 
@@ -417,6 +414,8 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
                     if (clientCacheStarted)
                         initAffinity(cacheDesc, 
cacheCtx.affinity().affinityCache(), fut, lateAffAssign);
                     else if (!req.clientStartOnly()) {
+                        assert 
fut.topologyVersion().equals(cacheCtx.startTopologyVersion());
+
                         GridAffinityAssignmentCache aff = 
cacheCtx.affinity().affinityCache();
 
                         assert 
aff.lastVersion().equals(AffinityTopologyVersion.NONE) : aff.lastVersion();
@@ -458,7 +457,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
 
         Set<Integer> stoppedCaches = null;
 
-        for (ExchangeActions.ActionData action : exchActions.stopRequests()) {
+        for (ExchangeActions.ActionData action : 
exchActions.cacheStopRequests()) {
             DynamicCacheDescriptor desc = action.descriptor();
 
             cctx.cache().blockGateway(action.request());
@@ -689,7 +688,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
                 });
             }
             else
-                initCachesAffinity(fut);
+                initAffinityNoLateAssignment(fut);
         }
     }
 
@@ -799,7 +798,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
     }
 
     /**
-     * Initialized affinity started on this exchange.
+     * Initialized affinity for cache received from node joining on this 
exchange.
      *
      * @param crd Coordinator flag.
      * @param fut Exchange future.
@@ -850,7 +849,9 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
         GridDhtPartitionsExchangeFuture fut,
         boolean fetch)
         throws IgniteCheckedException {
-        if (!fetch && canCalculateAffinity(aff, fut)) {
+        assert desc != null;
+
+        if (!fetch && canCalculateAffinity(desc, aff, fut)) {
             List<List<ClusterNode>> assignment = 
aff.calculate(fut.topologyVersion(), fut.discoveryEvent(), fut.discoCache());
 
             aff.initialize(fut.topologyVersion(), assignment);
@@ -868,11 +869,16 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
     }
 
     /**
+     * @param desc Cache descriptor.
      * @param aff Affinity.
      * @param fut Exchange future.
      * @return {@code True} if local node can calculate affinity on it's own 
for this partition map exchange.
      */
-    private boolean canCalculateAffinity(GridAffinityAssignmentCache aff, 
GridDhtPartitionsExchangeFuture fut) {
+    private boolean canCalculateAffinity(DynamicCacheDescriptor desc,
+        GridAffinityAssignmentCache aff,
+        GridDhtPartitionsExchangeFuture fut) {
+        assert desc != null : aff.cacheName();
+
         // Do not request affinity from remote nodes if affinity function is 
not centralized.
         if (!aff.centralizedAffinityFunction())
             return true;
@@ -880,11 +886,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
         // If local node did not initiate exchange or local node is the only 
cache node in grid.
         Collection<ClusterNode> affNodes = 
cctx.discovery().cacheAffinityNodes(aff.cacheId(), fut.topologyVersion());
 
-        DynamicCacheDescriptor cacheDesc = registeredCaches.get(aff.cacheId());
-
-        assert cacheDesc != null : aff.cacheName();
-
-        return fut.cacheAddedOnExchange(aff.cacheId(), 
cacheDesc.receivedFrom()) ||
+        return fut.cacheAddedOnExchange(aff.cacheId(), desc.receivedFrom()) ||
             !fut.exchangeId().nodeId().equals(cctx.localNodeId()) ||
             (affNodes.size() == 1 && affNodes.contains(cctx.localNode()));
     }
@@ -925,7 +927,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
                 waitRebalanceInfo = initAffinityOnNodeJoin(fut, crd);
         }
         else
-            initCachesAffinity(fut);
+            initAffinityNoLateAssignment(fut);
 
         synchronized (mux) {
             affCalcVer = fut.topologyVersion();
@@ -1069,7 +1071,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
             centralizedAff = true;
         }
         else {
-            initCachesAffinity(fut);
+            initAffinityNoLateAssignment(fut);
 
             centralizedAff = false;
         }
@@ -1087,7 +1089,7 @@ public class CacheAffinitySharedManager<K, V> extends 
GridCacheSharedManagerAdap
      * @param fut Exchange future.
      * @throws IgniteCheckedException If failed.
      */
-    private void initCachesAffinity(GridDhtPartitionsExchangeFuture fut) 
throws IgniteCheckedException {
+    private void initAffinityNoLateAssignment(GridDhtPartitionsExchangeFuture 
fut) throws IgniteCheckedException {
         assert !lateAffAssign;
 
         for (GridCacheContext cacheCtx : cctx.cacheContexts()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
index f970469..a30331f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
@@ -17,13 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.io.Serializable;
+import java.util.Map;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
 
-import java.io.Serializable;
-import java.util.Map;
-
 /**
  * Discovery data sent from client reconnecting to cluster.
  */
@@ -37,7 +36,7 @@ public class CacheClientReconnectDiscoveryData implements 
Serializable {
     /**
      * @param clientCaches Information about caches started on re-joining 
client node.
      */
-    public CacheClientReconnectDiscoveryData(Map<String, CacheInfo> 
clientCaches) {
+    CacheClientReconnectDiscoveryData(Map<String, CacheInfo> clientCaches) {
         this.clientCaches = clientCaches;
     }
 
@@ -77,7 +76,7 @@ public class CacheClientReconnectDiscoveryData implements 
Serializable {
          * @param nearCache Near cache flag.
          * @param flags Flags (for future usage).
          */
-        public CacheInfo(CacheConfiguration ccfg,
+        CacheInfo(CacheConfiguration ccfg,
             CacheType cacheType,
             IgniteUuid deploymentId,
             boolean nearCache,
@@ -94,7 +93,7 @@ public class CacheClientReconnectDiscoveryData implements 
Serializable {
         }
 
         /**
-         * @return Cache configuraiton.
+         * @return Cache configuration.
          */
         CacheConfiguration config() {
             return ccfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index fad03bb..28ec600 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@ -17,9 +17,19 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheExistsException;
@@ -36,25 +46,13 @@ import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.spi.discovery.DiscoveryDataBag;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
 import static org.apache.ignite.cache.CacheMode.LOCAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static 
org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.CACHE_PROC;
 
 /**
- *
+ * Logic related to cache discovery date processing.
  */
 class ClusterCachesInfo {
     /** */
@@ -129,7 +127,8 @@ class ClusterCachesInfo {
      * @param rmt Remote node.
      * @throws IgniteCheckedException If check failed.
      */
-    private void checkCache(CacheConfiguration locCfg, CacheConfiguration 
rmtCfg, UUID rmt) throws IgniteCheckedException {
+    private void checkCache(CacheConfiguration<?, ?> locCfg, 
CacheConfiguration<?, ?> rmtCfg, UUID rmt)
+        throws IgniteCheckedException {
         GridCacheAttributes rmtAttr = new GridCacheAttributes(rmtCfg);
         GridCacheAttributes locAttr = new GridCacheAttributes(locCfg);
 
@@ -277,7 +276,7 @@ class ClusterCachesInfo {
                             "client cache (a cache with the given name is not 
started): " + req.cacheName()));
                     }
                     else {
-                        CacheConfiguration ccfg = 
req.startCacheConfiguration();
+                        CacheConfiguration<?, ?> ccfg = 
req.startCacheConfiguration();
 
                         assert req.cacheType() != null : req;
                         assert F.eq(ccfg.getName(), req.cacheName()) : req;
@@ -630,7 +629,7 @@ class ClusterCachesInfo {
         }
 
         for (CacheData cacheData : cachesData.caches().values()) {
-            CacheConfiguration cfg = cacheData.cacheConfiguration();
+            CacheConfiguration<?, ?> cfg = cacheData.cacheConfiguration();
 
             DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
                 ctx,
@@ -683,7 +682,7 @@ class ClusterCachesInfo {
                 if (firstNode && 
!joinDiscoData.caches().containsKey(desc.cacheName()))
                     continue;
 
-                CacheConfiguration cfg = desc.cacheConfiguration();
+                CacheConfiguration<?, ?> cfg = desc.cacheConfiguration();
 
                 CacheJoinNodeDiscoveryData.CacheInfo locCfg = 
joinDiscoData.caches().get(cfg.getName());
 
@@ -761,7 +760,7 @@ class ClusterCachesInfo {
      */
     private void processJoiningNode(CacheJoinNodeDiscoveryData joinData, UUID 
nodeId) {
         for (CacheJoinNodeDiscoveryData.CacheInfo cacheInfo : 
joinData.templates().values()) {
-            CacheConfiguration cfg = cacheInfo.config();
+            CacheConfiguration<?, ?> cfg = cacheInfo.config();
 
             if (!registeredTemplates.containsKey(cfg.getName())) {
                 DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx,
@@ -780,7 +779,7 @@ class ClusterCachesInfo {
         }
 
         for (CacheJoinNodeDiscoveryData.CacheInfo cacheInfo : 
joinData.caches().values()) {
-            CacheConfiguration cfg = cacheInfo.config();
+            CacheConfiguration<?, ?> cfg = cacheInfo.config();
 
             if (!registeredCaches.containsKey(cfg.getName())) {
                 DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx,

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
index a9861b1..40d3706 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
@@ -98,6 +98,7 @@ public class DynamicCacheDescriptor {
      * @param rcvdFrom ID of node provided cache configuration
      * @param staticCfg {@code True} if cache statically configured.
      * @param deploymentId Deployment ID.
+     * @param schema Query schema.
      */
     @SuppressWarnings("unchecked")
     public DynamicCacheDescriptor(GridKernalContext ctx,
@@ -188,6 +189,7 @@ public class DynamicCacheDescriptor {
      * Creates and caches cache object context if needed.
      *
      * @param proc Object processor.
+     * @return Cache object context.
      */
     public CacheObjectContext cacheObjectContext(IgniteCacheObjectProcessor 
proc) throws IgniteCheckedException {
         if (objCtx == null) {
@@ -224,14 +226,14 @@ public class DynamicCacheDescriptor {
     /**
      * @return {@code True} if received in discovery data.
      */
-    public boolean receivedOnDiscovery() {
+    boolean receivedOnDiscovery() {
         return rcvdOnDiscovery;
     }
 
     /**
      * @param rcvdOnDiscovery {@code True} if received in discovery data.
      */
-    public void receivedOnDiscovery(boolean rcvdOnDiscovery) {
+    void receivedOnDiscovery(boolean rcvdOnDiscovery) {
         this.rcvdOnDiscovery = rcvdOnDiscovery;
     }
 
@@ -245,14 +247,14 @@ public class DynamicCacheDescriptor {
     /**
      * @return Topology version when node provided cache configuration was 
started.
      */
-    @Nullable public AffinityTopologyVersion receivedFromStartVersion() {
+    @Nullable AffinityTopologyVersion receivedFromStartVersion() {
         return rcvdFromVer;
     }
 
     /**
      * @param rcvdFromVer Topology version when node provided cache 
configuration was started.
      */
-    public void receivedFromStartVersion(AffinityTopologyVersion rcvdFromVer) {
+    void receivedFromStartVersion(AffinityTopologyVersion rcvdFromVer) {
         this.rcvdFromVer = rcvdFromVer;
     }
 
@@ -281,7 +283,7 @@ public class DynamicCacheDescriptor {
     /**
      * @param clientCacheStartVer Version when client cache on local node was 
started.
      */
-    public void clientCacheStartVersion(AffinityTopologyVersion 
clientCacheStartVer) {
+    void clientCacheStartVersion(AffinityTopologyVersion clientCacheStartVer) {
         this.clientCacheStartVer = clientCacheStartVer;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index 99fd29d..eac1120 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@ -17,17 +17,16 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.internal.util.typedef.F;
-
-import java.util.ArrayList;
-import java.util.List;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -55,7 +54,7 @@ public class ExchangeActions {
     /**
      * @return {@code True} if server nodes should not participate in exchange.
      */
-    public boolean clientOnlyExchange() {
+    boolean clientOnlyExchange() {
         return F.isEmpty(cachesToStart) &&
             F.isEmpty(cachesToStop) &&
             F.isEmpty(cachesToResetLostParts);
@@ -65,7 +64,7 @@ public class ExchangeActions {
      * @param nodeId Local node ID.
      * @return Close cache requests.
      */
-    public List<DynamicCacheChangeRequest> closeRequests(UUID nodeId) {
+    List<DynamicCacheChangeRequest> closeRequests(UUID nodeId) {
         List<DynamicCacheChangeRequest> res = null;
 
         if (cachesToClose != null) {
@@ -83,6 +82,13 @@ public class ExchangeActions {
     }
 
     /**
+     * @return New caches start requests.
+     */
+    Collection<ActionData> cacheStartRequests() {
+        return cachesToStart != null ? cachesToStart.values() : 
Collections.<ActionData>emptyList();
+    }
+
+    /**
      * @return Start cache requests.
      */
     Collection<ActionData> newAndClientCachesStartRequests() {
@@ -104,8 +110,8 @@ public class ExchangeActions {
     /**
      * @return Stop cache requests.
      */
-    Collection<ActionData> stopRequests() {
-        return cachesToStop != null ? cachesToStop.values() : 
Collections.EMPTY_LIST;
+    Collection<ActionData> cacheStopRequests() {
+        return cachesToStop != null ? cachesToStop.values() : 
Collections.<ActionData>emptyList();
     }
 
     /**
@@ -194,7 +200,10 @@ public class ExchangeActions {
         return false;
     }
 
-    public void newClusterState(ClusterState state) {
+    /**
+     * @param state New cluster state.
+     */
+    void newClusterState(ClusterState state) {
         assert state != null;
 
         newState = state;

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/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 9ebfc4e..06ad62d 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
@@ -641,9 +641,9 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 
             Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates = new 
HashMap<>();
 
-            registerCacheFromConfig(caches, templates);
+            addCacheOnJoinFromConfig(caches, templates);
 
-            registerCacheFromPersistentStore(caches, templates);
+            addCacheOnJoinFromPersistentStore(caches, templates);
 
             CacheJoinNodeDiscoveryData discoData = new 
CacheJoinNodeDiscoveryData(IgniteUuid.randomUuid(),
                 caches,
@@ -669,7 +669,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCache(CacheConfiguration cfg,
+    private void addCacheOnJoin(CacheConfiguration cfg,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates) throws 
IgniteCheckedException {
         CU.validateCacheName(cfg.getName());
@@ -717,7 +717,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCacheFromConfig(
+    private void addCacheOnJoinFromConfig(
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates
     ) throws IgniteCheckedException {
@@ -730,7 +730,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 
             cfgs[i] = cfg; // Replace original configuration value.
 
-            registerCache(cfg, caches, templates);
+            addCacheOnJoin(cfg, caches, templates);
         }
     }
 
@@ -739,7 +739,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCacheFromPersistentStore(
+    private void addCacheOnJoinFromPersistentStore(
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates
     ) throws IgniteCheckedException {
@@ -760,7 +760,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
                     CacheConfiguration cfg = 
sharedCtx.pageStore().readConfiguration(name);
 
                     if (cfg != null)
-                        registerCache(cfg, caches, templates);
+                        addCacheOnJoin(cfg, caches, templates);
                 }
             }
         }
@@ -791,12 +791,13 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
         ClusterNode locNode = ctx.discovery().localNode();
 
         try {
-            boolean check = !ctx.config().isDaemon() && 
!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
+            boolean checkConsistency =
+                !ctx.config().isDaemon() && 
!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
 
-            if (check)
+            if (checkConsistency)
                 checkConsistency();
 
-            cachesInfo.onKernalStart(check);
+            cachesInfo.onKernalStart(checkConsistency);
 
             boolean currStatus = ctx.state().active();
 
@@ -1917,7 +1918,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
         }
 
         if (exchActions != null && err == null) {
-            for (ExchangeActions.ActionData action : 
exchActions.stopRequests()) {
+            for (ExchangeActions.ActionData action : 
exchActions.cacheStopRequests()) {
                 stopGateway(action.request());
 
                 prepareCacheStop(action.request());

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
index 2f11c86..a80830a 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
@@ -17,6 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache.distributed;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
 import org.apache.ignite.cluster.ClusterNode;
@@ -32,13 +38,6 @@ import 
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessa
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 4a5d2d8..e423098 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -82,7 +82,19 @@ import 
org.apache.ignite.internal.processors.cache.IgniteStartCacheInTransaction
 import 
org.apache.ignite.internal.processors.cache.IgniteStartCacheInTransactionSelfTest;
 import 
org.apache.ignite.internal.processors.cache.IgniteSystemCacheOnClientTest;
 import 
org.apache.ignite.internal.processors.cache.MarshallerCacheJobRunNodeRestartTest;
-import org.apache.ignite.internal.processors.cache.distributed.*;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheAffinityEarlyTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheAtomicPrimarySyncBackPressureTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheDiscoveryDataConcurrentJoinTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheGetFutureHangsSelfTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheNoValueClassOnServerNodeTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.CacheStartOnJoinTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteCacheCreatePutMultiNodeSelfTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteCacheCreatePutTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteCachePrimarySyncTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteCacheReadFromBackupTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteCacheSingleGetMessageTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteTxCachePrimarySyncTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.IgniteTxCacheWriteSynchronizationModesMultithreadedTest;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheDhtTxPreloadSelfTest;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheLockFailoverSelfTest;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheMultiTxLockSelfTest;
@@ -200,7 +212,6 @@ public class IgniteCacheTestSuite4 extends TestSuite {
 
         suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class);
 
-        suite.addTestSuite(IgniteCacheStartTest.class);
         suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class);
         suite.addTestSuite(IgniteDynamicCacheWithConfigStartSelfTest.class);
         suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class);
@@ -213,6 +224,7 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(IgniteCacheCreatePutMultiNodeSelfTest.class);
         suite.addTestSuite(IgniteCacheCreatePutTest.class);
         suite.addTestSuite(CacheStartOnJoinTest.class);
+        suite.addTestSuite(IgniteCacheStartTest.class);
         suite.addTestSuite(CacheDiscoveryDataConcurrentJoinTest.class);
 
         suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class);

Reply via email to