Ignite-1913
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bcfe78b0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bcfe78b0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bcfe78b0 Branch: refs/heads/ignite-sql-opt Commit: bcfe78b030392ed74209ea40e83c8baaf02eb314 Parents: 900788b Author: Anton Vinogradov <[email protected]> Authored: Fri Nov 20 18:16:49 2015 +0300 Committer: Anton Vinogradov <[email protected]> Committed: Fri Nov 20 18:16:49 2015 +0300 ---------------------------------------------------------------------- .../stream/camel/IgniteCamelStreamerTest.java | 16 +- .../camel/IgniteCamelStreamerTestSuite.java | 1 - .../internal/MarshallerContextAdapter.java | 4 +- .../GridCachePartitionExchangeManager.java | 34 ++- .../dht/GridClientPartitionTopology.java | 38 +-- .../distributed/dht/GridDhtLockFuture.java | 1 - .../dht/GridDhtPartitionTopology.java | 12 +- .../dht/GridDhtPartitionTopologyImpl.java | 45 +-- .../distributed/dht/GridDhtTxPrepareFuture.java | 1 - .../dht/GridPartitionedGetFuture.java | 2 +- .../colocated/GridDhtColocatedLockFuture.java | 1 - .../dht/preloader/GridDhtPartitionFullMap.java | 41 ++- .../dht/preloader/GridDhtPartitionMap.java | 148 +-------- .../dht/preloader/GridDhtPartitionMap2.java | 306 +++++++++++++++++++ .../GridDhtPartitionsExchangeFuture.java | 24 +- .../GridDhtPartitionsSingleMessage.java | 6 +- .../distributed/near/GridNearCacheAdapter.java | 1 - .../distributed/near/GridNearGetFuture.java | 2 - .../distributed/near/GridNearLockFuture.java | 2 - ...arOptimisticSerializableTxPrepareFuture.java | 3 - .../near/GridNearOptimisticTxPrepareFuture.java | 1 - .../near/GridNearTxFinishFuture.java | 4 - .../distributed/near/GridNearTxRemote.java | 1 - .../processors/cache/local/GridLocalCache.java | 1 - .../cache/local/GridLocalLockFuture.java | 2 - .../cache/transactions/IgniteInternalTx.java | 1 - .../cache/transactions/IgniteTxAdapter.java | 1 - .../transactions/IgniteTxLocalAdapter.java | 1 - .../cache/transactions/IgniteTxManager.java | 1 - .../cache/transactions/IgniteTxStateImpl.java | 1 - .../ignite/internal/visor/cache/VisorCache.java | 6 +- .../org/apache/ignite/stream/StreamAdapter.java | 1 - .../resources/META-INF/classnames.properties | 1 + .../dht/GridCacheDhtPreloadDelayedSelfTest.java | 12 +- .../dht/GridCacheDhtPreloadSelfTest.java | 4 +- .../distributed/dht/GridCacheDhtTestUtils.java | 8 +- ...cingDelayedPartitionMapExchangeSelfTest.java | 178 +++++++++++ .../testsuites/IgniteCacheTestSuite3.java | 2 + .../h2/twostep/GridReduceQueryExecutor.java | 4 +- .../cache/WaitMapExchangeFinishCallable.java | 4 +- .../IgniteFailoverAbstractBenchmark.java | 4 +- 41 files changed, 661 insertions(+), 265 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java ---------------------------------------------------------------------- diff --git a/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java b/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java index 4795dff..f921a59 100644 --- a/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java +++ b/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTest.java @@ -17,6 +17,13 @@ package org.apache.ignite.stream.camel; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.OkHttpClient; +import com.squareup.okhttp.Request; +import com.squareup.okhttp.RequestBody; +import com.squareup.okhttp.Response; import java.io.IOException; import java.net.ServerSocket; import java.util.ArrayList; @@ -28,7 +35,6 @@ import java.util.UUID; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; - import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.Exchange; @@ -51,14 +57,6 @@ import org.apache.ignite.stream.StreamMultipleTupleExtractor; import org.apache.ignite.stream.StreamSingleTupleExtractor; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT; /** http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTestSuite.java b/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTestSuite.java index 266c9cf..fa7f542 100644 --- a/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTestSuite.java +++ b/modules/camel/src/test/java/org/apache/ignite/stream/camel/IgniteCamelStreamerTestSuite.java @@ -18,7 +18,6 @@ package org.apache.ignite.stream.camel; import java.util.Set; - import junit.framework.TestSuite; /** http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java index c25da03..ad34393 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java @@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentMap; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; -import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.marshaller.MarshallerContext; import org.apache.ignite.plugin.PluginProvider; @@ -86,7 +86,7 @@ public abstract class MarshallerContextAdapter implements MarshallerContext { processResource(jdkClsNames); checkHasClassName(GridDhtPartitionFullMap.class.getName(), ldr, CLS_NAMES_FILE); - checkHasClassName(GridDhtPartitionMap.class.getName(), ldr, CLS_NAMES_FILE); + checkHasClassName(GridDhtPartitionMap2.class.getName(), ldr, CLS_NAMES_FILE); checkHasClassName(HashMap.class.getName(), ldr, JDK_CLS_NAMES_FILE); if (plugins != null && !plugins.isEmpty()) { http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/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 cd89416..875a4e8 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 @@ -56,6 +56,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage; @@ -746,9 +747,23 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana private boolean sendAllPartitions(Collection<? extends ClusterNode> nodes) { GridDhtPartitionsFullMessage m = new GridDhtPartitionsFullMessage(null, null, AffinityTopologyVersion.NONE); + boolean useOldApi = false; + + for (ClusterNode node : nodes) { + if (node.version().compareTo(GridDhtPartitionMap2.SINCE) < 0) + useOldApi = true; + } + for (GridCacheContext cacheCtx : cctx.cacheContexts()) { - if (!cacheCtx.isLocal() && cacheCtx.started()) - m.addFullPartitionsMap(cacheCtx.cacheId(), cacheCtx.topology().partitionMap(true)); + if (!cacheCtx.isLocal() && cacheCtx.started()) { + GridDhtPartitionFullMap locMap = cacheCtx.topology().partitionMap(true); + + if (useOldApi) { + locMap = new GridDhtPartitionFullMap(locMap.nodeId(), locMap.nodeOrder(), locMap.updateSequence(), locMap); + } + + m.addFullPartitionsMap(cacheCtx.cacheId(), locMap); + } } // It is important that client topologies be added after contexts. @@ -786,14 +801,17 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana for (GridCacheContext cacheCtx : cctx.cacheContexts()) { if (!cacheCtx.isLocal()) { - GridDhtPartitionMap locMap = cacheCtx.topology().localPartitionMap(); + GridDhtPartitionMap2 locMap = cacheCtx.topology().localPartitionMap(); + + if (node.version().compareTo(GridDhtPartitionMap2.SINCE) < 0) + locMap = new GridDhtPartitionMap(locMap.nodeId(), locMap.updateSequence(), locMap.map()); m.addLocalPartitionMap(cacheCtx.cacheId(), locMap); } } for (GridClientPartitionTopology top : clientTops.values()) { - GridDhtPartitionMap locMap = top.localPartitionMap(); + GridDhtPartitionMap2 locMap = top.localPartitionMap(); m.addLocalPartitionMap(top.cacheId(), locMap); } @@ -1019,11 +1037,17 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana boolean updated = false; - for (Map.Entry<Integer, GridDhtPartitionMap> entry : msg.partitions().entrySet()) { + for (Map.Entry<Integer, GridDhtPartitionMap2> entry : msg.partitions().entrySet()) { Integer cacheId = entry.getKey(); GridCacheContext<K, V> cacheCtx = cctx.cacheContext(cacheId); + if (cacheCtx != null && cacheCtx.startTopologyVersion() != null && + entry.getValue() != null && + entry.getValue().topologyVersion() != null && // Backward compatibility. + cacheCtx.startTopologyVersion().compareTo(entry.getValue().topologyVersion()) > 0) + continue; + GridDhtPartitionTopology top = null; if (cacheCtx == null) http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/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 b7169bf..8aef5ad 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 @@ -35,7 +35,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; -import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; import org.apache.ignite.internal.util.F0; import org.apache.ignite.internal.util.GridAtomicLong; @@ -137,7 +137,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { * @return Full map string representation. */ @SuppressWarnings( {"ConstantConditions"}) - private String mapString(GridDhtPartitionMap map) { + private String mapString(GridDhtPartitionMap2 map) { return map == null ? "null" : FULL_MAP_DEBUG ? map.toFullString() : map.toString(); } @@ -358,11 +358,11 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { } /** {@inheritDoc} */ - @Override public GridDhtPartitionMap localPartitionMap() { + @Override public GridDhtPartitionMap2 localPartitionMap() { lock.readLock().lock(); try { - return new GridDhtPartitionMap(cctx.localNodeId(), updateSeq.get(), + return new GridDhtPartitionMap2(cctx.localNodeId(), updateSeq.get(), topVer, Collections.<Integer, GridDhtPartitionState>emptyMap(), true); } finally { @@ -375,7 +375,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { lock.readLock().lock(); try { - GridDhtPartitionMap partMap = node2part.get(nodeId); + GridDhtPartitionMap2 partMap = node2part.get(nodeId); if (partMap != null) { GridDhtPartitionState state = partMap.get(part); @@ -529,7 +529,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, + @Nullable @Override public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionFullMap partMap, Map<Integer, Long> cntrMap) { if (log.isDebugEnabled()) @@ -560,8 +560,8 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { lastExchangeId = exchId; if (node2part != null) { - for (GridDhtPartitionMap part : node2part.values()) { - GridDhtPartitionMap newPart = partMap.get(part.nodeId()); + for (GridDhtPartitionMap2 part : node2part.values()) { + GridDhtPartitionMap2 newPart = partMap.get(part.nodeId()); // If for some nodes current partition has a newer map, // then we keep the newer value. @@ -591,7 +591,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { Map<Integer, Set<UUID>> p2n = new HashMap<>(); - for (Map.Entry<UUID, GridDhtPartitionMap> e : partMap.entrySet()) { + for (Map.Entry<UUID, GridDhtPartitionMap2> e : partMap.entrySet()) { for (Integer p : e.getValue().keySet()) { Set<UUID> ids = p2n.get(p); @@ -623,8 +623,8 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, - GridDhtPartitionMap parts, + @Nullable @Override public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, + GridDhtPartitionMap2 parts, Map<Integer, Long> cntrMap) { if (log.isDebugEnabled()) log.debug("Updating single partition map [exchId=" + exchId + ", parts=" + mapString(parts) + ']'); @@ -661,7 +661,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { node2part = new GridDhtPartitionFullMap(); } - GridDhtPartitionMap cur = node2part.get(parts.nodeId()); + GridDhtPartitionMap2 cur = node2part.get(parts.nodeId()); if (cur != null && cur.updateSequence() >= parts.updateSequence()) { if (log.isDebugEnabled()) @@ -766,10 +766,10 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { } } - GridDhtPartitionMap map = node2part.get(nodeId); + GridDhtPartitionMap2 map = node2part.get(nodeId); if (map == null) - node2part.put(nodeId, map = new GridDhtPartitionMap(nodeId, updateSeq, + node2part.put(nodeId, map = new GridDhtPartitionMap2(nodeId, updateSeq, topVer, Collections.<Integer, GridDhtPartitionState>emptyMap(), false)); map.updateSequence(updateSeq); @@ -807,7 +807,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { part2node = new HashMap<>(part2node); - GridDhtPartitionMap parts = node2part.remove(nodeId); + GridDhtPartitionMap2 parts = node2part.remove(nodeId); if (parts != null) { for (Integer p : parts.keySet()) { @@ -857,7 +857,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { } /** {@inheritDoc} */ - @Nullable @Override public GridDhtPartitionMap partitions(UUID nodeId) { + @Nullable @Override public GridDhtPartitionMap2 partitions(UUID nodeId) { lock.readLock().lock(); try { @@ -902,7 +902,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { if (nodeId == null) return false; - GridDhtPartitionMap parts = node2part.get(nodeId); + GridDhtPartitionMap2 parts = node2part.get(nodeId); // Set can be null if node has been removed. if (parts != null) { @@ -930,7 +930,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { if (node2part == null) return; - for (Map.Entry<UUID, GridDhtPartitionMap> e : node2part.entrySet()) { + for (Map.Entry<UUID, GridDhtPartitionMap2> e : node2part.entrySet()) { for (Integer p : e.getValue().keySet()) { Set<UUID> nodeIds = part2node.get(p); @@ -942,7 +942,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { for (Map.Entry<Integer, Set<UUID>> e : part2node.entrySet()) { for (UUID nodeId : e.getValue()) { - GridDhtPartitionMap map = node2part.get(nodeId); + GridDhtPartitionMap2 map = node2part.get(nodeId); assert map != null : "Failed consistency check [part=" + e.getKey() + ", nodeId=" + nodeId + ']'; assert map.containsKey(e.getKey()) : "Failed consistency check [part=" + e.getKey() + http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java index a7978c9..75deac7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java @@ -63,7 +63,6 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.NotNull; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/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 3ac2b85..dd06d6f 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 @@ -27,7 +27,7 @@ import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; -import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.jetbrains.annotations.Nullable; @@ -135,7 +135,7 @@ public interface GridDhtPartitionTopology { /** * @return Local IDs. */ - public GridDhtPartitionMap localPartitionMap(); + public GridDhtPartitionMap2 localPartitionMap(); /** * @param nodeId Node ID. @@ -199,7 +199,7 @@ public interface GridDhtPartitionTopology { * @param cntrMap Partition update counters. * @return Local partition map if there were evictions or {@code null} otherwise. */ - public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, + public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionFullMap partMap, @Nullable Map<Integer, Long> cntrMap); @@ -209,8 +209,8 @@ public interface GridDhtPartitionTopology { * @param cntrMap Partition update counters. * @return Local partition map if there were evictions or {@code null} otherwise. */ - @Nullable public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, - GridDhtPartitionMap parts, + @Nullable public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, + GridDhtPartitionMap2 parts, @Nullable Map<Integer, Long> cntrMap); /** @@ -234,7 +234,7 @@ public interface GridDhtPartitionTopology { * @param nodeId Node to get partitions for. * @return Partitions for node. */ - @Nullable public GridDhtPartitionMap partitions(UUID nodeId); + @Nullable public GridDhtPartitionMap2 partitions(UUID nodeId); /** * Prints memory stats. http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/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 39c55db..a0709c5 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 @@ -39,7 +39,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; -import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; import org.apache.ignite.internal.util.F0; import org.apache.ignite.internal.util.GridAtomicLong; @@ -158,7 +158,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { * @return Full map string representation. */ @SuppressWarnings( {"ConstantConditions"}) - private String mapString(GridDhtPartitionMap map) { + private String mapString(GridDhtPartitionMap2 map) { return map == null ? "null" : FULL_MAP_DEBUG ? map.toFullString() : map.toString(); } @@ -664,11 +664,11 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } /** {@inheritDoc} */ - @Override public GridDhtPartitionMap localPartitionMap() { + @Override public GridDhtPartitionMap2 localPartitionMap() { lock.readLock().lock(); try { - return new GridDhtPartitionMap(cctx.nodeId(), updateSeq.get(), + return new GridDhtPartitionMap2(cctx.nodeId(), updateSeq.get(), topVer, F.viewReadOnly(locParts, CU.part2state()), true); } finally { @@ -681,7 +681,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { lock.readLock().lock(); try { - GridDhtPartitionMap partMap = node2part.get(nodeId); + GridDhtPartitionMap2 partMap = node2part.get(nodeId); if (partMap != null) { GridDhtPartitionState state = partMap.get(part); @@ -847,7 +847,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, + @Nullable @Override public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, GridDhtPartitionFullMap partMap, @Nullable Map<Integer, Long> cntrMap) { if (log.isDebugEnabled()) @@ -899,12 +899,17 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { lastExchangeId = exchId; if (node2part != null) { - for (GridDhtPartitionMap part : node2part.values()) { - GridDhtPartitionMap newPart = partMap.get(part.nodeId()); + for (GridDhtPartitionMap2 part : node2part.values()) { + GridDhtPartitionMap2 newPart = partMap.get(part.nodeId()); // If for some nodes current partition has a newer map, // then we keep the newer value. - if (newPart != null && newPart.updateSequence() < part.updateSequence()) { + if (newPart != null && + (newPart.updateSequence() < part.updateSequence() || ( + cctx.startTopologyVersion() != null && + newPart.topologyVersion() != null && // Backward compatibility. + cctx.startTopologyVersion().compareTo(newPart.topologyVersion()) > 0)) + ) { if (log.isDebugEnabled()) log.debug("Overriding partition map in full update map [exchId=" + exchId + ", curPart=" + mapString(part) + ", newPart=" + mapString(newPart) + ']'); @@ -930,7 +935,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { Map<Integer, Set<UUID>> p2n = new HashMap<>(cctx.affinity().partitions(), 1.0f); - for (Map.Entry<UUID, GridDhtPartitionMap> e : partMap.entrySet()) { + for (Map.Entry<UUID, GridDhtPartitionMap2> e : partMap.entrySet()) { for (Integer p : e.getValue().keySet()) { Set<UUID> ids = p2n.get(p); @@ -963,8 +968,8 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) - @Nullable @Override public GridDhtPartitionMap update(@Nullable GridDhtPartitionExchangeId exchId, - GridDhtPartitionMap parts, @Nullable Map<Integer, Long> cntrMap) { + @Nullable @Override public GridDhtPartitionMap2 update(@Nullable GridDhtPartitionExchangeId exchId, + GridDhtPartitionMap2 parts, @Nullable Map<Integer, Long> cntrMap) { if (log.isDebugEnabled()) log.debug("Updating single partition map [exchId=" + exchId + ", parts=" + mapString(parts) + ']'); @@ -1013,7 +1018,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { // Create invalid partition map. node2part = new GridDhtPartitionFullMap(); - GridDhtPartitionMap cur = node2part.get(parts.nodeId()); + GridDhtPartitionMap2 cur = node2part.get(parts.nodeId()); if (cur != null && cur.updateSequence() >= parts.updateSequence()) { if (log.isDebugEnabled()) @@ -1186,10 +1191,10 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } } - GridDhtPartitionMap map = node2part.get(nodeId); + GridDhtPartitionMap2 map = node2part.get(nodeId); if (map == null) - node2part.put(nodeId, map = new GridDhtPartitionMap(nodeId, updateSeq, + node2part.put(nodeId, map = new GridDhtPartitionMap2(nodeId, updateSeq, topVer, Collections.<Integer, GridDhtPartitionState>emptyMap(), false)); map.updateSequence(updateSeq); @@ -1229,7 +1234,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { part2node = new HashMap<>(part2node); - GridDhtPartitionMap parts = node2part.remove(nodeId); + GridDhtPartitionMap2 parts = node2part.remove(nodeId); if (parts != null) { for (Integer p : parts.keySet()) { @@ -1296,7 +1301,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } /** {@inheritDoc} */ - @Nullable @Override public GridDhtPartitionMap partitions(UUID nodeId) { + @Nullable @Override public GridDhtPartitionMap2 partitions(UUID nodeId) { lock.readLock().lock(); try { @@ -1383,7 +1388,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (nodeId == null) return false; - GridDhtPartitionMap parts = node2part.get(nodeId); + GridDhtPartitionMap2 parts = node2part.get(nodeId); // Set can be null if node has been removed. if (parts != null) { @@ -1411,7 +1416,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (node2part == null) return; - for (Map.Entry<UUID, GridDhtPartitionMap> e : node2part.entrySet()) { + for (Map.Entry<UUID, GridDhtPartitionMap2> e : node2part.entrySet()) { for (Integer p : e.getValue().keySet()) { Set<UUID> nodeIds = part2node.get(p); @@ -1423,7 +1428,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { for (Map.Entry<Integer, Set<UUID>> e : part2node.entrySet()) { for (UUID nodeId : e.getValue()) { - GridDhtPartitionMap map = node2part.get(nodeId); + GridDhtPartitionMap2 map = node2part.get(nodeId); assert map != null : "Failed consistency check [part=" + e.getKey() + ", nodeId=" + nodeId + ']'; assert map.containsKey(e.getKey()) : "Failed consistency check [part=" + e.getKey() + http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java index 4cb5d05..745a427 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java @@ -74,7 +74,6 @@ import org.apache.ignite.internal.util.typedef.T2; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteFutureCancelledException; import org.apache.ignite.lang.IgniteReducer; import org.apache.ignite.lang.IgniteUuid; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index c3d9836..3b92aab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -59,7 +59,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteUuid; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.*; +import static org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedSingleGetFuture.SINGLE_GET_MSG_SINCE; /** * Colocated get future. http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java index 8245d88..844d995 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java @@ -66,7 +66,6 @@ import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.Nullable; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionFullMap.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionFullMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionFullMap.java index ce2ba6c..498d492 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionFullMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionFullMap.java @@ -31,7 +31,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; /** * Full partition map. */ -public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> +public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap2> implements Comparable<GridDhtPartitionFullMap>, Externalizable { /** */ private static final long serialVersionUID = 0L; @@ -65,9 +65,32 @@ public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> * @param nodeOrder Node order. * @param updateSeq Update sequence number. * @param m Map to copy. + */ + @Deprecated // Backward compatibility. + public GridDhtPartitionFullMap(UUID nodeId, long nodeOrder, long updateSeq, Map<UUID, GridDhtPartitionMap2> m) { + assert nodeId != null; + assert updateSeq > 0; + assert nodeOrder > 0; + + this.nodeId = nodeId; + this.nodeOrder = nodeOrder; + this.updateSeq = updateSeq; + + for (Map.Entry<UUID, GridDhtPartitionMap2> e : m.entrySet()) { + GridDhtPartitionMap2 part = e.getValue(); + + put(e.getKey(), new GridDhtPartitionMap(part.nodeId(), part.updateSequence(), part.map())); + } + } + + /** + * @param nodeId Node ID. + * @param nodeOrder Node order. + * @param updateSeq Update sequence number. + * @param m Map to copy. * @param onlyActive If {@code true}, then only active partitions will be included. */ - public GridDhtPartitionFullMap(UUID nodeId, long nodeOrder, long updateSeq, Map<UUID, GridDhtPartitionMap> m, + public GridDhtPartitionFullMap(UUID nodeId, long nodeOrder, long updateSeq, Map<UUID, GridDhtPartitionMap2> m, boolean onlyActive) { assert nodeId != null; assert updateSeq > 0; @@ -77,11 +100,11 @@ public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> this.nodeOrder = nodeOrder; this.updateSeq = updateSeq; - for (Map.Entry<UUID, GridDhtPartitionMap> e : m.entrySet()) { - GridDhtPartitionMap part = e.getValue(); + for (Map.Entry<UUID, GridDhtPartitionMap2> e : m.entrySet()) { + GridDhtPartitionMap2 part = e.getValue(); if (onlyActive) - put(e.getKey(), new GridDhtPartitionMap(part.nodeId(), part.updateSequence(), part.map(), true)); + put(e.getKey(), new GridDhtPartitionMap2(part.nodeId(), part.updateSequence(), part.topologyVersion(), part.map(), true)); else put(e.getKey(), part); } @@ -187,7 +210,7 @@ public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> nodeOrder = in.readLong(); updateSeq = in.readLong(); - putAll(U.<UUID, GridDhtPartitionMap>readMap(in)); + putAll(U.<UUID, GridDhtPartitionMap2>readMap(in)); } /** {@inheritDoc} */ @@ -209,7 +232,7 @@ public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> * @return Map string representation. */ public String map2string() { - Iterator<Map.Entry<UUID, GridDhtPartitionMap>> it = entrySet().iterator(); + Iterator<Map.Entry<UUID, GridDhtPartitionMap2>> it = entrySet().iterator(); if (!it.hasNext()) return "{}"; @@ -219,11 +242,11 @@ public class GridDhtPartitionFullMap extends HashMap<UUID, GridDhtPartitionMap> buf.append('{'); while(true) { - Map.Entry<UUID, GridDhtPartitionMap> e = it.next(); + Map.Entry<UUID, GridDhtPartitionMap2> e = it.next(); UUID nodeId = e.getKey(); - GridDhtPartitionMap partMap = e.getValue(); + GridDhtPartitionMap2 partMap = e.getValue(); buf.append(nodeId).append('=').append(partMap.toFullString()); http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java index 86372ca..3096d63 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java @@ -21,56 +21,27 @@ import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.util.HashMap; import java.util.Map; -import java.util.Set; import java.util.UUID; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING; - /** * Partition map. */ -public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Externalizable { +@Deprecated // Backward compatibility, use GridDhtPartitionMap2 instead. +public class GridDhtPartitionMap extends GridDhtPartitionMap2 { /** */ private static final long serialVersionUID = 0L; - /** Node ID. */ - private UUID nodeId; - - /** Update sequence number. */ - private long updateSeq; - - /** */ - private Map<Integer, GridDhtPartitionState> map; - - /** */ - private volatile int moving; - - /** - * @param nodeId Node ID. - * @param updateSeq Update sequence number. - */ - public GridDhtPartitionMap(UUID nodeId, long updateSeq) { - assert nodeId != null; - assert updateSeq > 0; - - this.nodeId = nodeId; - this.updateSeq = updateSeq; - - map = new HashMap<>(); - } - /** * @param nodeId Node ID. * @param updateSeq Update sequence number. * @param m Map to copy. - * @param onlyActive If {@code true}, then only active states will be included. */ - public GridDhtPartitionMap(UUID nodeId, long updateSeq, Map<Integer, GridDhtPartitionState> m, boolean onlyActive) { + public GridDhtPartitionMap(UUID nodeId, long updateSeq, + Map<Integer, GridDhtPartitionState> m) { assert nodeId != null; assert updateSeq > 0; @@ -82,8 +53,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext for (Map.Entry<Integer, GridDhtPartitionState> e : m.entrySet()) { GridDhtPartitionState state = e.getValue(); - if (!onlyActive || state.active()) - put(e.getKey(), state); + put(e.getKey(), state); } } @@ -94,108 +64,6 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext // No-op. } - /** - * @param part Partition. - * @param state Partition state. - */ - public void put(Integer part, GridDhtPartitionState state) { - GridDhtPartitionState old = map.put(part, state); - - if (old == MOVING) - moving--; - - if (state == MOVING) - moving++; - } - - /** - * @return {@code true} If partition map contains moving partitions. - */ - public boolean hasMovingPartitions() { - assert moving >= 0 : moving; - - return moving != 0; - } - - /** - * @param part Partition. - * @return Partition state. - */ - public GridDhtPartitionState get(Integer part) { - return map.get(part); - } - - /** - * @param part Partition. - * @return {@code True} if contains given partition. - */ - public boolean containsKey(Integer part) { - return map.containsKey(part); - } - - /** - * @return Entries. - */ - public Set<Map.Entry<Integer, GridDhtPartitionState>> entrySet() { - return map.entrySet(); - } - - /** - * @return Map size. - */ - public int size() { - return map.size(); - } - - /** - * @return Partitions. - */ - public Set<Integer> keySet() { - return map.keySet(); - } - - /** - * @return Underlying map. - */ - public Map<Integer, GridDhtPartitionState> map() { - return map; - } - - /** - * @return Node ID. - */ - public UUID nodeId() { - return nodeId; - } - - /** - * @return Update sequence. - */ - public long updateSequence() { - return updateSeq; - } - - /** - * @param updateSeq New update sequence value. - * @return Old update sequence value. - */ - public long updateSequence(long updateSeq) { - long old = this.updateSeq; - - assert updateSeq >= old : "Invalid update sequence [cur=" + old + ", new=" + updateSeq + ']'; - - this.updateSeq = updateSeq; - - return old; - } - - /** {@inheritDoc} */ - @Override public int compareTo(GridDhtPartitionMap o) { - assert nodeId.equals(o.nodeId); - - return Long.compare(updateSeq, o.updateSeq); - } - /** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { U.writeUuid(out, nodeId); @@ -249,7 +117,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext if (this == o) return true; - GridDhtPartitionMap other = (GridDhtPartitionMap)o; + GridDhtPartitionMap2 other = (GridDhtPartitionMap2)o; return other.nodeId.equals(nodeId) && other.updateSeq == updateSeq; } @@ -263,11 +131,11 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext * @return Full string representation. */ public String toFullString() { - return S.toString(GridDhtPartitionMap.class, this, "size", size(), "map", map.toString()); + return S.toString(GridDhtPartitionMap2.class, this, "size", size(), "map", map.toString()); } /** {@inheritDoc} */ @Override public String toString() { - return S.toString(GridDhtPartitionMap.class, this, "size", size()); + return S.toString(GridDhtPartitionMap2.class, this, "size", size()); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java new file mode 100644 index 0000000..6cbc66b --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java @@ -0,0 +1,306 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.distributed.dht.preloader; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.lang.IgniteProductVersion; + +import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING; + +/** + * Partition map. + */ +public class GridDhtPartitionMap2 implements Comparable<GridDhtPartitionMap2>, Externalizable { + /** */ + private static final long serialVersionUID = 0L; + + /** Used since. */ + public static final IgniteProductVersion SINCE = IgniteProductVersion.fromString("1.5.0"); + + /** Node ID. */ + protected UUID nodeId; + + /** Update sequence number. */ + protected long updateSeq; + + /** Topology version. */ + protected AffinityTopologyVersion top; + + /** */ + protected Map<Integer, GridDhtPartitionState> map; + + /** */ + private volatile int moving; + + /** + * @param nodeId Node ID. + * @param updateSeq Update sequence number. + */ + public GridDhtPartitionMap2(UUID nodeId, long updateSeq) { + assert nodeId != null; + assert updateSeq > 0; + + this.nodeId = nodeId; + this.updateSeq = updateSeq; + + map = new HashMap<>(); + } + + /** + * @param nodeId Node ID. + * @param updateSeq Update sequence number. + * @param m Map to copy. + * @param onlyActive If {@code true}, then only active states will be included. + */ + public GridDhtPartitionMap2(UUID nodeId, long updateSeq, AffinityTopologyVersion top, + Map<Integer, GridDhtPartitionState> m, boolean onlyActive) { + assert nodeId != null; + assert updateSeq > 0; + + this.nodeId = nodeId; + this.updateSeq = updateSeq; + this.top = top; + + map = U.newHashMap(m.size()); + + for (Map.Entry<Integer, GridDhtPartitionState> e : m.entrySet()) { + GridDhtPartitionState state = e.getValue(); + + if (!onlyActive || state.active()) + put(e.getKey(), state); + } + } + + /** + * Empty constructor required for {@link Externalizable}. + */ + public GridDhtPartitionMap2() { + // No-op. + } + + /** + * @param part Partition. + * @param state Partition state. + */ + public void put(Integer part, GridDhtPartitionState state) { + GridDhtPartitionState old = map.put(part, state); + + if (old == MOVING) + moving--; + + if (state == MOVING) + moving++; + } + + /** + * @return {@code true} If partition map contains moving partitions. + */ + public boolean hasMovingPartitions() { + assert moving >= 0 : moving; + + return moving != 0; + } + + /** + * @param part Partition. + * @return Partition state. + */ + public GridDhtPartitionState get(Integer part) { + return map.get(part); + } + + /** + * @param part Partition. + * @return {@code True} if contains given partition. + */ + public boolean containsKey(Integer part) { + return map.containsKey(part); + } + + /** + * @return Entries. + */ + public Set<Map.Entry<Integer, GridDhtPartitionState>> entrySet() { + return map.entrySet(); + } + + /** + * @return Map size. + */ + public int size() { + return map.size(); + } + + /** + * @return Partitions. + */ + public Set<Integer> keySet() { + return map.keySet(); + } + + /** + * @return Underlying map. + */ + public Map<Integer, GridDhtPartitionState> map() { + return map; + } + + /** + * @return Node ID. + */ + public UUID nodeId() { + return nodeId; + } + + /** + * @return Update sequence. + */ + public long updateSequence() { + return updateSeq; + } + + /** + * @param updateSeq New update sequence value. + * @return Old update sequence value. + */ + public long updateSequence(long updateSeq) { + long old = this.updateSeq; + + assert updateSeq >= old : "Invalid update sequence [cur=" + old + ", new=" + updateSeq + ']'; + + this.updateSeq = updateSeq; + + return old; + } + + /** + * @return Topology version. + */ + public AffinityTopologyVersion topologyVersion() { + return top; + } + + /** {@inheritDoc} */ + @Override public int compareTo(GridDhtPartitionMap2 o) { + assert nodeId.equals(o.nodeId); + + return Long.compare(updateSeq, o.updateSeq); + } + + /** {@inheritDoc} */ + @Override public void writeExternal(ObjectOutput out) throws IOException { + U.writeUuid(out, nodeId); + + out.writeLong(updateSeq); + + int size = map.size(); + + out.writeInt(size); + + int i = 0; + + for (Map.Entry<Integer, GridDhtPartitionState> entry : map.entrySet()) { + int ordinal = entry.getValue().ordinal(); + + assert ordinal == (ordinal & 0x3); + assert entry.getKey() == (entry.getKey() & 0x3FFF); + + int coded = (ordinal << 14) | entry.getKey(); + + out.writeShort((short)coded); + + i++; + } + + assert i == size; + + if (top != null) { + out.writeLong(topologyVersion().topologyVersion()); + out.writeInt(topologyVersion().minorTopologyVersion()); + } + else { + out.writeLong(0); + out.writeInt(0); + } + } + + /** {@inheritDoc} */ + @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + nodeId = U.readUuid(in); + + updateSeq = in.readLong(); + + int size = in.readInt(); + + map = U.newHashMap(size); + + for (int i = 0; i < size; i++) { + int entry = in.readShort() & 0xFFFF; + + int part = entry & 0x3FFF; + int ordinal = entry >> 14; + + put(part, GridDhtPartitionState.fromOrdinal(ordinal)); + } + + long ver = in.readLong(); + int minorVer = in.readInt(); + + if (ver != 0) { + top = new AffinityTopologyVersion(ver, minorVer); + } + } + + /** {@inheritDoc} */ + @Override public boolean equals(Object o) { + if (this == o) + return true; + + GridDhtPartitionMap2 other = (GridDhtPartitionMap2)o; + + return other.nodeId.equals(nodeId) && other.updateSeq == updateSeq; + } + + /** {@inheritDoc} */ + @Override public int hashCode() { + return 31 * nodeId.hashCode() + (int)(updateSeq ^ (updateSeq >>> 32)); + } + + /** + * @return Full string representation. + */ + public String toFullString() { + return S.toString(GridDhtPartitionMap2.class, this, "size", size(), "map", map.toString(), "top", top); + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(GridDhtPartitionMap2.class, this, "size", size()); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 43f34c9..f7e6acc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -971,8 +971,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT for (GridCacheContext cacheCtx : cctx.cacheContexts()) { if (!cacheCtx.isLocal()) { - m.addLocalPartitionMap(cacheCtx.cacheId(), cacheCtx.topology().localPartitionMap()); + GridDhtPartitionMap2 locMap = cacheCtx.topology().localPartitionMap(); + if (node.version().compareTo(GridDhtPartitionMap2.SINCE) < 0) + locMap = new GridDhtPartitionMap(locMap.nodeId(), locMap.updateSequence(), locMap.map()); + + m.addLocalPartitionMap(cacheCtx.cacheId(), locMap); + m.partitionUpdateCounters(cacheCtx.cacheId(), cacheCtx.topology().updateCounters()); } } @@ -994,6 +999,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT lastVer.get(), id.topologyVersion()); + boolean useOldApi = false; + + for (ClusterNode node : nodes) { + if (node.version().compareTo(GridDhtPartitionMap2.SINCE) < 0) + useOldApi = true; + } + for (GridCacheContext cacheCtx : cctx.cacheContexts()) { if (!cacheCtx.isLocal()) { AffinityTopologyVersion startTopVer = cacheCtx.startTopologyVersion(); @@ -1001,7 +1013,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT boolean ready = startTopVer == null || startTopVer.compareTo(id.topologyVersion()) <= 0; if (ready) { - m.addFullPartitionsMap(cacheCtx.cacheId(), cacheCtx.topology().partitionMap(true)); + GridDhtPartitionFullMap locMap = cacheCtx.topology().partitionMap(true); + + if (useOldApi) { + locMap = new GridDhtPartitionFullMap(locMap.nodeId(), locMap.nodeOrder(), locMap.updateSequence(), locMap); + } + + m.addFullPartitionsMap(cacheCtx.cacheId(), locMap); m.addPartitionUpdateCounters(cacheCtx.cacheId(), cacheCtx.topology().updateCounters()); } @@ -1372,7 +1390,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT * @param msg Partitions single message. */ private void updatePartitionSingleMap(GridDhtPartitionsSingleMessage msg) { - for (Map.Entry<Integer, GridDhtPartitionMap> entry : msg.partitions().entrySet()) { + for (Map.Entry<Integer, GridDhtPartitionMap2> entry : msg.partitions().entrySet()) { Integer cacheId = entry.getKey(); GridCacheContext cacheCtx = cctx.cacheContext(cacheId); http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java index a2366bf..c07a508 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java @@ -42,7 +42,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes /** Local partitions. */ @GridToStringInclude @GridDirectTransient - private Map<Integer, GridDhtPartitionMap> parts; + private Map<Integer, GridDhtPartitionMap2> parts; /** Serialized partitions. */ private byte[] partsBytes; @@ -91,7 +91,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes * @param cacheId Cache ID to add local partition for. * @param locMap Local partition map. */ - public void addLocalPartitionMap(int cacheId, GridDhtPartitionMap locMap) { + public void addLocalPartitionMap(int cacheId, GridDhtPartitionMap2 locMap) { if (parts == null) parts = new HashMap<>(); @@ -126,7 +126,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes /** * @return Local partitions. */ - public Map<Integer, GridDhtPartitionMap> partitions() { + public Map<Integer, GridDhtPartitionMap2> partitions() { return parts; } http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java index eb0b637..cc9d007 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java @@ -65,7 +65,6 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.P1; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.lang.IgniteBiInClosure; import org.apache.ignite.lang.IgniteBiPredicate; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java index dfaa44e..4a030b4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; @@ -60,7 +59,6 @@ import org.apache.ignite.internal.util.typedef.T2; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteUuid; import org.jetbrains.annotations.Nullable; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java index 76f2fbe..eb85802 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java @@ -57,12 +57,10 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.C2; import org.apache.ignite.internal.util.typedef.CI1; -import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.Nullable; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java index 770c47a..144070c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java @@ -34,7 +34,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException; import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate; -import org.apache.ignite.internal.processors.cache.GridCacheMvccFuture; import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxMapping; @@ -46,7 +45,6 @@ import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedExceptio import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; import org.apache.ignite.internal.util.GridConcurrentHashSet; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -60,7 +58,6 @@ import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteProductVersion; import org.apache.ignite.lang.IgniteReducer; import org.apache.ignite.lang.IgniteUuid; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java index eaf476c..e70e574 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java @@ -44,7 +44,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey; import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; import org.apache.ignite.internal.util.GridConcurrentHashSet; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.C1; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java index 102cc4b..f76fc96 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java @@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near; import java.util.Collection; import java.util.Collections; -import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCheckedException; @@ -40,7 +39,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException; import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.tostring.GridToStringInclude; @@ -49,11 +47,9 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteProductVersion; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.transactions.TransactionRollbackException; -import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.processors.cache.GridCacheOperation.NOOP; import static org.apache.ignite.transactions.TransactionState.UNKNOWN; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java index ba58f57..8e56f5d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java @@ -21,7 +21,6 @@ import java.io.Externalizable; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.Map; import java.util.UUID; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java index 544d5b4..821455a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java @@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheAdapter; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException; -import org.apache.ignite.internal.processors.cache.GridCacheFuture; import org.apache.ignite.internal.processors.cache.GridCacheMapEntry; import org.apache.ignite.internal.processors.cache.GridCacheMapEntryFactory; import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java index d392d53..f1dbc7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java @@ -19,13 +19,11 @@ package org.apache.ignite.internal.processors.cache.local; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.processors.cache.CacheEntryPredicate; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java index eb0db4a..f5f99f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java @@ -35,7 +35,6 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.timeout.GridTimeoutObject; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.lang.GridTuple; import org.apache.ignite.lang.IgniteAsyncSupported; import org.apache.ignite.lang.IgniteUuid; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java index 3ddd909..6a0f8ab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java @@ -54,7 +54,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.cache.version.GridCacheVersionConflictContext; import org.apache.ignite.internal.processors.cache.version.GridCacheVersionedEntryEx; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter; import org.apache.ignite.internal.util.lang.GridTuple; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java index cff62d9..ed3602f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java @@ -67,7 +67,6 @@ import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; import org.apache.ignite.internal.util.GridLeanMap; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridEmbeddedFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java index 247ccaf..cad2a8f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java @@ -59,7 +59,6 @@ import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter; import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; import org.apache.ignite.internal.util.GridBoundedConcurrentOrderedMap; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.lang.IgnitePair; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java index 213c5e6..1256aa6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java @@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.transactions; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.ignite.IgniteCheckedException; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java index 111cab8..6171ff8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java @@ -37,7 +37,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheA import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology; -import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter; import org.apache.ignite.internal.util.lang.IgnitePair; import org.apache.ignite.internal.util.typedef.internal.S; @@ -106,7 +106,7 @@ public class VisorCache implements Serializable { private VisorCacheMetrics metrics; /** Cache partitions states. */ - private GridDhtPartitionMap partitionsMap; + private GridDhtPartitionMap2 partitionsMap; /** * @param ignite Grid. @@ -399,7 +399,7 @@ public class VisorCache implements Serializable { /** * @return Cache partitions states. */ - @Nullable public GridDhtPartitionMap partitionMap() { + @Nullable public GridDhtPartitionMap2 partitionMap() { return partitionsMap; } http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java index afc1530..cb9566b 100644 --- a/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java @@ -18,7 +18,6 @@ package org.apache.ignite.stream; import java.util.Map; - import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; http://git-wip-us.apache.org/repos/asf/ignite/blob/bcfe78b0/modules/core/src/main/resources/META-INF/classnames.properties ---------------------------------------------------------------------- diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index 36ac156..065a72b 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -629,6 +629,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPar org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap +org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyPool$1 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyPool$DemandMessage
