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 2018/11/29 14:42:29 UTC
[4/4] ignite git commit: 10044
10044
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/94ec2f89
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/94ec2f89
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/94ec2f89
Branch: refs/heads/ignite-10044
Commit: 94ec2f89255aa15fd7860f390167239d7d2f8f37
Parents: a284207
Author: sboikov <sb...@apache.org>
Authored: Thu Nov 29 17:42:13 2018 +0300
Committer: sboikov <sb...@apache.org>
Committed: Thu Nov 29 17:42:13 2018 +0300
----------------------------------------------------------------------
.../cache/GridCachePartitionExchangeManager.java | 2 +-
.../dht/topology/GridClientPartitionTopology.java | 12 +++++++++++-
.../dht/topology/GridDhtPartitionTopologyImpl.java | 2 +-
3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/94ec2f89/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 6dad367..38cbe46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -854,7 +854,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
aff.partitions());
GridClientPartitionTopology old = clientTops.putIfAbsent(grpId,
- top = new GridClientPartitionTopology(cctx, discoCache, grpId, aff.partitions(), affKey));
+ top = new GridClientPartitionTopology(cctx, discoCache, grpId, aff.partitions(), ccfg.getPartitionLossPolicy(), affKey));
return old != null ? old : top;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/94ec2f89/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
index feca1e7..02faa51 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
@@ -32,6 +32,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.stream.Collectors;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.PartitionLossPolicy;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
@@ -127,6 +128,9 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
private volatile Map<Integer, Long> globalPartSizes;
/** */
+ private final PartitionLossPolicy partLossPlc;
+
+ /** */
private TreeSet<Integer> lostParts;
/**
@@ -134,6 +138,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
* @param discoCache Discovery data cache.
* @param grpId Group ID.
* @param parts Number of partitions in the group.
+ * @param partLossPlc Partition loss policy.
* @param similarAffKey Key to find caches with similar affinity.
*/
public GridClientPartitionTopology(
@@ -141,6 +146,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
DiscoCache discoCache,
int grpId,
int parts,
+ PartitionLossPolicy partLossPlc,
Object similarAffKey
) {
this.cctx = cctx;
@@ -148,6 +154,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
this.grpId = grpId;
this.similarAffKey = similarAffKey;
this.parts = parts;
+ this.partLossPlc = partLossPlc;
topVer = AffinityTopologyVersion.NONE;
@@ -944,7 +951,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
if (cur == null || !cur.equals(parts))
changed = true;
- if (lostParts != null) {
+ if (lostParts != null && partLossPlc != PartitionLossPolicy.IGNORE) {
for (Integer lostPart : lostParts) {
GridDhtPartitionState state0 = parts.get(lostPart);
@@ -1005,6 +1012,9 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
/** {@inheritDoc} */
@Override public boolean detectLostPartitions(AffinityTopologyVersion affVer, DiscoveryEvent discoEvt) {
+ if (partLossPlc == PartitionLossPolicy.IGNORE)
+ return false;
+
lock.writeLock().lock();
http://git-wip-us.apache.org/repos/asf/ignite/blob/94ec2f89/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
index d518467..cc8a198 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
@@ -1807,7 +1807,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
if (cur == null || !cur.equals(parts))
changed = true;
- if (lostParts != null) {
+ if (lostParts != null && grp.config().getPartitionLossPolicy() != PartitionLossPolicy.IGNORE) {
for (Integer lostPart : lostParts) {
GridDhtPartitionState state0 = parts.get(lostPart);