ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [2/8] incubator-ignite git commit: IGNITE-45 - Fixing tests.
Date Tue, 17 Mar 2015 03:03:20 GMT
IGNITE-45 - Fixing tests.


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

Branch: refs/heads/ignite-45
Commit: 3c757939731979e72546ec836540a0671105457f
Parents: bd595e8
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Mon Mar 16 15:47:53 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Mon Mar 16 15:47:53 2015 -0700

----------------------------------------------------------------------
 .../cache/eviction/CacheEvictionFilter.java     |  13 +-
 .../eviction/igfs/CacheIgfsEvictionFilter.java  |   3 +-
 .../apache/ignite/internal/GridComponent.java   |   6 +-
 .../ignite/internal/GridPluginComponent.java    |   2 +-
 .../internal/managers/GridManagerAdapter.java   |   2 +-
 .../discovery/GridDiscoveryManager.java         |   4 +-
 .../processors/GridProcessorAdapter.java        |   2 +-
 .../cache/DynamicCacheDescriptor.java           |  45 +++---
 .../processors/cache/GridCacheAttributes.java   |  13 +-
 .../processors/cache/GridCacheProcessor.java    | 127 +++++++--------
 .../continuous/GridContinuousProcessor.java     |   2 +-
 .../plugin/IgnitePluginProcessor.java           |   2 +-
 .../spi/discovery/DiscoverySpiDataExchange.java |   8 +-
 .../discovery/tcp/TcpClientDiscoverySpi.java    |  19 +--
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  14 +-
 .../messages/TcpDiscoveryNodeAddedMessage.java  |  26 +--
 ...idCacheConfigurationConsistencySelfTest.java | 158 ++++++-------------
 ...ridCacheConfigurationValidationSelfTest.java |  35 ++--
 .../discovery/AbstractDiscoverySelfTest.java    |   2 +-
 .../tcp/TcpDiscoverySpiStartStopSelfTest.java   |   2 +-
 .../junits/spi/GridSpiAbstractTest.java         |   5 +-
 21 files changed, 229 insertions(+), 261 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
index a2f532f..bb26a47 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
@@ -17,19 +17,24 @@
 
 package org.apache.ignite.cache.eviction;
 
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+
 import javax.cache.*;
+import java.io.*;
+import java.util.*;
 
 /**
  * Eviction filter to specify which entries should not be evicted. Not applicable when
- * calling explicit evict via {@link org.apache.ignite.cache.Entry#evict()}.
- * If {@link #evictAllowed(org.apache.ignite.cache.Entry)} method returns {@code false} then eviction
+ * calling explicit evict via {@link IgniteCache#localEvict(Collection)}.
+ * If {@link #evictAllowed(Cache.Entry)} method returns {@code false} then eviction
  * policy will not be notified and entry will never be evicted.
  * <p>
- * Eviction filter can be configured via {@link org.apache.ignite.configuration.CacheConfiguration#getEvictionFilter()}
+ * Eviction filter can be configured via {@link CacheConfiguration#getEvictionFilter()}
  * configuration property. Default value is {@code null} which means that all
  * cache entries will be tracked by eviction policy.
  */
