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 <ntikho...@gridgain.com>
Authored: Thu Feb 12 17:12:14 2015 +0300
Committer: nikolay_tikhonov <ntikho...@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} */

Reply via email to