ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/50] [abbrv] ignite git commit: IGNITE-5134: Fixed ClassCastException in IgniteCacheDatabaseSharedManager. This closes #1895.
Date Fri, 05 May 2017 09:45:31 GMT
IGNITE-5134: Fixed ClassCastException in IgniteCacheDatabaseSharedManager. This closes #1895.


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

Branch: refs/heads/ignite-5009
Commit: 4c1dab4e6be1490887144cc2ff1042aa4d650363
Parents: e7826aa
Author: Ivan Rakov <ivan.glukos@gmail.com>
Authored: Wed May 3 11:24:01 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed May 3 11:24:01 2017 +0300

----------------------------------------------------------------------
 .../IgniteCacheDatabaseSharedManager.java       | 21 +++++++++++++-------
 .../pagemem/impl/PageMemoryNoLoadSelfTest.java  |  3 ++-
 .../database/IgniteDbDynamicCacheSelfTest.java  |  1 +
 .../database/MetadataStorageSelfTest.java       |  3 ++-
 .../processors/igfs/IgfsSizeSelfTest.java       |  2 +-
 5 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4c1dab4e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
index 5062d0f..7151b2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
@@ -715,7 +715,8 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
      * @param memMetrics {@link MemoryMetrics} object to collect memory usage metrics.
      * @return Memory policy instance.
      */
-    private MemoryPolicy initMemory(MemoryConfiguration memCfg, MemoryPolicyConfiguration
plcCfg, MemoryMetricsImpl memMetrics) {
+    private MemoryPolicy initMemory(MemoryConfiguration memCfg, MemoryPolicyConfiguration
plcCfg,
+        MemoryMetricsImpl memMetrics) {
         File allocPath = buildAllocPath(plcCfg);
 
         DirectMemoryProvider memProvider = allocPath == null ?
@@ -726,23 +727,29 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
 
         PageMemory pageMem = createPageMemory(memProvider, memCfg, plcCfg, memMetrics);
 
-        return new MemoryPolicy(pageMem, plcCfg, memMetrics, createPageEvictionTracker(plcCfg,
-            (PageMemoryNoStoreImpl)pageMem));
+        return new MemoryPolicy(pageMem, plcCfg, memMetrics, createPageEvictionTracker(plcCfg,
pageMem));
     }
 
     /**
      * @param plc Memory Policy Configuration.
      * @param pageMem Page memory.
      */
-    private PageEvictionTracker createPageEvictionTracker(MemoryPolicyConfiguration plc,
PageMemoryNoStoreImpl pageMem) {
+    private PageEvictionTracker createPageEvictionTracker(MemoryPolicyConfiguration plc,
PageMemory pageMem) {
+        if (plc.getPageEvictionMode() == DataPageEvictionMode.DISABLED)
+            return new NoOpPageEvictionTracker();
+
+        assert pageMem instanceof PageMemoryNoStoreImpl : pageMem.getClass();
+
+        PageMemoryNoStoreImpl pageMem0 = (PageMemoryNoStoreImpl)pageMem;
+
         if (Boolean.getBoolean("override.fair.fifo.page.eviction.tracker"))
-            return new FairFifoPageEvictionTracker(pageMem, plc, cctx);
+            return new FairFifoPageEvictionTracker(pageMem0, plc, cctx);
 
         switch (plc.getPageEvictionMode()) {
             case RANDOM_LRU:
-                return new RandomLruPageEvictionTracker(pageMem, plc, cctx);
+                return new RandomLruPageEvictionTracker(pageMem0, plc, cctx);
             case RANDOM_2_LRU:
-                return new Random2LruPageEvictionTracker(pageMem, plc, cctx);
+                return new Random2LruPageEvictionTracker(pageMem0, plc, cctx);
             default:
                 return new NoOpPageEvictionTracker();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c1dab4e/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
index 84db565..0a283ed 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
@@ -280,7 +280,8 @@ public class PageMemoryNoLoadSelfTest extends GridCommonAbstractTest {
     protected PageMemory memory() throws Exception {
         File memDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), "pagemem", false);
 
-        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(10
* 1024 * 1024);
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration()
+            .setInitialSize(10 * 1024 * 1024).setMaxSize(10 * 1024 * 1024);
 
         DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), memDir);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c1dab4e/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
index 3b3e1de..8655ba9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
@@ -44,6 +44,7 @@ public class IgniteDbDynamicCacheSelfTest extends GridCommonAbstractTest
{
         MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
 
         plc.setName("dfltPlc");
+        plc.setInitialSize(200 * 1024 * 1024);
         plc.setMaxSize(200 * 1024 * 1024);
 
         dbCfg.setDefaultMemoryPolicyName("dfltPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c1dab4e/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
index af0b849..b98f429 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
@@ -157,7 +157,8 @@ public class MetadataStorageSelfTest extends GridCommonAbstractTest {
     protected PageMemory memory(boolean clean) throws Exception {
         DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
 
-        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(30
* 1024 * 1024);
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration()
+            .setMaxSize(30 * 1024 * 1024).setInitialSize(30 * 1024 * 1024);
 
         return new PageMemoryNoStoreImpl(
             log,

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c1dab4e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index 456971a..597efe1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -397,7 +397,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
                 String memPlcName = "igfsDataMemPlc";
 
                 cfg.setMemoryConfiguration(new MemoryConfiguration().setMemoryPolicies(
-                    new MemoryPolicyConfiguration().setMaxSize(maxSize).setName(memPlcName)));
+                    new MemoryPolicyConfiguration().setMaxSize(maxSize).setInitialSize(maxSize).setName(memPlcName)));
 
                 FileSystemConfiguration igfsCfg = cfg.getFileSystemConfiguration()[0];
 


Mime
View raw message