ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [38/50] ignite git commit: Fixed stop procedure.
Date Mon, 14 Aug 2017 10:30:48 GMT
Fixed stop procedure.


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

Branch: refs/heads/ignite-5991-6019
Commit: 5930e40e1ae772876759b428364760d77b1e7484
Parents: a7d33d6
Author: devozerov <vozerov@gridgain.com>
Authored: Mon Aug 14 11:42:23 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Aug 14 11:42:23 2017 +0300

----------------------------------------------------------------------
 .../ignite/examples/datagrid/TestExample.java   |  4 +--
 .../query/h2/twostep/MapQueryLazyWorker.java    | 29 ++++++--------------
 2 files changed, 10 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5930e40e/examples/src/main/java/org/apache/ignite/examples/datagrid/TestExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/TestExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/TestExample.java
index c0b921e..0faacbb 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/TestExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/TestExample.java
@@ -18,7 +18,7 @@ public class TestExample {
             IgniteCache<Long, Person> srvCache = srv.createCache(
                 new CacheConfiguration<Long, Person>().setName(CACHE_NAME).setIndexedTypes(Long.class,
Person.class));
 
-            for (long i = 0; i < 10_000; i++)
+            for (long i = 0; i < 1_000; i++)
                 srvCache.put(i, new Person(i, "First" + i, "Last" + i));
 
             System.out.println("PUT FINISHED");
@@ -28,7 +28,7 @@ public class TestExample {
 
                 IgniteCache<Long, Person> cliCache = cli.cache(CACHE_NAME);
 
-                SqlFieldsQuery qry = new SqlFieldsQuery("SELECT firstName FROM Person WHERE
1=1");
+                SqlFieldsQuery qry = new SqlFieldsQuery("SELECT firstName FROM Person WHERE
1=1").setLazy(true);
 
                 int cnt = 0;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5930e40e/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
index 8cc68e0..5d4cad0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
@@ -96,14 +96,14 @@ public class MapQueryLazyWorker extends GridWorker {
      * Stop the worker.
      */
     public void stop() {
-        submit(new StopTask());
-    }
-
-    /**
-     * Internal worker stop routine.
-     */
-    private void stop0() {
-        isCancelled = true;
+        if (MapQueryLazyWorker.currentWorker() == null)
+            submit(new Runnable() {
+                @Override public void run() {
+                    stop();
+                }
+            });
+        else
+            isCancelled = true;
     }
 
     /**
@@ -122,17 +122,4 @@ public class MapQueryLazyWorker extends GridWorker {
     private static String workerName(MapQueryLazyWorkerKey key) {
         return "query-lazy-worker_" + key.nodeId() + "_" + key.queryRequestId() + "_" + key.segment();
     }
-
-    /**
-     * Internal stop task.
-     */
-    private static class StopTask implements Runnable {
-        @Override public void run() {
-            MapQueryLazyWorker worker = LAZY_WORKER.get();
-
-            assert worker != null;
-
-            worker.stop0();
-        }
-    }
 }


Mime
View raw message