ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject ignite git commit: IGNITE-4242 ExchangeManager should wait for cache rebalancing in async way
Date Wed, 23 Nov 2016 09:34:52 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4242 3441b3deb -> 42ff3553a


IGNITE-4242 ExchangeManager should wait for cache rebalancing in async way


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

Branch: refs/heads/ignite-4242
Commit: 42ff3553ae447ef458a3d4f5f8559f2c11c7c1d0
Parents: 3441b3d
Author: Anton Vinogradov <av@apache.org>
Authored: Wed Nov 23 12:14:32 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Wed Nov 23 12:14:32 2016 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionDemander.java | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/42ff3553/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 390cd08..95bf897 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
@@ -280,20 +280,23 @@ public class GridDhtPartitionDemander {
 
             rebalanceFut = fut;
 
-            if (assigns.isEmpty())
+            if (assigns.isEmpty()) {
                 ((GridFutureAdapter)cctx.preloader().syncFuture()).onDone();
 
+                rebalanceFut.sendRebalanceFinishedEvent();
+            }
+
             return new Runnable() {
                 @Override public void run() {
                     if (next != null)
                         rebalanceFut.listen(new CI1<IgniteInternalFuture<Boolean>>()
{
                             @Override public void apply(IgniteInternalFuture<Boolean>
fut) {
-                                next.run();
+                                next.run(); // Starts next cache preloading (according to
the order).
                             }
                         });
 
                     if (assigns.isEmpty()) {
-                        rebalanceFut.onDone(true); // Starts next cache preloading (according
to order).
+                        rebalanceFut.onDone(true);
 
                         return;
                     }
@@ -1007,8 +1010,7 @@ public class GridDhtPartitionDemander {
          */
         private void checkIsDone(boolean cancelled, boolean wasEmpty) {
             if (remaining.isEmpty()) {
-                if (cctx.events().isRecordable(EVT_CACHE_REBALANCE_STOPPED) && (!cctx.isReplicated()
|| sndStoppedEvnt))
-                    preloadEvent(EVT_CACHE_REBALANCE_STOPPED, exchFut.discoveryEvent());
+                sendRebalanceFinishedEvent();
 
                 if (log.isDebugEnabled())
                     log.debug("Completed rebalance future: " + this);
@@ -1040,6 +1042,14 @@ public class GridDhtPartitionDemander {
             }
         }
 
+        /**
+         *
+         */
+        private void sendRebalanceFinishedEvent(){
+            if (cctx.events().isRecordable(EVT_CACHE_REBALANCE_STOPPED) && (!cctx.isReplicated()
|| sndStoppedEvnt))
+                preloadEvent(EVT_CACHE_REBALANCE_STOPPED, exchFut.discoveryEvent());;
+        }
+
         /** {@inheritDoc} */
         public String toString() {
             return S.toString(RebalanceFuture.class, this);


Mime
View raw message