You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pp...@apache.org on 2022/04/29 15:24:46 UTC

[ignite] branch master updated: IGNITE-16910 Reduced memory usage of CacheDataRegionConfigurationTest (#10003)

This is an automated email from the ASF dual-hosted git repository.

ppa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 80006348d46 IGNITE-16910 Reduced memory usage of CacheDataRegionConfigurationTest (#10003)
80006348d46 is described below

commit 80006348d466464b9fc3bb940c4f1d8a59b57730
Author: Pavel Pereslegin <xx...@gmail.com>
AuthorDate: Fri Apr 29 18:24:40 2022 +0300

    IGNITE-16910 Reduced memory usage of CacheDataRegionConfigurationTest (#10003)
---
 .../cache/CacheDataRegionConfigurationTest.java    | 31 +++++++++++++++-------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
index 7fce9b8b333..5225899e011 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
@@ -730,22 +730,33 @@ public class CacheDataRegionConfigurationTest extends GridCommonAbstractTest {
         assertFalse(logLsnr.check());
     }
 
-    /** 
+    /**
      * Verify that the eviction strategy can support large dataregion.
      */
     @Test
-    public void testLargeRegionsWithEviction() throws Exception {
-        DataRegionConfiguration cfg1 = new DataRegionConfiguration()
-            .setName("region-1")
-            .setMaxSize(4 * 1024 * U.GB)
-            .setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
+    public void testLargeRegionsWithRandomLRU() throws Exception {
+        doTestLargeRegionsWithEviction(DataPageEvictionMode.RANDOM_LRU);
+    }
+
+    /**
+     * Verify that the eviction strategy can support large dataregion.
+     */
+    @Test
+    public void testLargeRegionsWithRandom2LRU() throws Exception {
+        doTestLargeRegionsWithEviction(DataPageEvictionMode.RANDOM_2_LRU);
+    }
 
-        DataRegionConfiguration cfg2 = new DataRegionConfiguration()
-            .setName("region-2")
+    /**
+     * @param evictMode Page eviction mode.
+     * @throws Exception If failed.
+     */
+    private void doTestLargeRegionsWithEviction(DataPageEvictionMode evictMode) throws Exception {
+        DataRegionConfiguration cfg = new DataRegionConfiguration()
+            .setName("region-1")
             .setMaxSize(4 * 1024 * U.GB)
-            .setPageEvictionMode(DataPageEvictionMode.RANDOM_2_LRU);
+            .setPageEvictionMode(evictMode);
 
-        memCfg = new DataStorageConfiguration().setDataRegionConfigurations(cfg1, cfg2);
+        memCfg = new DataStorageConfiguration().setDataRegionConfigurations(cfg);
 
         startGrid();
     }