ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/3] ignite git commit: 1093
Date Mon, 26 Oct 2015 11:28:05 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1093-2 c10b69c2c -> 9fab059e7


1093


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

Branch: refs/heads/ignite-1093-2
Commit: d64e2fd2f847b3bf2a789995d7dbb948fd44b935
Parents: c10b69c
Author: Anton Vinogradov <av@apache.org>
Authored: Mon Oct 26 13:33:49 2015 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Mon Oct 26 13:33:49 2015 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionDemander.java | 55 +++-----------------
 1 file changed, 7 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d64e2fd2/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 7d2ec6f..2277d41 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
@@ -33,9 +33,7 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.LinkedBlockingDeque;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantLock;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheRebalanceMode;
@@ -585,17 +583,11 @@ public class GridDhtPartitionDemander {
                     d, cctx.ioPolicy(), cctx.config().getRebalanceTimeout());
             }
         }
-        catch (ClusterTopologyCheckedException e) {
+        catch (IgniteCheckedException e) {
             if (log.isDebugEnabled())
                 log.debug("Node left during rebalancing [node=" + node.id() +
                     ", msg=" + e.getMessage() + ']');
         }
-        catch (IgniteCheckedException ex) {
-            U.error(log, "Failed to receive partitions from node (rebalancing will not "
+
-                "fully finish) [node=" + node.id() + ", msg=" + supply + ']', ex);
-
-            fut.cancel(node.id());
-        }
     }
 
     /**
@@ -715,9 +707,6 @@ public class GridDhtPartitionDemander {
         /** Missed. */
         private final Map<UUID, Collection<Integer>> missed = new HashMap<>();
 
-        /** Lock. */
-        private final Lock lock = new ReentrantLock();
-
         /** Exchange future. */
         @GridToStringExclude
         private final GridDhtPartitionsExchangeFuture exchFut;
@@ -788,23 +777,16 @@ public class GridDhtPartitionDemander {
          * @param parts Parts.
          */
         private void appendPartitions(UUID nodeId, Collection<Integer> parts) {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 remaining.put(nodeId, new T2<>(U.currentTimeMillis(), parts));
             }
-            finally {
-                lock.unlock();
-            }
         }
 
         /**
          *
          */
         private void doneIfEmpty() {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 if (isDone())
                     return;
 
@@ -816,9 +798,6 @@ public class GridDhtPartitionDemander {
 
                 checkIsDone();
             }
-            finally {
-                lock.unlock();
-            }
         }
 
         /**
@@ -827,9 +806,7 @@ public class GridDhtPartitionDemander {
          * @return {@code true}.
          */
         @Override public boolean cancel() {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 if (isDone())
                     return true;
 
@@ -840,9 +817,6 @@ public class GridDhtPartitionDemander {
 
                 checkIsDone(true /* cancelled */);
             }
-            finally {
-                lock.unlock();
-            }
 
             return true;
         }
@@ -851,9 +825,7 @@ public class GridDhtPartitionDemander {
          * @param nodeId Node id.
          */
         private void cancel(UUID nodeId) {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 if (isDone())
                     return;
 
@@ -865,9 +837,6 @@ public class GridDhtPartitionDemander {
 
                 checkIsDone();
             }
-            finally {
-                lock.unlock();
-            }
 
         }
 
@@ -876,9 +845,7 @@ public class GridDhtPartitionDemander {
          * @param p P.
          */
         private void partitionMissed(UUID nodeId, int p) {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 if (isDone())
                     return;
 
@@ -887,9 +854,6 @@ public class GridDhtPartitionDemander {
 
                 missed.get(nodeId).add(p);
             }
-            finally {
-                lock.unlock();
-            }
         }
 
         /**
@@ -897,9 +861,7 @@ public class GridDhtPartitionDemander {
          * @param p P.
          */
         private void partitionDone(UUID nodeId, int p) {
-            lock.lock();
-
-            try {
+            synchronized (this) {
                 if (isDone())
                     return;
 
@@ -924,9 +886,6 @@ public class GridDhtPartitionDemander {
 
                 checkIsDone();
             }
-            finally {
-                lock.unlock();
-            }
         }
 
         /**


Mime
View raw message