ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/5] ignite git commit: Changes in IgniteSqlQueryDistributedJoinBenchmark.
Date Thu, 28 Jul 2016 13:27:10 GMT
Changes in IgniteSqlQueryDistributedJoinBenchmark.


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

Branch: refs/heads/ignite-3553
Commit: 808eab475eb8e301253a8137feb140f5ec6cdf09
Parents: c82acb7
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jul 28 15:36:29 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jul 28 15:36:29 2016 +0300

----------------------------------------------------------------------
 .../IgniteSqlQueryDistributedJoinBenchmark.java | 50 +++++++-------------
 1 file changed, 16 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/808eab47/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryDistributedJoinBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryDistributedJoinBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryDistributedJoinBenchmark.java
index 1f009e6..c5fdeb2 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryDistributedJoinBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryDistributedJoinBenchmark.java
@@ -34,7 +34,7 @@ import static org.yardstickframework.BenchmarkUtils.println;
  */
 public class IgniteSqlQueryDistributedJoinBenchmark extends IgniteCacheAbstractBenchmark<Integer,
Object> {
     /** */
-    private int orgRange;
+    private int range;
 
     /** */
     private boolean broadcast;
@@ -49,41 +49,23 @@ public class IgniteSqlQueryDistributedJoinBenchmark extends IgniteCacheAbstractB
 
         long start = System.nanoTime();
 
-        int personCnt = 0;
+        range = args.range();
 
-        try (IgniteDataStreamer<Object, Object> dataLdr = ignite().dataStreamer(cache.getName()))
{
-            orgRange = args.range() / 10;
-
-            if (orgRange <= 0)
-                throw new IllegalArgumentException();
+        if (range <= 0)
+            throw new IllegalArgumentException();
 
-            // Populate organizations.
-            for (int orgId = 0; orgId < orgRange; orgId++) {
+        try (IgniteDataStreamer<Object, Object> dataLdr = ignite().dataStreamer(cache.getName()))
{
+            for (int orgId = 0; orgId < range; orgId++) {
                 dataLdr.addData(orgId, new Organization(orgId, "org" + orgId));
 
-                if (orgId % 1000 == 0 && Thread.currentThread().isInterrupted())
-                    return;
-            }
-
-            dataLdr.flush();
-
-            // Populate persons.
-            for (int orgId = 0; orgId < orgRange; orgId++) {
-                int persons = orgId % 10 + 1;
-
-                for (int j = 0; j < persons; j++) {
-                    int personId = orgRange + personCnt++;
-
-                    Person p = new Person(personId,
-                        orgId,
-                        "firstName" + personId,
-                        "lastName" + personId, 1000);
+                int personId = range + orgId;
 
-                    dataLdr.addData(personId, p);
-                }
+                Person p = new Person(personId,
+                    orgId,
+                    "firstName" + personId,
+                    "lastName" + personId, 1000);
 
-                if (personCnt % 100000 == 0)
-                    println(cfg, "Populated persons: " + personCnt);
+                dataLdr.addData(personId, p);
 
                 if (orgId % 1000 == 0 && Thread.currentThread().isInterrupted())
                     return;
@@ -92,8 +74,8 @@ public class IgniteSqlQueryDistributedJoinBenchmark extends IgniteCacheAbstractB
             dataLdr.close();
         }
 
-        println(cfg, "Finished populating join query [orgCnt=" + orgRange +
-            ", personCnt=" + personCnt +
+        println(cfg, "Finished populating join query [orgCnt=" + range +
+            ", personCnt=" + range +
             ", broadcastJoin=" + broadcast +
             ", time=" + ((System.nanoTime() - start) / 1_000_000) + "ms]");
 
@@ -109,11 +91,11 @@ public class IgniteSqlQueryDistributedJoinBenchmark extends IgniteCacheAbstractB
 
     /** {@inheritDoc} */
     @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        int orgId = nextRandom(orgRange);
+        int orgId = nextRandom(range);
 
         Collection<List<?>> res = executeQueryJoin(orgId, broadcast, false);
 
-        int persons = orgId % 10 + 1;
+        int persons = 1;
 
         if (res.size() != persons)
             throw new Exception("Invalid join result [orgId=" + orgId + ", resSize=" + res.size()
+ ']');


Mime
View raw message