ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #IGNITE-SQL Fixed sql benchmarks.
Date Thu, 12 Feb 2015 14:12:22 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-sql-tests 5fb28ffaf -> aa4ddbef1


#IGNITE-SQL Fixed sql benchmarks.


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

Branch: refs/heads/ignite-sql-tests
Commit: aa4ddbef1fd2192b9d83e052605924f5dfb3f3c1
Parents: 5fb28ff
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Thu Feb 12 17:12:14 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Thu Feb 12 17:12:14 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteSqlQueryBenchmark.java          | 13 ++++-------
 .../cache/IgniteSqlQueryJoinBenchmark.java      | 23 ++++++++------------
 .../cache/IgniteSqlQueryPutBenchmark.java       | 13 ++++-------
 3 files changed, 17 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa4ddbef/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryBenchmark.java
index 488a5ab..e26ab9f 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryBenchmark.java
@@ -32,13 +32,6 @@ import static org.yardstickframework.BenchmarkUtils.*;
  * Ignite benchmark that performs query operations.
  */
 public class IgniteSqlQueryBenchmark extends IgniteCacheAbstractBenchmark {
-    /** */
-    private ThreadLocal<SqlQuery> qry = new ThreadLocal<SqlQuery>() {
-        @Override protected SqlQuery initialValue() {
-            return new SqlQuery(Person.class, "salary >= ? and salary <= ?");
-        }
-    };
-
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
         super.setUp(cfg);
@@ -85,9 +78,11 @@ public class IgniteSqlQueryBenchmark extends IgniteCacheAbstractBenchmark
{
      * @throws Exception If failed.
      */
     private Collection<Cache.Entry<Integer, Object>> executeQuery(double minSalary,
double maxSalary) throws Exception {
-        qry.get().setArgs(minSalary, maxSalary);
+        SqlQuery qry = new SqlQuery(Person.class, "salary >= ? and salary <= ?");
+
+        qry.setArgs(minSalary, maxSalary);
 
-        return cache.query(qry.get()).getAll();
+        return cache.query(qry).getAll();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa4ddbef/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryJoinBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryJoinBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryJoinBenchmark.java
index 92ceff6..4e34d14 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryJoinBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryJoinBenchmark.java
@@ -31,18 +31,6 @@ import static org.yardstickframework.BenchmarkUtils.*;
  * Ignite benchmark that performs query operations with joins.
  */
 public class IgniteSqlQueryJoinBenchmark extends IgniteCacheAbstractBenchmark {
-    /** */
-    private ThreadLocal<SqlFieldsQuery> qry = new ThreadLocal<SqlFieldsQuery>()
{
-        @Override protected SqlFieldsQuery initialValue() {
-            return new SqlFieldsQuery(
-                "select p.id, p.orgId, p.firstName, p.lastName, p.salary, o.name " +
-                "from Person p " +
-                "left join Organization o " +
-                "on p.id = o.id " +
-                "where salary >= ? and salary <= ?");
-        }
-    };
-
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
         super.setUp(cfg);
@@ -109,9 +97,16 @@ public class IgniteSqlQueryJoinBenchmark extends IgniteCacheAbstractBenchmark
{
      * @throws Exception If failed.
      */
     private Collection<List<?>> executeQueryJoin(double minSalary, double maxSalary)
throws Exception {
-        qry.get().setArgs(minSalary, maxSalary);
+        SqlFieldsQuery qry = new SqlFieldsQuery(
+            "select p.id, p.orgId, p.firstName, p.lastName, p.salary, o.name " +
+            "from Person p " +
+            "left join Organization o " +
+            "on p.id = o.id " +
+            "where salary >= ? and salary <= ?");
+
+        qry.setArgs(minSalary, maxSalary);
 
-        return cache.queryFields(qry.get()).getAll();
+        return cache.queryFields(qry).getAll();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa4ddbef/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
index f32ea1c..9f1e136 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
@@ -30,13 +30,6 @@ import java.util.concurrent.*;
  * Ignite benchmark that performs put and query operations.
  */
 public class IgniteSqlQueryPutBenchmark extends IgniteCacheAbstractBenchmark {
-    /** */
-    private ThreadLocal<SqlQuery> qry = new ThreadLocal<SqlQuery>() {
-        @Override protected SqlQuery initialValue() {
-            return new SqlQuery(Person.class, "salary >= ? and salary <= ?");
-        }
-    };
-
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
         super.setUp(cfg);
@@ -77,9 +70,11 @@ public class IgniteSqlQueryPutBenchmark extends IgniteCacheAbstractBenchmark
{
      * @throws Exception If failed.
      */
     private Collection<Cache.Entry<Integer, Object>> executeQuery(double minSalary,
double maxSalary) throws Exception {
-        qry.get().setArgs(minSalary, maxSalary);
+        SqlQuery qry = new SqlQuery(Person.class, "salary >= ? and salary <= ?");
+
+        qry.setArgs(minSalary, maxSalary);
 
-        return cache.query(qry.get()).getAll();
+        return cache.query(qry).getAll();
     }
 
     /** {@inheritDoc} */


Mime
View raw message