You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/02/15 08:52:32 UTC

[48/50] [abbrv] ignite git commit: ignite-split2 - more reverts

ignite-split2 - more reverts


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

Branch: refs/heads/ignite-1232
Commit: 50fbeee3219feaf6e7b7e72f1e0b1d0c7dda7467
Parents: 4d8deba
Author: S.Vladykin <sv...@gridgain.com>
Authored: Mon Jan 11 18:44:17 2016 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Mon Jan 11 18:44:17 2016 +0300

----------------------------------------------------------------------
 .../h2/twostep/GridReduceQueryExecutor.java     | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/50fbeee3/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 3151677..8b3de90 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -524,9 +524,7 @@ public class GridReduceQueryExecutor {
 
             final String space = cctx.name();
 
-            List<GridCacheSqlQuery> mapQrys = qry.mapQueries();
-
-            final QueryRun r = new QueryRun(h2.connectionForSpace(space), mapQrys.size(), qry.pageSize());
+            final QueryRun r = new QueryRun(h2.connectionForSpace(space), qry.mapQueries().size(), qry.pageSize());
 
             AffinityTopologyVersion topVer = h2.readyTopologyVersion();
 
@@ -562,16 +560,18 @@ public class GridReduceQueryExecutor {
                 nodes = Collections.singleton(F.rand(nodes));
             }
 
-            final boolean skipMergeTbl = qry.skipMergeTable() && !qry.explain();
+            int tblIdx = 0;
+
+            final boolean skipMergeTbl = !qry.explain() && qry.skipMergeTable();
 
-            for (int i = 0; i < mapQrys.size(); i++) {
+            for (GridCacheSqlQuery mapQry : qry.mapQueries()) {
                 GridMergeIndex idx;
 
                 if (!skipMergeTbl) {
                     GridMergeTable tbl;
 
                     try {
-                        tbl = createMergeTable(r.conn, mapQrys.get(i), qry.explain());
+                        tbl = createMergeTable(r.conn, mapQry, qry.explain());
                     }
                     catch (IgniteCheckedException e) {
                         throw new IgniteException(e);
@@ -579,7 +579,7 @@ public class GridReduceQueryExecutor {
 
                     idx = tbl.getScanIndex(null);
 
-                    fakeTable(r.conn, i).innerTable(tbl);
+                    fakeTable(r.conn, tblIdx++).innerTable(tbl);
                 }
                 else
                     idx = GridMergeIndexUnsorted.createDummy();
@@ -589,7 +589,7 @@ public class GridReduceQueryExecutor {
                 r.idxs.add(idx);
             }
 
-            r.latch = new CountDownLatch(mapQrys.size() * nodes.size());
+            r.latch = new CountDownLatch(r.idxs.size() * nodes.size());
 
             runs.put(qryReqId, r);
 
@@ -600,6 +600,8 @@ public class GridReduceQueryExecutor {
                             "Client node disconnected."));
                 }
 
+                List<GridCacheSqlQuery> mapQrys = qry.mapQueries();
+
                 if (qry.explain()) {
                     mapQrys = new ArrayList<>(qry.mapQueries().size());
 
@@ -659,12 +661,12 @@ public class GridReduceQueryExecutor {
 
                 if (!retry) {
                     if (skipMergeTbl) {
+                        List<List<?>> res = new ArrayList<>();
+
                         assert r.idxs.size() == 1 : r.idxs;
 
                         GridMergeIndex idx = r.idxs.get(0);
 
-                        List<List<?>> res = new ArrayList<>((int)idx.getRowCountApproximation());
-
                         Cursor cur = idx.findInStream(null, null);
 
                         while (cur.next()) {
@@ -753,7 +755,7 @@ public class GridReduceQueryExecutor {
                     U.warn(log, "Query run was already removed: " + qryReqId);
 
                 if (!skipMergeTbl) {
-                    for (int i = 0; i < mapQrys.size(); i++)
+                    for (int i = 0, mapQrys = qry.mapQueries().size(); i < mapQrys; i++)
                         fakeTable(null, i).innerTable(null); // Drop all merge tables.
                 }
             }