ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [25/43] ignite git commit: ignite-4694 review
Date Fri, 10 Mar 2017 07:23:46 GMT
ignite-4694 review


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

Branch: refs/heads/ignite-4712
Commit: 88c04bb87786ac90b400872244afb29db6e77e5d
Parents: ef8e479
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Feb 15 15:08:14 2017 +0300
Committer: Igor Seliverstov <gvvinblade@gmail.com>
Committed: Wed Mar 1 10:44:54 2017 +0300

----------------------------------------------------------------------
 .../database/IgniteDbMemoryLeakAbstractTest.java     | 15 ++++++++-------
 .../database/IgniteDbMemoryLeakIndexedTest.java      |  3 +++
 .../database/IgniteDbMemoryLeakLargeObjectsTest.java |  9 +++++----
 .../database/IgniteDbMemoryLeakLargePagesTest.java   |  2 ++
 .../processors/database/IgniteDbMemoryLeakTest.java  | 10 +++++++---
 .../IgniteDbMemoryLeakWithExpirationTest.java        |  2 +-
 6 files changed, 26 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/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 6a5d039..fc0e715 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
@@ -27,10 +27,10 @@ import org.apache.ignite.resources.IgniteInstanceResource;
 import java.util.concurrent.TimeUnit;
 
 /**
- *
+ * TODO: fix javadoc warnings, code style.
  */
 public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
-
+    // TODO: take duration from system property.
     /** Test duration in seconds*/
     protected abstract int duration();
 
@@ -44,16 +44,18 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
 
     /** */
     public void testMemoryLeak() throws Exception {
+        // TODO: take PageMemory max size is the same as we configured.
 
         final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
 
-        int tasksCount = Runtime.getRuntime().availableProcessors() * 4;
+        // TODO: use threads instead of compute or make sure there are enough threads in
pool.
+        int tasksCnt = Runtime.getRuntime().availableProcessors() * 4;
 
         IgniteCompute compute = grid(0).compute().withAsync();
 
-        ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCount];
+        ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCnt];
 
-        for (int i = 0; i < tasksCount; i++) {
+        for (int i = 0; i < tasksCnt; i++) {
             compute.run(new IgniteRunnable() {
                 @IgniteInstanceResource
                 private Ignite ig;
@@ -75,9 +77,8 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
             futs[i] = compute.future();
         }
 
-        for (ComputeTaskFuture fut : futs) {
+        for (ComputeTaskFuture fut : futs)
             fut.get();
-        }
     }
 
     protected void check(IgniteEx ig) {}

http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
index 4cd74d0..db77131 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
@@ -51,6 +51,7 @@ public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTes
     }
 
     @Override
+    // TODO: move test to module ignite-indexing.
     protected boolean indexingEnabled() {
         return true;
     }
@@ -64,6 +65,8 @@ public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTes
 
             DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
 
+            // TODO: also execute sql queries.
+
             switch (rnd.nextInt(3)) {
                 case 0:
                     cache.getAndPut(key, v0);

http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
index a4d88e1..2a6c8cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
@@ -29,15 +29,16 @@ import java.util.concurrent.ThreadLocalRandom;
  *
  */
 public class IgniteDbMemoryLeakLargeObjectsTest extends IgniteDbMemoryLeakAbstractTest {
-
+    /** */
     private final static int[] ARRAY;
+
     static {
         ARRAY = new int[1024];
+
         Random rnd = new Random();
-        for (int i = 0; i < ARRAY.length; i++) {
-            ARRAY[i] = rnd.nextInt();
-        }
 
+        for (int i = 0; i < ARRAY.length; i++)
+            ARRAY[i] = rnd.nextInt();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
index bfa4aa9..91c96af 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
@@ -47,6 +47,7 @@ public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstract
 
     @Override
     protected void configure(MemoryConfiguration mCfg) {
+        // TODO: understand why such overhead with large pages.
         mCfg.setPageCacheSize(100 * 1024 * 1024);
     }
 
@@ -60,6 +61,7 @@ public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstract
         return true;
     }
 
+    // TODO: avoid copy/paste.
     protected void operation(IgniteEx ig){
         IgniteCache<Object, Object> cache = ig.cache("non-primitive");
         Random rnd = ThreadLocalRandom.current();

http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
index 6af4e41..2b0ce1e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
@@ -29,9 +29,8 @@ import java.util.concurrent.ThreadLocalRandom;
  *
  */
 public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
-
-    @Override
-    protected int duration() {
+    /** {@inheritDoc} */
+    @Override protected int duration() {
         return 300;
     }
 
@@ -64,12 +63,17 @@ public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest
{
 
             DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
 
+            // TODO: also execute scan query.
+
             switch (rnd.nextInt(3)) {
                 case 0:
                     cache.getAndPut(key, v0);
+                    break;
+
                 case 1:
                     cache.get(key);
                     break;
+
                 case 2:
                     cache.getAndRemove(key);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/88c04bb8/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
index d9e3f34..95fe8c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
@@ -34,7 +34,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
  *
  */
 public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest
{
-
+    /** */
     private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS,
10L));
 
     @Override


Mime
View raw message