ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] incubator-ignite git commit: IGNITE-929 IgniteCache.close should not delete the cache from the cluster
Date Fri, 22 May 2015 14:41:28 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-929 [created] 156821420


IGNITE-929
IgniteCache.close should not delete the cache from the cluster


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

Branch: refs/heads/ignite-929
Commit: 2b231770c70d65ff4fbca8f381360ce2fcd1be9b
Parents: 6adbe76
Author: avinogradov <avinogradov@gridgain.com>
Authored: Fri May 22 17:40:33 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Fri May 22 17:40:33 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCache.java     |  10 +-
 .../org/apache/ignite/cache/CacheManager.java   |   2 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../processors/cache/GridCacheProcessor.java    |  33 ++-
 .../processors/cache/IgniteCacheProxy.java      |  29 ++-
 .../visor/cache/VisorCacheStopTask.java         |   2 +-
 .../CacheMetricsForClusterGroupSelfTest.java    |  10 +-
 .../cache/CacheStopAndDestroySelfTest.java      | 246 +++++++++++++++++++
 ...ProjectionForCachesOnDaemonNodeSelfTest.java |   2 +-
 .../cache/IgniteDynamicCacheStartSelfTest.java  |  16 +-
 .../testsuites/IgniteCacheTestSuite4.java       |   2 +
 .../CacheConfigurationP2PTestClient.java        |   4 +-
 12 files changed, 333 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index f9007a2..cb14137 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -499,11 +499,19 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K,
V>, IgniteAsyncS
         CacheEntryProcessor<K, V, T> entryProcessor, Object... args);
 
     /**
-     * Completely deletes the cache with all its data from the system on all cluster nodes.
+     * Closes cache.
+     * For local cache equivalent to {@link #destroy()).
+     * For distributed caches, if called on clients, closes client cache, if called on a
server node,
+     * do nothing.
      */
     @Override void close();
 
     /**
+     * Completely deletes the cache with all its data from the system on all cluster nodes.
+     */
+    void destroy();
+
+    /**
      * This cache node to re-balance its partitions. This method is usually used when
      * {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero
value.
      * When many nodes are started or stopped almost concurrently, it is more efficient to
delay

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index 9ba50d1..e435fd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -272,7 +272,7 @@ public class CacheManager implements javax.cache.CacheManager {
         }
 
         if (cache != null)
-            cache.close();
+            cache.destroy();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index ffd264d..6f63dc2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -2414,7 +2414,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         IgniteInternalFuture<?> stopFut;
 
         try {
-            stopFut = ctx.cache().dynamicStopCache(cacheName);
+            stopFut = ctx.cache().dynamicDestroyCache(cacheName);
         }
         finally {
             unguard();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/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 0e1a9c2..a3ae64f 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
@@ -1935,15 +1935,42 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param cacheName Cache name to stop.
-     * @return Future that will be completed when cache is stopped.
+     * @param cacheName Cache name to destroy.
+     * @return Future that will be completed when cache is destroyed.
      */
-    public IgniteInternalFuture<?> dynamicStopCache(String cacheName) {
+    public IgniteInternalFuture<?> dynamicDestroyCache(String cacheName) {
         DynamicCacheChangeRequest t = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId(),
true);
 
         return F.first(initiateCacheChanges(F.asList(t)));
     }
 
+
+    /**
+     * @param cacheName Cache name to stop.
+     * @return Future that will be completed when cache is stopped.
+     */
+    public IgniteInternalFuture<?> dynamicCloseCache(String cacheName) {
+        CacheConfiguration cfg = ctx.cache().cacheConfiguration(cacheName);
+
+        if (cfg.getCacheMode() == LOCAL)
+            return dynamicDestroyCache(cacheName);
+        else if (ctx.config().isClientMode()) {
+            GridCacheAdapter<?, ?> cache = caches.remove(maskNull(cacheName));
+
+            if (cache != null) {
+                GridCacheContext<?, ?> ctx = cache.context();
+
+                sharedCtx.removeCacheContext(ctx);
+
+                onKernalStop(cache, true);
+                stopCache(cache, true);
+            }
+
+            return null;
+        }
+        else return null;// No-Op.
+    }
+
     /**
      * @param reqs Requests.
      * @return Collection of futures.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 2de5bf0..1c62eaf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -18,8 +18,8 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.CacheManager;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.CacheManager;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
@@ -1329,6 +1329,28 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
     }
 
     /** {@inheritDoc} */