-public interface CacheEvictionFilter<K, V> {
+public interface CacheEvictionFilter<K, V> extends Serializable {
     /**
      * Checks if entry may be evicted from cache.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java
index c09609f..47f97e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java
@@ -21,12 +21,11 @@ import org.apache.ignite.cache.eviction.*;
 import org.apache.ignite.internal.processors.igfs.*;
 
 import javax.cache.*;
-import java.io.*;
 
 /**
  * IGFS eviction filter which will not evict blocks of particular files.
  */
-public class CacheIgfsEvictionFilter implements CacheEvictionFilter, Serializable {
+public class CacheIgfsEvictionFilter implements CacheEvictionFilter {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
index e226bf7..47923e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
@@ -86,11 +86,11 @@ public interface GridComponent {
     /**
      * Receives discovery data object from remote nodes (called
      * on new node during discovery process).
-     *
-     * @param nodeId Remote node ID.
+     * @param joiningNodeId Joining node ID.
+     * @param rmtNodeId Remote node ID for which data is provided.
      * @param data Discovery data object or {@code null} if nothing was
      */
-    public void onDiscoveryDataReceived(UUID nodeId, Object data);
+    public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Object data);
 
     /**
      * Prints memory statistics (sizes of internal structures, etc.).

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
index 915eda6..dca2e91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
@@ -78,7 +78,7 @@ public class GridPluginComponent implements GridComponent {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+    @Override public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index 83841e2..56083ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -568,7 +568,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+    @Override public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/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 fe3dc1b..3563f3f 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
@@ -438,7 +438,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
                 return data;
             }
 
-            @Override public void onExchange(UUID nodeId, Map<Integer, Object> data) {
+            @Override public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Object> data) {
                 for (Map.Entry<Integer, Object> e : data.entrySet()) {
                     GridComponent comp = null;
 
@@ -451,7 +451,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
                     }
 
                     if (comp != null)
-                        comp.onDiscoveryDataReceived(nodeId, e.getValue());
+                        comp.onDiscoveryDataReceived(joiningNodeId, nodeId, e.getValue());
                     else
                         U.warn(log, "Received discovery data for unknown component: " + e.getKey());
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
index cbd8991..f00aac3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
@@ -71,7 +71,7 @@ public abstract class GridProcessorAdapter implements GridProcessor {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+    @Override public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/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 3a900ed..38c5b77 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
@@ -17,12 +17,13 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 
+import java.util.*;
+
 /**
  * Cache start descriptor.
  */
@@ -37,9 +38,6 @@ public class DynamicCacheDescriptor {
     /** Cancelled flag. */
     private boolean cancelled;
 
-    /** Validation error. */
-    private IgniteCheckedException validationError;
-
     /** Locally configured flag. */
     private boolean locCfg;
 
@@ -49,6 +47,9 @@ public class DynamicCacheDescriptor {
     /** Started flag. */
     private boolean started;
 
+    /** */
+    private volatile Map<UUID, CacheConfiguration> rmtCfgs;
+
     /**
      * @param cacheCfg Cache configuration.
      */
@@ -134,31 +135,37 @@ public class DynamicCacheDescriptor {
     }
 
     /**
-     * @return {@code True} if descriptor is valid and cache should be started.
+     * @param nodeId Remote node ID.
+     * @return Configuration.
      */
-    public boolean valid() {
-        return validationError == null;
+    public CacheConfiguration remoteConfiguration(UUID nodeId) {
+        Map<UUID, CacheConfiguration> cfgs = rmtCfgs;
+
+        return cfgs == null ? null : cfgs.get(nodeId);
     }
 
     /**
-     * @throws IgniteCheckedException If validation failed.
+     * @param nodeId Remote node ID.
+     * @param cfg Remote node configuration.
      */
-    public void checkValid() throws IgniteCheckedException {
-        if (validationError != null)
-            throw validationError;
-    }
+    public void addRemoteConfiguration(UUID nodeId, CacheConfiguration cfg) {
+        Map<UUID, CacheConfiguration> cfgs = rmtCfgs;
 
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(DynamicCacheDescriptor.class, this, "cacheName", cacheCfg.getName());
+        if (cfgs == null)
+            rmtCfgs = cfgs = new HashMap<>();
+
+        cfgs.put(nodeId, cfg);
     }
 
     /**
-     * Sets validation error.
      *
-     * @param e Validation error.
      */
-    public void validationFailed(IgniteCheckedException e) {
-        validationError = e;
+    public void clearRemoteConfigurations() {
+        rmtCfgs = null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(DynamicCacheDescriptor.class, this, "cacheName", cacheCfg.getName());
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index bf89b98..20522f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
-import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -42,17 +41,11 @@ public class GridCacheAttributes implements Serializable {
     /** Cache configuration. */
     private CacheConfiguration ccfg;
 
-    /** Cache store class name. */
-    private String storeClsName;
-
     /**
      * @param cfg Cache configuration.
-     * @param store Cache store.
      */
-    public GridCacheAttributes(CacheConfiguration cfg, @Nullable CacheStore<?, ?> store) {
+    public GridCacheAttributes(CacheConfiguration cfg) {
         ccfg = cfg;
-
-        storeClsName = className(store);
     }
 
     /**
@@ -187,8 +180,8 @@ public class GridCacheAttributes implements Serializable {
     /**
      * @return Store class name.
      */
-    public String storeClassName() {
-        return storeClsName;
+    public String storeFactoryClassName() {
+        return className(ccfg.getCacheStoreFactory());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/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 8e3dea9..7dfa288 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
@@ -118,9 +118,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     /** Must use JDK marshaller since it is used by discovery to fire custom events. */
     private Marshaller marshaller = new JdkMarshaller();
 
-    /** */
-    private volatile boolean validateCfg = true;
-
     /**
      * @param ctx Kernal context.
      */
@@ -584,7 +581,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             !ctx.config().getTransactionConfiguration().isTxSerializableEnabled());
 
         for (int i = 0; i < cfgs.length; i++) {
-            CacheConfiguration<?, ?> cfg = deepCopy(cfgs[i]);
+            CacheConfiguration<?, ?> cfg = new CacheConfiguration(cfgs[i]);
 
             CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, cfg.getName(), cfg);
 
@@ -593,7 +590,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             cfgs[i] = cfg; // Replace original configuration value.
 
-            if (caches.containsKey(maskNull(cfg.getName()))) {
+            String masked = maskNull(cfg.getName());
+
+            if (registeredCaches.containsKey(masked)) {
                 String cacheName = cfg.getName();
 
                 if (cacheName != null)
@@ -609,7 +608,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             desc.locallyConfigured(true);
             desc.staticallyConfigured(true);
 
-            registeredCaches.put(maskNull(cfg.getName()), desc);
+            registeredCaches.put(masked, desc);
 
             ctx.discovery().setCacheFilter(
                 cfg.getName(),
@@ -627,12 +626,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         for (GridCacheSharedManager mgr : sharedCtx.managers())
             mgr.start(sharedCtx);
 
-        for (Map.Entry<String, GridCacheAdapter<?, ?>> e : caches.entrySet()) {
-            GridCacheAdapter cache = e.getValue();
-
-            jCacheProxies.put(maskNull(e.getKey()), new IgniteCacheProxy(cache.context(), cache, null, false));
-        }
-
         transactions = new IgniteTransactionsImpl(sharedCtx);
 
         if (log.isDebugEnabled())
@@ -645,6 +638,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (ctx.config().isDaemon())
             return;
 
+        ClusterNode locNode = ctx.discovery().localNode();
+
         if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
             for (ClusterNode n : ctx.discovery().remoteNodes()) {
                 checkTransactionConfiguration(n);
@@ -654,25 +649,29 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                 CU.checkAttributeMismatch(log, null, n.id(), "deploymentMode", "Deployment mode",
                     locDepMode, rmtDepMode, true);
+
+                for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+                    CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
+
+                    if (rmtCfg != null)
+                        checkCache(desc.cacheConfiguration(), rmtCfg, n);
+                }
             }
         }
 
-        validateCfg = false;
-
         // Start dynamic caches received from collect discovery data.
         for (DynamicCacheDescriptor desc : registeredCaches.values()) {
-            // Check if validation failed on node start.
-            desc.checkValid();
-
             boolean started = desc.onStart();
 
             assert started : "Failed to change started flag for locally configured cache: " + desc;
 
+            desc.clearRemoteConfigurations();
+
             CacheConfiguration ccfg = desc.cacheConfiguration();
 
             IgnitePredicate filter = ccfg.getNodeFilter();
 
-            if (filter.apply(ctx.discovery().localNode())) {
+            if (filter.apply(locNode)) {
                 CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
                 GridCacheContext ctx = createCache(ccfg, cacheObjCtx);
@@ -1454,7 +1453,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         Collection<DynamicCacheChangeRequest> reqs = new ArrayList<>(registeredCaches.size());
 
         for (DynamicCacheDescriptor desc : registeredCaches.values()) {
-            if (!desc.cancelled() && desc.valid()) {
+            if (!desc.cancelled()) {
                 DynamicCacheChangeRequest req = new DynamicCacheChangeRequest((UUID)null);
 
                 req.startCacheConfiguration(desc.cacheConfiguration());
@@ -1473,41 +1472,21 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+    @Override public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Object data) {
         if (data instanceof DynamicCacheChangeBatch) {
             DynamicCacheChangeBatch batch = (DynamicCacheChangeBatch)data;
 
             for (DynamicCacheChangeRequest req : batch.requests()) {
                 DynamicCacheDescriptor existing = registeredCaches.get(maskNull(req.cacheName()));
 
-                try {
-                    if (req.isStart() && !req.clientStartOnly()) {
-                        CacheConfiguration ccfg = req.startCacheConfiguration();
+                if (req.isStart() && !req.clientStartOnly()) {
+                    CacheConfiguration ccfg = req.startCacheConfiguration();
 
-                        if (existing != null) {
-                            if (validateCfg)
-                                checkCache(existing.cacheConfiguration(), ccfg, nodeId);
+                    if (existing != null) {
+                        if (existing.locallyConfigured()) {
+                            existing.deploymentId(req.deploymentId());
 
-                            if (existing.valid()) {
-                                existing.deploymentId(req.deploymentId());
-
-                                ctx.discovery().setCacheFilter(
-                                    req.cacheName(),
-                                    ccfg.getNodeFilter(),
-                                    ccfg.getNearConfiguration() != null,
-                                    ccfg.getCacheMode() == LOCAL);
-                            }
-                        }
-                        else {
-                            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
-                                ccfg,
-                                req.deploymentId());
-
-                            // Received statically configured cache.
-                            if (req.initiatingNodeId() == null)
-                                desc.staticallyConfigured(true);
-
-                            registeredCaches.put(maskNull(req.cacheName()), desc);
+                            existing.addRemoteConfiguration(rmtNodeId, req.startCacheConfiguration());
 
                             ctx.discovery().setCacheFilter(
                                 req.cacheName(),
@@ -1516,9 +1495,23 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                                 ccfg.getCacheMode() == LOCAL);
                         }
                     }
-                }
-                catch (IgniteCheckedException e) {
-                    existing.validationFailed(e);
+                    else {
+                        DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+                            ccfg,
+                            req.deploymentId());
+
+                        // Received statically configured cache.
+                        if (req.initiatingNodeId() == null)
+                            desc.staticallyConfigured(true);
+
+                        registeredCaches.put(maskNull(req.cacheName()), desc);
+
+                        ctx.discovery().setCacheFilter(
+                            req.cacheName(),
+                            ccfg.getNodeFilter(),
+                            ccfg.getNearConfiguration() != null,
+                            ccfg.getCacheMode() == LOCAL);
+                    }
                 }
             }
 
@@ -1559,7 +1552,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             req.deploymentId(IgniteUuid.randomUuid());
 
             try {
-                CacheConfiguration cfg = deepCopy(ccfg);
+                CacheConfiguration cfg = new CacheConfiguration(ccfg);
 
                 CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, cfg.getName(), cfg);
 
@@ -1824,13 +1817,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     /**
      * Checks that remote caches has configuration compatible with the local.
      *
-     * @param rmt Remote node ID.
+     * @param rmtNode Remote node.
      * @throws IgniteCheckedException If check failed.
      */
-    private void checkCache(CacheConfiguration locCfg, CacheConfiguration rmtCfg, UUID rmt)
+    private void checkCache(CacheConfiguration locCfg, CacheConfiguration rmtCfg, ClusterNode rmtNode)
         throws IgniteCheckedException {
-        GridCacheAttributes rmtAttr = new GridCacheAttributes(rmtCfg, null);
-        GridCacheAttributes locAttr = new GridCacheAttributes(locCfg, null);
+        ClusterNode locNode = ctx.discovery().localNode();
+
+        UUID rmt = rmtNode.id();
+
+        GridCacheAttributes rmtAttr = new GridCacheAttributes(rmtCfg);
+        GridCacheAttributes locAttr = new GridCacheAttributes(locCfg);
 
         CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cacheMode", "Cache mode",
             locAttr.cacheMode(), rmtAttr.cacheMode(), true);
@@ -1845,6 +1842,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cachePreloadMode",
                 "Cache preload mode", locAttr.cacheRebalanceMode(), rmtAttr.cacheRebalanceMode(), true);
 
+            if (locCfg.getAtomicityMode() == TRANSACTIONAL ||
+                (rmtCfg.getNodeFilter().apply(rmtNode) && locCfg.getNodeFilter().apply(locNode)))
+                CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "storeFactory", "Store factory",
+                    locAttr.storeFactoryClassName(), rmtAttr.storeFactoryClassName(), true);
+
             CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cacheAffinity", "Cache affinity",
                 locAttr.cacheAffinityClassName(), rmtAttr.cacheAffinityClassName(), true);
 
@@ -1957,7 +1959,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param locNode Local node.
      * @return {@code True} if store check should be skipped.
      */
-    private boolean skipStoreConsistencyCheck(CacheConfiguration cfg, ClusterNode rmtNode, ClusterNode locNode) {
+    private boolean checkStoreConsistency(CacheConfiguration cfg, ClusterNode rmtNode, ClusterNode locNode) {
         return
             // In atomic mode skip check if either local or remote node is client.
             cfg.getAtomicityMode() == ATOMIC &&
@@ -2219,7 +2221,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @return All configured public cache instances.
      */
     public Collection<IgniteCacheProxy<?, ?>> publicCaches() {
-        List<IgniteCacheProxy<?, ?>> res = new ArrayList<>(jCacheProxies.size());
+        Collection<IgniteCacheProxy<?, ?>> res = new ArrayList<>(jCacheProxies.size());
 
         for (Map.Entry<String, IgniteCacheProxy<?, ?>> entry : jCacheProxies.entrySet()) {
             if (!sysCaches.contains(entry.getKey()))
@@ -2409,14 +2411,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param src Object to copy.
-     * @return Deep copy of the object.
+     * @param val Object to check.
      */
-    private <T> T deepCopy(T src) throws IgniteCheckedException {
-        if (src == null)
-            return null;
+    private void checkSerializable(Object val) throws IgniteCheckedException {
+        if (val == null)
+            return;
 
-        return marshaller.unmarshal(marshaller.marshal(src), src.getClass().getClassLoader());
+        marshaller.unmarshal(marshaller.marshal(val), val.getClass().getClassLoader());
     }
 
     /**
@@ -2441,7 +2442,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      *
      */
     @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor")
-    public class DynamicCacheStartFuture extends GridFutureAdapter<Object> {
+    private class DynamicCacheStartFuture extends GridFutureAdapter<Object> {
         /** Start ID. */
         private IgniteUuid deploymentId;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 78fd63c..2351eb9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -349,7 +349,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object obj) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, UUID rmtNodeId, Object obj) {
         DiscoveryData data = (DiscoveryData)obj;
 
         if (!ctx.isDaemon() && data != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
index 05f227b..bf5d61f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
@@ -187,7 +187,7 @@ public class IgnitePluginProcessor extends GridProcessorAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, UUID rmtNodeId, Object data) {
         Map<String, Object> discData = (Map<String, Object>)data;
 
         if (discData != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
index 788dc40..29f6b5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
@@ -30,16 +30,16 @@ public interface DiscoverySpiDataExchange {
      * on new node that joins topology to transfer its data to existing
      * nodes and on all existing nodes to transfer their data to new node.
      *
-     * @param nodeId ID of new node that joins topology.
+     * @param joiningNodeId ID of new node that joins topology.
      * @return Collection of discovery data objects from different components.
      */
-    public Map<Integer, Object> collect(UUID nodeId);
+    public Map<Integer, Object> collect(UUID joiningNodeId);
 
     /**
      * Notifies discovery manager about data received from remote node.
      *
-     * @param nodeId Remote node ID.
+     * @param joiningNodeId Remote node ID.
      * @param data Collection of discovery data objects from different components.
      */
-    public void onExchange(UUID nodeId, Map<Integer, Object> data);
+    public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Object> data);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 17d8386..d0b78c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -27,6 +27,7 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.discovery.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
 import org.apache.ignite.spi.discovery.tcp.messages.*;
 import org.jdk8.backport.*;
@@ -46,7 +47,7 @@ import static org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeat
  * <p>
  * This discovery SPI requires at least on server node configured with
  * {@link TcpDiscoverySpi}. It will try to connect to random IP taken from
- * {@link org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder} which should point to one of these server
+ * {@link TcpDiscoveryIpFinder} which should point to one of these server
  * nodes and will maintain connection only with this node (will not enter the ring).
  * If this connection is broken, it will try to reconnect using addresses from
  * the same IP finder.
@@ -381,7 +382,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
     /**
      * @param recon Reconnect flag.
      * @return Whether joined successfully.
-     * @throws org.apache.ignite.spi.IgniteSpiException In case of error.
+     * @throws IgniteSpiException In case of error.
      */
     private boolean joinTopology(boolean recon) throws IgniteSpiException {
         if (!recon)
@@ -735,9 +736,9 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
 
                         stats.onMessageReceived(msg);
 
-                        IgniteSpiException err = null;
-
                         if (joinLatch.getCount() > 0) {
+                            IgniteSpiException err = null;
+
                             if (msg instanceof TcpDiscoveryDuplicateIdMessage)
                                 err = duplicateIdError((TcpDiscoveryDuplicateIdMessage)msg);
                             else if (msg instanceof TcpDiscoveryAuthFailedMessage)
@@ -893,11 +894,11 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                         if (msg.topologyHistory() != null)
                             topHist.putAll(msg.topologyHistory());
 
-                        Collection<Map<Integer, Object>> dataList = msg.oldNodesDiscoveryData();
+                        Map<UUID, Map<Integer, Object>> dataMap = msg.oldNodesDiscoveryData();
 
-                        if (dataList != null) {
-                            for (Map<Integer, Object> discoData : dataList)
-                                exchange.onExchange(newNodeId, discoData);
+                        if (dataMap != null) {
+                            for (Map.Entry<UUID, Map<Integer, Object>> entry : dataMap.entrySet())
+                                exchange.onExchange(newNodeId, entry.getKey(), entry.getValue());
                         }
 
                         locNode.setAttributes(node.attributes());
@@ -920,7 +921,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                     Map<Integer, Object> data = msg.newNodeDiscoveryData();
 
                     if (data != null)
-                        exchange.onExchange(newNodeId, data);
+                        exchange.onExchange(newNodeId, newNodeId, data);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 8981dd9..9dbdd66 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -3652,9 +3652,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                     Map<Integer, Object> data = msg.newNodeDiscoveryData();
 
                     if (data != null)
-                        exchange.onExchange(node.id(), data);
+                        exchange.onExchange(node.id(), node.id(), data);
 
-                    msg.addDiscoveryData(exchange.collect(node.id()));
+                    msg.addDiscoveryData(locNodeId, exchange.collect(node.id()));
                 }
 
                 if (log.isDebugEnabled())
@@ -3664,7 +3664,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
             if (msg.verified() && locNodeId.equals(node.id())) {
                 // Discovery data.
-                Collection<Map<Integer, Object>> dataList;
+                Map<UUID, Map<Integer, Object>> dataMap;
 
                 synchronized (mux) {
                     if (spiState == CONNECTING && locNode.internalOrder() != node.internalOrder()) {
@@ -3689,7 +3689,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                             if (log.isDebugEnabled())
                                 log.debug("Restored topology from node added message: " + ring);
 
-                            dataList = msg.oldNodesDiscoveryData();
+                            dataMap = msg.oldNodesDiscoveryData();
 
                             topHist.clear();
                             topHist.putAll(msg.topologyHistory());
@@ -3722,9 +3722,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                 }
 
                 // Notify outside of synchronized block.
-                if (dataList != null) {
-                    for (Map<Integer, Object> discoData : dataList)
-                        exchange.onExchange(node.id(), discoData);
+                if (dataMap != null) {
+                    for (Map.Entry<UUID, Map<Integer, Object>> entry : dataMap.entrySet())
+                        exchange.onExchange(node.id(), entry.getKey(), entry.getValue());
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/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 7c1b33b..b870495 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
@@ -58,7 +58,7 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage {
     private Map<Integer, Object> newNodeDiscoData;
 
     /** Discovery data from old nodes. */
-    private Collection<Map<Integer, Object>> oldNodesDiscoData;
+    private Map<UUID, Map<Integer, Object>> oldNodesDiscoData;
 
     /** Start time of the first grid node. */
     private long gridStartTime;
@@ -91,7 +91,7 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage {
         this.newNodeDiscoData = newNodeDiscoData;
         this.gridStartTime = gridStartTime;
 
-        oldNodesDiscoData = new LinkedList<>();
+        oldNodesDiscoData = new LinkedHashMap<>();
     }
 
     /**
@@ -178,18 +178,18 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage {
     /**
      * @return Discovery data from old nodes.
      */
-    public Collection<Map<Integer, Object>> oldNodesDiscoveryData() {
+    public Map<UUID, Map<Integer, Object>> oldNodesDiscoveryData() {
         return oldNodesDiscoData;
     }
 
     /**
      * @param discoData Discovery data to add.
      */
-    public void addDiscoveryData(Map<Integer, Object> discoData) {
+    public void addDiscoveryData(UUID nodeId, Map<Integer, Object> discoData) {
         // Old nodes disco data may be null if message
         // makes more than 1 pass due to stopping of the nodes in topology.
         if (oldNodesDiscoData != null)
-            oldNodesDiscoData.add(discoData);
+            oldNodesDiscoData.put(nodeId, discoData);
     }
 
     /**
@@ -222,8 +222,11 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage {
         out.writeInt(oldNodesDiscoData != null ? oldNodesDiscoData.size() : -1);
 
         if (oldNodesDiscoData != null) {
-            for (Map<Integer, Object> map : oldNodesDiscoData)
-                U.writeMap(out, map);
+            for (Map.Entry<UUID, Map<Integer, Object>> entry : oldNodesDiscoData.entrySet()) {
+                U.writeUuid(out, entry.getKey());
+
+                U.writeMap(out, entry.getValue());
+            }
         }
     }
 
@@ -242,10 +245,13 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage {
         int oldNodesDiscoDataSize = in.readInt();
 
         if (oldNodesDiscoDataSize >= 0) {
-            oldNodesDiscoData = new ArrayList<>(oldNodesDiscoDataSize);
+            oldNodesDiscoData = new LinkedHashMap<>(oldNodesDiscoDataSize);
+
+            for (int i = 0; i < oldNodesDiscoDataSize; i++) {
+                UUID nodeId = U.readUuid(in);
 
-            for (int i = 0; i < oldNodesDiscoDataSize; i++)
-                oldNodesDiscoData.add(U.<Integer, Object>readMap(in));
+                oldNodesDiscoData.put(nodeId, U.<Integer, Object>readMap(in));
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 102f2bf..91fb178 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -40,8 +40,8 @@ import org.apache.ignite.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.*;
-import javax.cache.configuration.*;
 import javax.cache.integration.*;
+import java.io.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -54,6 +54,7 @@ import static org.apache.ignite.configuration.DeploymentMode.*;
 /**
  *
  */
+@SuppressWarnings("unchecked")
 public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstractTest {
     /** */
     private boolean cacheEnabled;
@@ -307,8 +308,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
             new C1<CacheConfiguration, Void>() {
                 /** {@inheritDoc} */
                 @Override public Void apply(CacheConfiguration cfg) {
-                    cfg.setAffinity(new CacheRendezvousAffinityFunction() {/*No-op.*/
-                    });
+                    cfg.setAffinity(new TestRendezvousAffinityFunction());
                     return null;
                 }
             },
@@ -395,22 +395,14 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
             new C1<CacheConfiguration, Void>() {
                 /** {@inheritDoc} */
                 @Override public Void apply(CacheConfiguration cfg) {
-                    cfg.setEvictionFilter(new CacheEvictionFilter<Object, Object>() {
-                        @Override public boolean evictAllowed(Cache.Entry<Object, Object> entry) {
-                            return false;
-                        }
-                    });
+                    cfg.setEvictionFilter(new FirstCacheEvictionFilter());
                     return null;
                 }
             },
             new C1<CacheConfiguration, Void>() {
                 /** {@inheritDoc} */
                 @Override public Void apply(CacheConfiguration cfg) {
-                    cfg.setEvictionFilter(new CacheEvictionFilter<Object, Object>() {
-                        @Override public boolean evictAllowed(Cache.Entry<Object, Object> entry) {
-                            return true;
-                        }
-                    });
+                    cfg.setEvictionFilter(new SecondCacheEvictionFilter());
                     return null;
                 }
             }
@@ -425,8 +417,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
             new C1<CacheConfiguration, Void>() {
                 /** {@inheritDoc} */
                 @Override public Void apply(CacheConfiguration cfg) {
-                    cfg.setAffinityMapper(new GridCacheDefaultAffinityKeyMapper() {
-                    });
+                    cfg.setAffinityMapper(new TestCacheDefaultAffinityKeyMapper());
                     return null;
                 }
             },
@@ -662,11 +653,11 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
             /** {@inheritDoc} */
             @SuppressWarnings("unchecked")
             @Override public Void apply(CacheConfiguration cfg) {
-                cfg.setAffinity(new CacheRendezvousAffinityFunction() {/*No-op.*/});
+                cfg.setAffinity(new TestRendezvousAffinityFunction());
 
                 cfg.setEvictionPolicy(new CacheFifoEvictionPolicy());
 
-                cfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+                cfg.setCacheStoreFactory(new IgniteCacheAbstractTest.TestStoreFactory());
                 cfg.setReadThrough(true);
                 cfg.setWriteThrough(true);
                 cfg.setLoadPreviousValue(true);
@@ -696,46 +687,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
     /**
      * @throws Exception If failed.
      */
-    public void testIgnoreStoreMismatchForAtomicClientCache() throws Exception {
-        cacheEnabled = true;
-
-        cacheMode = PARTITIONED;
-
-        initCache = new C1<CacheConfiguration, Void>() {
-            @SuppressWarnings("unchecked")
-            @Override public Void apply(CacheConfiguration cc) {
-                cc.setAtomicityMode(ATOMIC);
-
-                cc.setNearConfiguration(null);
-
-                cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
-                cc.setReadThrough(true);
-                cc.setWriteThrough(true);
-                cc.setLoadPreviousValue(true);
-
-                return null;
-            }
-        };
-
-        startGrid(1);
-
-        initCache = new C1<CacheConfiguration, Void>() {
-            @Override public Void apply(CacheConfiguration cc) {
-                cc.setAtomicityMode(ATOMIC);
-                // TODO IGNITE-45.
-//                cc.setDistributionMode(CLIENT_ONLY);
-                cc.setCacheStoreFactory(null);
-
-                return null;
-            }
-        };
-
-        startGrid(2);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testStoreCheckAtomic() throws Exception {
         cacheEnabled = true;
 
@@ -748,7 +699,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
 
                 cc.setNearConfiguration(null);
 
-                cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+                cc.setCacheStoreFactory(new IgniteCacheAbstractTest.TestStoreFactory());
                 cc.setReadThrough(true);
                 cc.setWriteThrough(true);
                 cc.setLoadPreviousValue(true);
@@ -793,7 +744,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
 
                 cc.setNearConfiguration(null);
 
-                cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
+                cc.setCacheStoreFactory(new IgniteCacheAbstractTest.TestStoreFactory());
                 cc.setReadThrough(true);
                 cc.setWriteThrough(true);
                 cc.setLoadPreviousValue(true);
@@ -828,54 +779,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
     /**
      * @throws Exception If failed.
      */
-    public void testStoreCheckTransactionalClient() throws Exception {
-        cacheEnabled = true;
-
-        cacheMode = PARTITIONED;
-
-        initCache = new C1<CacheConfiguration, Void>() {
-            @SuppressWarnings("unchecked")
-            @Override public Void apply(CacheConfiguration cc) {
-                cc.setAtomicityMode(TRANSACTIONAL);
-
-                cc.setNearConfiguration(null);
-
-                cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
-                cc.setReadThrough(true);
-                cc.setWriteThrough(true);
-                cc.setLoadPreviousValue(true);
-
-                return null;
-            }
-        };
-
-        startGrid(1);
-
-        initCache = new C1<CacheConfiguration, Void>() {
-            @Override public Void apply(CacheConfiguration cc) {
-                cc.setAtomicityMode(TRANSACTIONAL);
-
-                // TODO IGNITE-45
-//                cc.setDistributionMode(CLIENT_ONLY);
-
-                cc.setCacheStoreFactory(null);
-
-                return null;
-            }
-        };
-
-        GridTestUtils.assertThrows(log, new IgniteCallable<Object>() {
-            @Override public Object call() throws Exception {
-                startGrid(2);
-
-                return null;
-            }
-        }, IgniteCheckedException.class, null);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testAffinityForReplicatedCache() throws Exception {
         cacheEnabled = true;
 
@@ -919,7 +822,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
         checkSecondGridStartFails(
             new C1<CacheConfiguration, Void>() {
                 @Override public Void apply(CacheConfiguration cfg) {
-                    cfg.setInterceptor(new CacheInterceptorAdapter() {/*No-op.*/});
+                    cfg.setInterceptor(new TestCacheInterceptor());
 
                     return null;
                 }
@@ -996,4 +899,43 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
             // No-op.
         }
     }
+
+    private static class TestRendezvousAffinityFunction extends CacheRendezvousAffinityFunction {
+        /**
+         * Empty constructor required by {@link Externalizable}.
+         */
+        public TestRendezvousAffinityFunction() {
+            // No-op.
+        }
+    }
+
+    /**
+     *
+     */
+    private static class FirstCacheEvictionFilter implements CacheEvictionFilter<Object, Object> {
+        /** {@inheritDoc} */
+        @Override public boolean evictAllowed(Cache.Entry<Object, Object> entry) {
+            return false;
+        }
+    }
+
+    /**
+     *
+     */
+    private static class SecondCacheEvictionFilter implements CacheEvictionFilter<Object, Object> {
+        /** {@inheritDoc} */
+        @Override public boolean evictAllowed(Cache.Entry<Object, Object> entry) {
+            return true;
+        }
+    }
+
+    /**
+     *
+     */
+    private static class TestCacheInterceptor extends CacheInterceptorAdapter implements Serializable {
+        // No-op, just different class.
+    }
+
+    private static class TestCacheDefaultAffinityKeyMapper extends GridCacheDefaultAffinityKeyMapper {
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
index 69f77b3..dbaaa79 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
@@ -102,16 +102,10 @@ public class GridCacheConfigurationValidationSelfTest extends GridCommonAbstract
             dfltCacheCfg.setRebalanceMode(SYNC);
         else if (gridName.contains(WRONG_CACHE_MODE_GRID_NAME))
             dfltCacheCfg.setCacheMode(REPLICATED);
-        else if (gridName.contains(WRONG_AFFINITY_GRID_NAME)) {
-            dfltCacheCfg.setAffinity(new CacheRendezvousAffinityFunction() {
-                // No-op. Just to have another class name.
-            });
-        }
-        else if (gridName.contains(WRONG_AFFINITY_MAPPER_GRID_NAME)) {
-            dfltCacheCfg.setAffinityMapper(new GridCacheDefaultAffinityKeyMapper() {
-                // No-op. Just to have another class name.
-            });
-        }
+        else if (gridName.contains(WRONG_AFFINITY_GRID_NAME))
+            dfltCacheCfg.setAffinity(new TestRendezvousAffinityFunction());
+        else if (gridName.contains(WRONG_AFFINITY_MAPPER_GRID_NAME))
+            dfltCacheCfg.setAffinityMapper(new TestCacheDefaultAffinityKeyMapper());
         else if (gridName.contains(WRONG_OFF_HEAP_GRID_NAME))
             dfltCacheCfg.setMemoryMode(OFFHEAP_VALUES);
 
@@ -195,4 +189,25 @@ public class GridCacheConfigurationValidationSelfTest extends GridCommonAbstract
             info("Caught expected exception: " + e);
         }
     }
+
+    /**
+     *
+     */
+    private static class TestRendezvousAffinityFunction extends CacheRendezvousAffinityFunction {
+        // No-op. Just to have another class name.
+
+        /**
+         * Empty constructor required by Externalizable.
+         */
+        public TestRendezvousAffinityFunction() {
+            // No-op.
+        }
+    }
+
+    /**
+     *
+     */
+    private static class TestCacheDefaultAffinityKeyMapper extends GridCacheDefaultAffinityKeyMapper {
+        // No-op. Just to have another class name.
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
index c568c50..234e3cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
@@ -383,7 +383,7 @@ public abstract class AbstractDiscoverySelfTest<T extends IgniteSpi> extends Gri
                         return new HashMap<>();
                     }
 
-                    @Override public void onExchange(UUID nodeId, Map<Integer, Object> data) {
+                    @Override public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Object> data) {
                         // No-op.
                     }
                 });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
index e7128b3..b0e22b4 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
@@ -48,7 +48,7 @@ public class TcpDiscoverySpiStartStopSelfTest extends GridSpiStartStopAbstractTe
                 return null;
             }
 
-            @Override public void onExchange(UUID nodeId, Map<Integer, Object> data) {
+            @Override public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Object> data) {
                 // No-op.
             }
         };

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c757939/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
index fe690b3..3df5283 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.testframework.junits.spi;
 
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.security.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.security.*;
@@ -219,7 +218,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends GridAbstr
                     return new HashMap<>();
                 }
 
-                @Override public void onExchange(UUID nodeId, Map<Integer, Object> data) {
+                @Override public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Object> data) {
                 }
             });
 
@@ -713,7 +712,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends GridAbstr
         @Nullable @Override public Collection<GridSecurityPermission> systemPermissions() {
             return null;
         }
-    };
+    }
 
     private static class GridSecuritySubjectImpl implements GridSecuritySubject {
         /** Node Id. */


Mime
View raw message