ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: IGNITE-9890 Avoid sorting partitions when possible during construction of CachePartitionPartialCountersMap - Fixes #5060.
Date Thu, 08 Nov 2018 12:15:23 GMT
Repository: ignite
Updated Branches:
  refs/heads/master e1601f2d3 -> c0ac918a8


IGNITE-9890 Avoid sorting partitions when possible during construction of CachePartitionPartialCountersMap
- Fixes #5060.

Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c0ac918a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c0ac918a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c0ac918a

Branch: refs/heads/master
Commit: c0ac918a8380173d99b349ee851cb9be5f222f5c
Parents: e1601f2
Author: vd-pyatkov <vpyatkov@gridgain.com>
Authored: Thu Nov 8 15:12:11 2018 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Nov 8 15:12:11 2018 +0300

----------------------------------------------------------------------
 .../GridCachePartitionExchangeManager.java      |  8 +++++-
 .../CachePartitionPartialCountersMap.java       |  2 +-
 .../GridDhtPartitionsSingleMessage.java         | 29 --------------------
 .../GridDhtPartitionsStateValidator.java        |  4 +--
 4 files changed, 10 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c0ac918a/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 38d5725..1726fd6 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
@@ -134,6 +134,7 @@ import static org.apache.ignite.failure.FailureType.SYSTEM_WORKER_TERMINATION;
 import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE;
 import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.SYSTEM_POOL;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap.PARTIAL_COUNTERS_MAP_SINCE;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.nextDumpTimeout;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader.DFLT_PRELOAD_RESEND_TIMEOUT;
 
@@ -1335,7 +1336,12 @@ public class GridCachePartitionExchangeManager<K, V> extends
GridCacheSharedMana
         @NotNull Collection<CacheGroupContext> grps
     ) {
         GridDhtPartitionsSingleMessage m =
-            createPartitionsSingleMessage(id, cctx.kernalContext().clientNode(), false, false,
null, grps);
+            createPartitionsSingleMessage(id,
+                cctx.kernalContext().clientNode(),
+                false,
+                node.version().compareToIgnoreTimestamp(PARTIAL_COUNTERS_MAP_SINCE) >=
0,
+                null,
+                grps);
 
         if (log.isTraceEnabled())
             log.trace("Sending local partitions [nodeId=" + node.id() + ", msg=" + m + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0ac918a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java
index 9fc7f94..2ff875d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java
@@ -34,7 +34,7 @@ public class CachePartitionPartialCountersMap implements Serializable {
     private static final long serialVersionUID = 0L;
 
     /** */
-    static final IgniteProductVersion PARTIAL_COUNTERS_MAP_SINCE = IgniteProductVersion.fromString("2.1.4");
+    public static final IgniteProductVersion PARTIAL_COUNTERS_MAP_SINCE = IgniteProductVersion.fromString("2.1.4");
 
     /** */
     public static final CachePartitionPartialCountersMap EMPTY = new CachePartitionPartialCountersMap();

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0ac918a/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 7dd34f8..088fb31 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
@@ -246,35 +246,6 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
     }
 
     /**
-     * @param grpId Cache group ID.
-     * @param partsCnt Total cache partitions.
-     * @return Partition update counters.
-     */
-    @SuppressWarnings("unchecked")
-    public CachePartitionPartialCountersMap partitionUpdateCountersUnsorted(int grpId, int
partsCnt) {
-        Object res = partCntrs == null ? null : partCntrs.get(grpId);
-
-        if (res == null)
-            return CachePartitionPartialCountersMap.EMPTY;
-
-        if (res instanceof CachePartitionPartialCountersMap)
-            return (CachePartitionPartialCountersMap)res;
-
-        assert res instanceof Map : res;
-
-        Map<Integer, T2<Long, Long>> map = (Map<Integer, T2<Long, Long>>)res;
-
-        CachePartitionPartialCountersMap partCounersMap = new CachePartitionPartialCountersMap(partsCnt);
-
-        for (Map.Entry<Integer, T2<Long, Long>> e : map.entrySet())
-            partCounersMap.add(e.getKey(), e.getValue().get1(), e.getValue().get2());
-
-        partCounersMap.trim();
-
-        return partCounersMap;
-    }
-
-    /**
      * Adds partition sizes map for specified {@code grpId} to the current message.
      *
      * @param grpId Group id.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0ac918a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
index 63fe926..4a0e218 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
@@ -190,7 +190,7 @@ public class GridDhtPartitionsStateValidator {
 
             final GridDhtPartitionsSingleMessage message = e.getValue();
 
-            CachePartitionPartialCountersMap countersMap = message.partitionUpdateCountersUnsorted(top.groupId(),
partitions);
+            CachePartitionPartialCountersMap countersMap = message.partitionUpdateCounters(top.groupId(),
partitions);
 
             Map<Integer, Long> sizesMap = message.partitionSizes(top.groupId());
 
@@ -250,7 +250,7 @@ public class GridDhtPartitionsStateValidator {
 
             final GridDhtPartitionsSingleMessage message = e.getValue();
 
-            CachePartitionPartialCountersMap countersMap = message.partitionUpdateCountersUnsorted(top.groupId(),
partitions);
+            CachePartitionPartialCountersMap countersMap = message.partitionUpdateCounters(top.groupId(),
partitions);
 
             Map<Integer, Long> sizesMap = message.partitionSizes(top.groupId());
 


Mime
View raw message