+    @Override public void destroy() {
+        if (!onEnterIfNoClose())
+            return;
+
+        IgniteInternalFuture<?> fut;
+
+        try {
+            fut = ctx.kernalContext().cache().dynamicDestroyCache(ctx.name());
+        }
+        finally {
+            onLeave();
+        }
+
+        try {
+            fut.get();
+        }
+        catch (IgniteCheckedException e) {
+            throw cacheException(e);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public void close() {
         if (!onEnterIfNoClose())
             return;
@@ -1336,7 +1358,10 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         IgniteInternalFuture<?> fut;
 
         try {
-            fut = ctx.kernalContext().cache().dynamicStopCache(ctx.name());
+            fut = ctx.kernalContext().cache().dynamicCloseCache(ctx.name());
+
+            if (fut == null)
+                return;
         }
         finally {
             onLeave();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStopTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStopTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStopTask.java
index 0e848f9..83d19f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStopTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStopTask.java
@@ -56,7 +56,7 @@ public class VisorCacheStopTask extends VisorOneNodeTask<String, Void>
{
         @Override protected Void run(String cacheName) {
             IgniteCache cache = ignite.cache(cacheName);
 
-            cache.close();
+            cache.destroy();
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index 1ba24e3..5093af5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -107,7 +107,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
         assertMetrics(cache1);
         assertMetrics(cache2);
 
-        closeCaches();
+        destroyCaches();
     }
 
     /**
@@ -135,7 +135,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
         assertMetrics(cache1);
         assertMetrics(cache2);
 
-        closeCaches();
+        destroyCaches();
     }
 
     /**
@@ -157,9 +157,9 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
     /**
      * Closes caches.
      */
-    private void closeCaches() {
-        cache1.close();
-        cache2.close();
+    private void destroyCaches() {
+        cache1.destroy();
+        cache2.destroy();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
new file mode 100644
index 0000000..6a1be12
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
@@ -0,0 +1,246 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Check stop and remove methods behavior.
+ */
+public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
+    /** key-value used at test. */
+    protected static String KEY_VAL = "1";
+
+    /** cache name 1. */
+    protected static String CACHE_NAME_1 = "cache1";
+
+    /** cache name 2. */
+    protected static String CACHE_NAME_2 = "cache2";
+
+    /** cache name 3. */
+    protected static String CACHE_NAME_3 = "cache3";
+
+    /** cache name 4. */
+    protected static String CACHE_NAME_4 = "cache4";
+
+    /** local cache name 1. */
+    protected static String CACHE_NAME_LOC_1 = "local1";
+
+    /** local cache name 2. */
+    protected static String CACHE_NAME_LOC_2 = "local2";
+
+    /**
+     * @return Grids count to start.
+     */
+    protected int gridCount() {
+        return 3;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
+        IgniteConfiguration iCfg = super.getConfiguration(gridName);
+
+        if (gridName.endsWith("2"))
+            iCfg.setClientMode(true);
+
+        iCfg.setCacheConfiguration();
+
+        return iCfg;
+    }
+
+    /**
+     * Test.
+     *
+     * @throws Exception
+     */
+    public void testCacheStopAndDestroy() throws Exception {
+        startGridsMultiThreaded(gridCount());
+
+        awaitPartitionMapExchange();
+
+        CacheConfiguration cCfg1 = defaultCacheConfiguration();
+        cCfg1.setName(CACHE_NAME_1);
+        cCfg1.setCacheMode(CacheMode.PARTITIONED);
+
+        CacheConfiguration cCfg2 = defaultCacheConfiguration();
+        cCfg2.setName(CACHE_NAME_2);
+        cCfg2.setCacheMode(CacheMode.PARTITIONED);
+
+        CacheConfiguration cCfg3 = defaultCacheConfiguration();
+        cCfg3.setName(CACHE_NAME_3);
+        cCfg3.setCacheMode(CacheMode.PARTITIONED);
+
+        CacheConfiguration cCfg4 = defaultCacheConfiguration();
+        cCfg4.setName(CACHE_NAME_4);
+        cCfg4.setCacheMode(CacheMode.PARTITIONED);
+
+        CacheConfiguration cCfgLoc1 = defaultCacheConfiguration();
+        cCfgLoc1.setName(CACHE_NAME_LOC_1);
+        cCfgLoc1.setCacheMode(CacheMode.LOCAL);
+
+        CacheConfiguration cCfgLoc2 = defaultCacheConfiguration();
+        cCfgLoc2.setName(CACHE_NAME_LOC_2);
+        cCfgLoc2.setCacheMode(CacheMode.LOCAL);
+
+        grid(0).getOrCreateCache(cCfg1);
+        grid(0).getOrCreateCache(cCfg2);
+        grid(0).getOrCreateCache(cCfg3);
+        grid(0).getOrCreateCache(cCfg4);
+        grid(0).getOrCreateCache(cCfgLoc1);
+        grid(0).getOrCreateCache(cCfgLoc2);
+
+        grid(0).cache(CACHE_NAME_1).put(KEY_VAL, KEY_VAL);
+        grid(0).cache(CACHE_NAME_2).put(KEY_VAL, KEY_VAL);
+        grid(0).cache(CACHE_NAME_3).put(KEY_VAL, KEY_VAL);
+        grid(0).cache(CACHE_NAME_4).put(KEY_VAL, KEY_VAL);
+        grid(0).cache(CACHE_NAME_LOC_1).put(KEY_VAL, KEY_VAL + 0);
+        grid(0).cache(CACHE_NAME_LOC_2).put(KEY_VAL, KEY_VAL + 0);
+        grid(1).cache(CACHE_NAME_LOC_1).put(KEY_VAL, KEY_VAL + 1);
+        grid(1).cache(CACHE_NAME_LOC_2).put(KEY_VAL, KEY_VAL + 1);
+
+        assert grid(0).cache(CACHE_NAME_1).get(KEY_VAL).equals(KEY_VAL);
+        assert grid(0).cache(CACHE_NAME_2).get(KEY_VAL).equals(KEY_VAL);
+        assert grid(0).cache(CACHE_NAME_3).get(KEY_VAL).equals(KEY_VAL);
+        assert grid(0).cache(CACHE_NAME_4).get(KEY_VAL).equals(KEY_VAL);
+        assert grid(0).cache(CACHE_NAME_LOC_1).get(KEY_VAL).equals(KEY_VAL + 0);
+        assert grid(0).cache(CACHE_NAME_LOC_2).get(KEY_VAL).equals(KEY_VAL + 0);
+        assert grid(1).cache(CACHE_NAME_LOC_1).get(KEY_VAL).equals(KEY_VAL + 1);
+        assert grid(1).cache(CACHE_NAME_LOC_2).get(KEY_VAL).equals(KEY_VAL + 1);
+
+        //Destroy:
+
+        //DHT Destroy. Cache should be removed from each node.
+        grid(0).cache(CACHE_NAME_1).destroy();
+
+        try {
+            grid(0).cache(CACHE_NAME_1).get(KEY_VAL).equals(KEY_VAL);
+            assert false;
+        }
+        catch (IllegalArgumentException | IllegalStateException ignored0) {
+            try {
+                grid(1).cache(CACHE_NAME_1).get(KEY_VAL).equals(KEY_VAL);
+                assert false;
+            }
+            catch (IllegalArgumentException | IllegalStateException ignored1) {
+                try {
+                    grid(2).cache(CACHE_NAME_1).get(KEY_VAL).equals(KEY_VAL);
+                    assert false;
+                }
+                catch (IllegalArgumentException | IllegalStateException ignored2) {
+                    // No-op
+                }
+            }
+        }
+
+        //DHT Destroy from client node. Cache should be removed from each node.
+        grid(2).cache(CACHE_NAME_2).destroy();// Client node.
+
+        try {
+            grid(0).cache(CACHE_NAME_2).get(KEY_VAL).equals(KEY_VAL);
+            assert false;
+        }
+        catch (IllegalArgumentException | IllegalStateException ignored0) {
+            try {
+                grid(1).cache(CACHE_NAME_2).get(KEY_VAL).equals(KEY_VAL);
+                assert false;
+            }
+            catch (IllegalArgumentException | IllegalStateException ignored1) {
+                try {
+                    grid(2).cache(CACHE_NAME_2).get(KEY_VAL).equals(KEY_VAL);
+                    assert false;
+                }
+                catch (IllegalArgumentException | IllegalStateException ignored2) {
+                    // No-op
+                }
+            }
+        }
+
+        //Local destroy. Cache should be removed from each node.
+        grid(0).cache(CACHE_NAME_LOC_1).destroy();
+
+        try {
+            grid(0).cache(CACHE_NAME_LOC_1).get(KEY_VAL).equals(KEY_VAL);
+            assert false;
+        }
+        catch (IllegalArgumentException | IllegalStateException ignored0) {
+            try {
+                grid(1).cache(CACHE_NAME_LOC_1).get(KEY_VAL).equals(KEY_VAL);
+                assert false;
+            }
+            catch (IllegalArgumentException | IllegalStateException ignored1) {
+                try {
+                    grid(2).cache(CACHE_NAME_LOC_1).get(KEY_VAL).equals(KEY_VAL);
+                    assert false;
+                }
+                catch (IllegalArgumentException | IllegalStateException ignored2) {
+                    // No-op
+                }
+            }
+        }
+
+        //Close:
+
+        //DHT Close. No-Op.
+        grid(0).cache(CACHE_NAME_3).close();
+
+        assert grid(0).cache(CACHE_NAME_3).get(KEY_VAL).equals(KEY_VAL);// Not affected.
+        assert grid(1).cache(CACHE_NAME_3).get(KEY_VAL).equals(KEY_VAL);// Not affected.
+        assert grid(2).cache(CACHE_NAME_3).get(KEY_VAL).equals(KEY_VAL);// Not affected.
+
+        //DHT Close from client node. Should affect only client node.
+        grid(2).cache(CACHE_NAME_4).close();// Client node.
+
+        assert grid(0).cache(CACHE_NAME_4).get(KEY_VAL).equals(KEY_VAL);// Not affected.
+        assert grid(1).cache(CACHE_NAME_4).get(KEY_VAL).equals(KEY_VAL);// Not affected.
+
+        try {
+            grid(2).cache(CACHE_NAME_4).get(KEY_VAL).equals(KEY_VAL);// Affected.
+            assert false;
+        }
+        catch (IllegalArgumentException | IllegalStateException ignored) {
+            // No-op
+        }
+
+        //Local close. Same as Local destroy.
+        grid(1).cache(CACHE_NAME_LOC_2).close();
+
+        try {
+            grid(0).cache(CACHE_NAME_LOC_2).get(KEY_VAL).equals(KEY_VAL);
+            assert false;
+        }
+        catch (IllegalArgumentException | IllegalStateException ignored0) {
+            try {
+                grid(1).cache(CACHE_NAME_LOC_2).get(KEY_VAL).equals(KEY_VAL);
+                assert false;
+            }
+            catch (IllegalArgumentException | IllegalStateException ignored1) {
+                try {
+                    grid(2).cache(CACHE_NAME_LOC_2).get(KEY_VAL).equals(KEY_VAL);
+                    assert false;
+                }
+                catch (IllegalArgumentException | IllegalStateException ignored2) {
+                    // No-op
+                }
+            }
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
index b9acd99..e640f82 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridProjectionForCachesOnDaemonNodeSelfTest.java
@@ -88,7 +88,7 @@ public class GridProjectionForCachesOnDaemonNodeSelfTest extends GridCommonAbstr
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
-        ignite.cache(null).close();
+        ignite.cache(null).destroy();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index 72b76d7..a9c28ed 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -159,7 +159,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
         GridTestUtils.runMultiThreaded(new Callable<Object>() {
             @Override
             public Object call() throws Exception {
-                futs.add(kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME));
+                futs.add(kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME));
 
                 return null;
             }
@@ -222,7 +222,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
             public Object call() throws Exception {
                 IgniteEx kernal = grid(ThreadLocalRandom.current().nextInt(nodeCount()));
 
-                futs.add(kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME));
+                futs.add(kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME));
 
                 return null;
             }
@@ -285,7 +285,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
         for (int g = 0; g < nodeCount(); g++)
             caches[g] = grid(g).cache(DYNAMIC_CACHE_NAME);
 
-        kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+        kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
 
         for (int g = 0; g < nodeCount(); g++) {
             final IgniteKernal kernal0 = (IgniteKernal) grid(g);
@@ -342,7 +342,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
             }
 
             // Undeploy cache.
-            kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+            kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
 
             startGrid(nodeCount() + 1);
 
@@ -423,7 +423,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
                     }, IllegalArgumentException.class, null);
             }
 
-            kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+            kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
 
             stopGrid(nodeCount() + 1);
             stopGrid(nodeCount());
@@ -490,7 +490,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
             for (int g = 0; g < nodeCount() + 1; g++)
                 assertEquals("1", ignite(g).cache(DYNAMIC_CACHE_NAME).get("1"));
 
-            kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+            kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
         }
         finally {
             stopGrid(nodeCount());
@@ -532,7 +532,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
             for (int g = 0; g < nodeCount() + 1; g++)
                 assertEquals("1", ignite(g).cache(DYNAMIC_CACHE_NAME).get("1"));
 
-            kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+            kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
         }
         finally {
             stopGrid(nodeCount());
@@ -578,7 +578,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest
{
             for (int g = 0; g < nodeCount() + 1; g++)
                 assertEquals("1", ignite(g).cache(DYNAMIC_CACHE_NAME).get("1"));
 
-            kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
+            kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME).get();
         }
         finally {
             stopGrid(nodeCount());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/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 aaf7e5b..5db6067 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
@@ -128,6 +128,8 @@ public class IgniteCacheTestSuite4 extends TestSuite {
 
         suite.addTestSuite(CacheRemoveAllSelfTest.class);
 
+        suite.addTestSuite(CacheStopAndDestroySelfTest.class);
+
         suite.addTestSuite(CacheOffheapMapEntrySelfTest.class);
 
         return suite;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b231770/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheConfigurationP2PTestClient.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheConfigurationP2PTestClient.java
b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheConfigurationP2PTestClient.java
index eea3a9b..701668b0 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheConfigurationP2PTestClient.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheConfigurationP2PTestClient.java
@@ -109,9 +109,9 @@ public class CacheConfigurationP2PTestClient {
             if (cnt != 600)
                 throw new Exception("Unexpected query result: " + cnt);
 
-            cache1.close();
+            cache1.destroy();
 
-            cache2.close();
+            cache2.destroy();
         }
     }
 }


Mime
View raw message