Repository: ignite Updated Branches: refs/heads/master e1ea70932 -> 807cab285
No need to return map from GridDhtPartitionTopology.updateXX methods. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/807cab28 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/807cab28 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/807cab28 Branch: refs/heads/master Commit: 807cab28575efd221a0cba9846549a6ad1273ed6 Parents: e1ea709 Author: sboikov <[email protected]> Authored: Mon Jun 19 16:44:07 2017 +0300 Committer: sboikov <[email protected]> Committed: Mon Jun 19 16:44:07 2017 +0300 ---------------------------------------------------------------------- .../GridCachePartitionExchangeManager.java | 4 ++-- .../dht/GridClientPartitionTopology.java | 20 +++++++++--------- .../dht/GridDhtPartitionTopology.java | 8 +++---- .../dht/GridDhtPartitionTopologyImpl.java | 22 ++++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/807cab28/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 f64fb21..dea690e 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 @@ -1272,7 +1272,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana top = grp.topology(); if (top != null) - updated |= top.update(null, entry.getValue(), null) != null; + updated |= top.update(null, entry.getValue(), null); } if (!cctx.kernalContext().clientNode() && updated) @@ -1319,7 +1319,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana top = grp.topology(); if (top != null) { - updated |= top.update(null, entry.getValue()) != null; + updated |= top.update(null, entry.getValue()); cctx.affinity().checkRebalanceState(top, grpId); } http://git-wip-us.apache.org/repos/asf/ignite/blob/807cab28/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 2d9e4f5..9c769a9 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 @@ -562,7 +562,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update( + @Override public boolean update( @Nullable AffinityTopologyVersion exchVer, GridDhtPartitionFullMap partMap, Map<Integer, T2<Long, Long>> cntrMap) { @@ -577,7 +577,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { log.debug("Stale exchange id for full partition map update (will ignore) [lastExchId=" + lastExchangeVer + ", exchVer=" + exchVer + ']'); - return null; + return false; } if (node2part != null && node2part.compareTo(partMap) >= 0) { @@ -585,7 +585,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { log.debug("Stale partition map for full partition map update (will ignore) [lastExchId=" + lastExchangeVer + ", exchVer=" + exchVer + ", curMap=" + node2part + ", newMap=" + partMap + ']'); - return null; + return false; } updateSeq.incrementAndGet(); @@ -648,7 +648,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { if (log.isDebugEnabled()) log.debug("Partition map after full update: " + fullMapString()); - return null; + return false; } finally { lock.writeLock().unlock(); @@ -676,7 +676,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update( + @Override public boolean update( @Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionMap parts ) { @@ -688,21 +688,21 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { log.debug("Received partition update for non-existing node (will ignore) [exchId=" + exchId + ", parts=" + parts + ']'); - return null; + return false; } lock.writeLock().lock(); try { if (stopping) - return null; + return false; if (lastExchangeVer != null && exchId != null && lastExchangeVer.compareTo(exchId.topologyVersion()) > 0) { if (log.isDebugEnabled()) log.debug("Stale exchange id for single partition map update (will ignore) [lastExchVer=" + lastExchangeVer + ", exchId=" + exchId + ']'); - return null; + return false; } if (exchId != null) @@ -719,7 +719,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { log.debug("Stale update sequence for single partition map update (will ignore) [exchId=" + exchId + ", curSeq=" + cur.updateSequence() + ", newSeq=" + parts.updateSequence() + ']'); - return null; + return false; } long updateSeq = this.updateSeq.incrementAndGet(); @@ -762,7 +762,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { if (log.isDebugEnabled()) log.debug("Partition map after single update: " + fullMapString()); - return changed ? localPartitionMap() : null; + return changed; } finally { lock.writeLock().unlock(); http://git-wip-us.apache.org/repos/asf/ignite/blob/807cab28/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java index acb822c..3c38942 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java @@ -225,9 +225,9 @@ public interface GridDhtPartitionTopology { * @param exchangeVer Exchange version. * @param partMap Update partition map. * @param cntrMap Partition update counters. - * @return Local partition map if there were evictions or {@code null} otherwise. + * @return {@code True} if local state was changed. */ - public GridDhtPartitionMap update( + public boolean update( @Nullable AffinityTopologyVersion exchangeVer, GridDhtPartitionFullMap partMap, @Nullable Map<Integer, T2<Long, Long>> cntrMap); @@ -235,9 +235,9 @@ public interface GridDhtPartitionTopology { /** * @param exchId Exchange ID. * @param parts Partitions. - * @return Local partition map if there were evictions or {@code null} otherwise. + * @return {@code True} if local state was changed. */ - @Nullable public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, + public boolean update(@Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionMap parts); /** http://git-wip-us.apache.org/repos/asf/ignite/blob/807cab28/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 ea731f8..f3170fa 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 @@ -1110,7 +1110,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Override public GridDhtPartitionMap update( + @Override public boolean update( @Nullable AffinityTopologyVersion exchangeVer, GridDhtPartitionFullMap partMap, @Nullable Map<Integer, T2<Long, Long>> cntrMap @@ -1124,7 +1124,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { try { if (stopping) - return null; + return false; if (cntrMap != null) { // update local map partition counters @@ -1154,7 +1154,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { log.debug("Stale exchange id for full partition map update (will ignore) [lastExch=" + lastExchangeVer + ", exch=" + exchangeVer + ']'); - return null; + return false; } if (node2part != null && node2part.compareTo(partMap) >= 0) { @@ -1162,7 +1162,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { log.debug("Stale partition map for full partition map update (will ignore) [lastExch=" + lastExchangeVer + ", exch=" + exchangeVer + ", curMap=" + node2part + ", newMap=" + partMap + ']'); - return null; + return false; } long updateSeq = this.updateSeq.incrementAndGet(); @@ -1269,7 +1269,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (changed) ctx.exchange().scheduleResendPartitions(); - return changed ? localPartitionMap() : null; + return changed; } finally { lock.writeLock().unlock(); @@ -1313,7 +1313,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update( + @Override public boolean update( @Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionMap parts ) { @@ -1325,21 +1325,21 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { log.debug("Received partition update for non-existing node (will ignore) [exchId=" + exchId + ", parts=" + parts + ']'); - return null; + return false; } lock.writeLock().lock(); try { if (stopping) - return null; + return false; if (lastExchangeVer != null && exchId != null && lastExchangeVer.compareTo(exchId.topologyVersion()) > 0) { if (log.isDebugEnabled()) log.debug("Stale exchange id for single partition map update (will ignore) [lastExch=" + lastExchangeVer + ", exch=" + exchId.topologyVersion() + ']'); - return null; + return false; } if (exchId != null) @@ -1356,7 +1356,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { log.debug("Stale update sequence for single partition map update (will ignore) [exchId=" + exchId + ", curSeq=" + cur.updateSequence() + ", newSeq=" + parts.updateSequence() + ']'); - return null; + return false; } long updateSeq = this.updateSeq.incrementAndGet(); @@ -1412,7 +1412,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (changed) ctx.exchange().scheduleResendPartitions(); - return changed ? localPartitionMap() : null; + return changed; } finally { lock.writeLock().unlock();
