ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject incubator-ignite git commit: # IGNITE-403 Use public API in IgniteCacheStartStopLoadTest
Date Wed, 11 Mar 2015 11:45:39 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 0f7b0286b -> dcbf9badd


# IGNITE-403 Use public API in IgniteCacheStartStopLoadTest


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

Branch: refs/heads/ignite-45
Commit: dcbf9baddfa04e9e79b49ee5f46c505319eccc39
Parents: 0f7b028
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed Mar 11 14:44:58 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Mar 11 14:44:58 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheStartStopLoadTest.java     | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dcbf9bad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStartStopLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStartStopLoadTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStartStopLoadTest.java
index 47a05cb..006ac22 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStartStopLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStartStopLoadTest.java
@@ -18,9 +18,7 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 
@@ -82,30 +80,25 @@ public class IgniteCacheStartStopLoadTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testMemoryLeaks() throws Exception {
-        final IgniteKernal kernal = (IgniteKernal)grid(0);
+        final Ignite ignite = ignite(0);
 
         long startTime = System.currentTimeMillis();
 
         while ((System.currentTimeMillis() - startTime) < DURATION) {
             final AtomicInteger idx = new AtomicInteger();
 
-            final Collection<IgniteInternalFuture<?>> futs = new ConcurrentLinkedDeque<>();
-
             GridTestUtils.runMultiThreaded(new Callable<Object>() {
                 @Override public Object call() throws Exception {
                     CacheConfiguration ccfg = new CacheConfiguration();
 
                     ccfg.setName(CACHE_NAMES[idx.getAndIncrement()]);
 
-                    futs.add(kernal.context().cache().dynamicStartCache(ccfg));
+                    ignite.createCache(ccfg);
 
                     return null;
                 }
             }, CACHE_COUNT, "cache-starter");
 
-            for (IgniteInternalFuture<?> fut : futs)
-                fut.get();
-
             for (String cacheName : CACHE_NAMES)
                 assert ignite(0).jcache(cacheName) != null;
 
@@ -122,13 +115,15 @@ public class IgniteCacheStartStopLoadTest extends GridCommonAbstractTest
{
                 weakMap.put(obj, Boolean.TRUE);
             }
 
-            futs.clear();
+            idx.set(0);
 
-            for (String cacheName : CACHE_NAMES)
-                futs.add(kernal.context().cache().dynamicStopCache(cacheName));
+            GridTestUtils.runMultiThreaded(new Callable<Object>() {
+                @Override public Object call() throws Exception {
+                    ignite.destroyCache(CACHE_NAMES[idx.getAndIncrement()]);
 
-            for (IgniteInternalFuture<?> fut : futs)
-                fut.get();
+                    return null;
+                }
+            }, CACHE_COUNT, "cache-starter");
         }
 
         assert weakMap.isEmpty() : weakMap;


Mime
View raw message