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 2016/12/01 11:33:37 UTC
[6/6] ignite git commit: ignite-4296
ignite-4296
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9c5205d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9c5205d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9c5205d
Branch: refs/heads/ignite-4296
Commit: a9c5205d8bc7d3df3204b4fcfd13d1a1c69fff6a
Parents: f6ef222
Author: sboikov <sb...@gridgain.com>
Authored: Thu Dec 1 14:06:56 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Dec 1 14:06:56 2016 +0300
----------------------------------------------------------------------
.../distributed/dht/GridClientPartitionTopology.java | 5 +++--
.../distributed/dht/GridDhtPartitionTopologyImpl.java | 11 +++++++----
2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c5205d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
index d8cd05b..816132d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
@@ -696,10 +696,9 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
boolean changed = cur == null || !cur.equals(parts);
- if (changed)
+ if (changed) {
node2part.put(parts.nodeId(), parts);
- if (changed) {
// Add new mappings.
for (Integer p : parts.keySet()) {
Set<UUID> ids = part2node.get(p);
@@ -725,6 +724,8 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
}
}
}
+ else
+ cur.updateSequence(parts.updateSequence(), parts.topologyVersion());
if (cntrMap != null) {
for (Map.Entry<Integer, Long> e : cntrMap.entrySet()) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9c5205d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index a264dbf..b8d6b83 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -330,8 +330,9 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
- @Override public void initPartitions(
- GridDhtPartitionsExchangeFuture exchFut) throws IgniteInterruptedCheckedException {
+ @Override public void initPartitions(GridDhtPartitionsExchangeFuture exchFut)
+ throws IgniteInterruptedCheckedException
+ {
U.writeLock(lock);
try {
@@ -1040,7 +1041,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
return false;
}
- long updateSeq = this.updateSeq.incrementAndGet();
+ final long updateSeq = this.updateSeq.incrementAndGet();
if (exchId != null)
lastExchangeId = exchId;
@@ -1220,6 +1221,8 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
}
}
+ else
+ cur.updateSequence(parts.updateSequence(), parts.topologyVersion());
if (checkEvictions)
changed |= checkEvictions(updateSeq);
@@ -1280,7 +1283,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
* @param aff Affinity assignments.
* @return Checks if any of the local partitions need to be evicted.
*/
- private boolean checkEvictions(ClusterNode oldest, long updateSeq, List<List<ClusterNode>> aff) {
+ private boolean checkEvictions(ClusterNode oldest, final long updateSeq, List<List<ClusterNode>> aff) {
boolean changed = false;
UUID locId = cctx.nodeId();