ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [28/50] ignite git commit: Implemented "onQueryRequest" handling.
Date Mon, 14 Aug 2017 10:30:38 GMT
Implemented "onQueryRequest" handling.


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

Branch: refs/heads/ignite-5991-6019
Commit: f9960dff9d0e51b5a9b32473e5970d5d6b06a6a6
Parents: ccdd179
Author: devozerov <vozerov@gridgain.com>
Authored: Mon Aug 14 10:50:25 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Aug 14 10:50:25 2017 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  | 37 ++++++++++++--------
 .../h2/twostep/lazy/MapQueryLazyWorker.java     | 11 +++++-
 2 files changed, 32 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f9960dff/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 6b11a47..0fd9b75 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -539,21 +539,21 @@ public class GridMapQueryExecutor {
      */
     // TODO: IGNITE-5991: Correct thread.
     private void onQueryRequest0(
-        ClusterNode node,
-        long reqId,
-        int segmentId,
-        String schemaName,
-        Collection<GridCacheSqlQuery> qrys,
-        List<Integer> cacheIds,
-        AffinityTopologyVersion topVer,
-        Map<UUID, int[]> partsMap,
-        int[] parts,
-        int pageSize,
-        DistributedJoinMode distributedJoinMode,
-        boolean enforceJoinOrder,
-        boolean replicated,
-        int timeout,
-        Object[] params,
+        final ClusterNode node,
+        final long reqId,
+        final int segmentId,
+        final String schemaName,
+        final Collection<GridCacheSqlQuery> qrys,
+        final List<Integer> cacheIds,
+        final AffinityTopologyVersion topVer,
+        final Map<UUID, int[]> partsMap,
+        final int[] parts,
+        final int pageSize,
+        final DistributedJoinMode distributedJoinMode,
+        final boolean enforceJoinOrder,
+        final boolean replicated,
+        final int timeout,
+        final Object[] params,
         boolean lazy
     ) {
         if (lazy && MapQueryLazyWorker.currentWorker() == null) {
@@ -561,6 +561,13 @@ public class GridMapQueryExecutor {
             MapQueryLazyWorkerKey key = new MapQueryLazyWorkerKey(node.id(), reqId, segmentId);
             MapQueryLazyWorker worker = new MapQueryLazyWorker(ctx.igniteInstanceName(),
key, log);
 
+            worker.submit(new Runnable() {
+                @Override public void run() {
+                    onQueryRequest0(node, reqId, segmentId, schemaName, qrys, cacheIds, topVer,
partsMap, parts,
+                        pageSize, distributedJoinMode, enforceJoinOrder, replicated, timeout,
params, true);
+                }
+            });
+
             if (busyLock.enterBusy()) {
                 try {
                     MapQueryLazyWorker oldWorker = lazyWorkers.put(key, worker);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f9960dff/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/lazy/MapQueryLazyWorker.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/lazy/MapQueryLazyWorker.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/lazy/MapQueryLazyWorker.java
index 172e1ce..3d68831 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/lazy/MapQueryLazyWorker.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/lazy/MapQueryLazyWorker.java
@@ -69,6 +69,15 @@ public class MapQueryLazyWorker extends GridWorker {
     }
 
     /**
+     * Submit task to worker.
+     *
+     * @param task Task to be executed.
+     */
+    public void submit(Runnable task) {
+        tasks.add(task);
+    }
+
+    /**
      * @return Worker key.
      */
     public MapQueryLazyWorkerKey key() {
@@ -79,7 +88,7 @@ public class MapQueryLazyWorker extends GridWorker {
      * Stop the worker.
      */
     public void stop() {
-        tasks.add(new StopTask());
+        submit(new StopTask());
     }
 
     /**


Mime
View raw message