ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Ignite-1093
Date Mon, 07 Sep 2015 09:26:41 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1093-2 388b0e55d -> 18952f146


Ignite-1093


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

Branch: refs/heads/ignite-1093-2
Commit: 18952f1461d7ab8f8f829775ff0e75f0f906e633
Parents: 388b0e5
Author: Anton Vinogradov <av@apache.org>
Authored: Mon Sep 7 12:26:27 2015 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Mon Sep 7 12:26:27 2015 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionDemander.java  | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/18952f14/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index b7ecb97..4d575d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -251,7 +251,7 @@ public class GridDhtPartitionDemander {
 
             final SyncFuture cSF = fut;
 
-            new IgniteThread(cctx.gridName(), "demand-thread-" + cctx.cache().name(), new
Runnable() {
+            IgniteThread thread = new IgniteThread(cctx.gridName(), "demand-thread-" + cctx.cache().name(),
new Runnable() {
                 @Override public void run() {
                     if (!CU.isMarshallerCache(cctx.name())) {
                         if (log.isDebugEnabled())
@@ -322,8 +322,11 @@ public class GridDhtPartitionDemander {
 
                     requestPartitions(cSF);
                 }
-            }).start();
+            });
+
+            fut.setDemandThread(thread);
 
+            thread.start();
         }
         else if (delay > 0) {
             GridTimeoutObject obj = lastTimeoutObj.get();
@@ -765,6 +768,8 @@ public class GridDhtPartitionDemander {
         /** Started. */
         private ConcurrentHashMap8<UUID, Long> started = new ConcurrentHashMap8<>();
 
+        private volatile IgniteThread thread;
+
         /** Lock. */
         private Lock lock = new ReentrantLock();
 
@@ -811,6 +816,13 @@ public class GridDhtPartitionDemander {
         }
 
         /**
+         * @param thread
+         */
+        void setDemandThread(IgniteThread thread) {
+            this.thread = thread;
+        }
+
+        /**
          * @return Initialised or not.
          */
         boolean isInited() {
@@ -1006,6 +1018,9 @@ public class GridDhtPartitionDemander {
                 if (lsnr != null)
                     cctx.events().removeListener(lsnr);
 
+                if (thread != null)
+                    thread.interrupt();
+
                 onDone(completed);
             }
         }


Mime
View raw message