IGNITE-5175: Performance degradation using evictions in near-enabled caches
(cherry picked from commit 9f2f30c) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f8792edf Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f8792edf Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f8792edf Branch: refs/heads/ignite-5267 Commit: f8792edf9b9354c58a40060d38ee863acb6cf42b Parents: 7058c71 Author: Ivan Rakov <[email protected]> Authored: Thu May 11 18:37:45 2017 +0300 Committer: Ivan Rakov <[email protected]> Committed: Tue May 23 17:24:59 2017 +0300 ---------------------------------------------------------------------- .../paged/PageEvictionMultinodeTest.java | 22 ++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/f8792edf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java index 7a58dd4..c2c0775 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java @@ -17,12 +17,14 @@ package org.apache.ignite.internal.processors.cache.eviction.paged; import java.util.concurrent.ThreadLocalRandom; +import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; /** * @@ -39,9 +41,25 @@ public abstract class PageEvictionMultinodeTest extends PageEvictionAbstractTest private static final CacheWriteSynchronizationMode[] WRITE_MODES = {CacheWriteSynchronizationMode.PRIMARY_SYNC, CacheWriteSynchronizationMode.FULL_SYNC, CacheWriteSynchronizationMode.FULL_ASYNC}; + /** Client grid. */ + private Ignite clientGrid; + /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { startGridsMultiThreaded(4, false); + + clientGrid = startGrid("client"); + } + + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { + IgniteConfiguration configuration = super.getConfiguration(gridName); + + if (gridName.startsWith("client")) + configuration.setClientMode(true); + + return configuration; } /** {@inheritDoc} */ @@ -77,7 +95,7 @@ public abstract class PageEvictionMultinodeTest extends PageEvictionAbstractTest * @throws Exception If failed. */ private void createCacheAndTestEvcition(CacheConfiguration<Object, Object> cfg) throws Exception { - IgniteCache<Object, Object> cache = ignite(0).getOrCreateCache(cfg); + IgniteCache<Object, Object> cache = clientGrid.getOrCreateCache(cfg); for (int i = 1; i <= ENTRIES; i++) { ThreadLocalRandom r = ThreadLocalRandom.current(); @@ -105,6 +123,6 @@ public abstract class PageEvictionMultinodeTest extends PageEvictionAbstractTest // Eviction started, no OutOfMemory occurred, success. assertTrue(resultingSize < ENTRIES); - ignite(0).destroyCache(cfg.getName()); + clientGrid.destroyCache(cfg.getName()); } }
