You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/09/22 13:13:39 UTC
[12/16] ignite git commit: 1093
1093
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2cb397ad
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2cb397ad
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2cb397ad
Branch: refs/heads/ignite-1093-2
Commit: 2cb397add05d07ea6199e9de5ae59474f8f94c26
Parents: 9e0eafe
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 18 18:09:21 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 18 18:09:21 2015 +0300
----------------------------------------------------------------------
.../dht/preloader/GridDhtPartitionSupplier.java | 32 ++++++++++----------
1 file changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2cb397ad/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
index 0641612..50d64f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
@@ -48,6 +48,7 @@ import org.jsr166.ConcurrentHashMap8;
import static org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_STOPPED;
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
+import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING;
@@ -97,28 +98,27 @@ class GridDhtPartitionSupplier {
void start() {
lsnr = new GridLocalEventListener() {
@Override public void onEvent(Event evt) {
- int lsnrCnt = cctx.gridConfig().getRebalanceThreadPoolSize();
-
- for (int idx = 0; idx < lsnrCnt; idx++) {
- ClusterNode node;
- if (evt instanceof CacheRebalancingEvent)
- node = ((CacheRebalancingEvent)evt).discoveryNode();
- else if (evt instanceof DiscoveryEvent)
- node = ((DiscoveryEvent)evt).eventNode();
- else {
- assert false;
-
- return;
- }
+ if (evt instanceof CacheRebalancingEvent) {
+ ClusterNode node = ((CacheRebalancingEvent)evt).discoveryNode();
- T2<UUID, Integer> scId = new T2<>(node.id(), idx);
+ int lsnrCnt = cctx.gridConfig().getRebalanceThreadPoolSize();
- tryClearContext(scMap, scId, log);
+ for (int idx = 0; idx < lsnrCnt; idx++) {
+ T2<UUID, Integer> scId = new T2<>(node.id(), idx);
+
+ tryClearContext(scMap, scId, log);
+ }
+ }
+ else if (evt instanceof DiscoveryEvent) {
+ scMap.clear();
+ }
+ else {
+ assert false;
}
}
};
- cctx.events().addListener(lsnr, EVT_NODE_LEFT, EVT_NODE_FAILED, EVT_CACHE_REBALANCE_STOPPED);
+ cctx.events().addListener(lsnr, EVT_NODE_JOINED, EVT_NODE_LEFT, EVT_NODE_FAILED, EVT_CACHE_REBALANCE_STOPPED);
startOldListeners();
}