ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [46/50] [abbrv] ignite git commit: ignite-4694 Fixed expected number of pages in memory leak tests after QueryIndex.inlineSize change.
Date Tue, 18 Apr 2017 09:00:58 GMT
ignite-4694 Fixed expected number of pages in memory leak tests after QueryIndex.inlineSize
change.


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

Branch: refs/heads/ignite-4985
Commit: 48bd8da319d2b41db5ac673906ecb8553bc14921
Parents: 3e3b91a
Author: Igor Seliverstov <iseliverstov@gridgain.com>
Authored: Tue Apr 18 11:41:07 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Apr 18 11:41:07 2017 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/internal/IgniteKernal.java |  7 ++++---
 .../database/IgniteDbMemoryLeakAbstractTest.java      | 14 +++++++++-----
 .../database/IgniteDbMemoryLeakIndexedTest.java       |  2 +-
 .../database/IgniteDbMemoryLeakSqlQueryTest.java      |  2 +-
 4 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/48bd8da3/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 eb2ae6a..9b41b58 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
@@ -1189,10 +1189,11 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
                             int loadedPages = 0;
 
-                            for (GridCacheContext cctx : ctx.cache().context().cacheContexts())
{
-                                MemoryPolicy memPlc = cctx.memoryPolicy();
+                            Collection<MemoryPolicy> policies = ctx.cache().context().database().memoryPolicies();
 
-                                loadedPages += memPlc != null ? memPlc.pageMemory().loadedPages()
: 0;
+                            if (!F.isEmpty(policies)) {
+                                for (MemoryPolicy memPlc : policies)
+                                    loadedPages += memPlc.pageMemory().loadedPages();
                             }
 
                             String id = U.id8(localNode().id());

http://git-wip-us.apache.org/repos/asf/ignite/blob/48bd8da3/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
index 5228955..99f934d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
@@ -22,8 +22,8 @@ import java.util.concurrent.TimeUnit;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import org.apache.ignite.internal.processors.cache.database.DataStructure;
 
 import static org.apache.ignite.IgniteSystemProperties.getInteger;
@@ -203,7 +203,7 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
 
         while (ex == null && System.nanoTime() < endTime) {
             try {
-                check(ignite);
+                check(cache);
             }
             catch (Exception e) {
                 ex = e;
@@ -221,11 +221,11 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
     /**
      * Callback to check the current state.
      *
-     * @param ig Ignite instance.
+     * @param cache Cache instance.
      * @throws Exception If failed.
      */
-    protected void check(IgniteEx ig) throws Exception {
-        long pagesActual = ig.context().cache().context().database().memoryPolicy(null).pageMemory().loadedPages();
+    protected final void check(IgniteCache cache) throws Exception {
+        long pagesActual = ((IgniteCacheProxy)cache).context().memoryPolicy().pageMemory().loadedPages();
 
         if (loadedPages > 0) {
             delta += pagesActual - loadedPages;
@@ -241,6 +241,10 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
             }
         }
 
+        long pagesAllowed = pagesMax();
+
+        assertTrue("Allocated pages count is more than expected [allowed=" + pagesAllowed
+ ", actual=" + pagesActual + "]", pagesActual < pagesAllowed);
+
         loadedPages = pagesActual;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/48bd8da3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
index f6a06c9..28e36a8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
@@ -28,6 +28,6 @@ public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakTest
{
 
     /** {@inheritDoc} */
     @Override protected long pagesMax() {
-        return 24_000;
+        return 26_000;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/48bd8da3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakSqlQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakSqlQueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakSqlQueryTest.java
index 57f9fb5..41c7a98 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakSqlQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakSqlQueryTest.java
@@ -32,7 +32,7 @@ public class IgniteDbMemoryLeakSqlQueryTest extends IgniteDbMemoryLeakTest
{
 
     /** {@inheritDoc} */
     @Override protected long pagesMax() {
-        return 24_000;
+        return 26_000;
     }
 
     /** {@inheritDoc} */


Mime
View raw message