ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1232
Date Fri, 22 Jul 2016 07:52:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1232-1 68571792c -> 65a98f007


ignite-1232


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

Branch: refs/heads/ignite-1232-1
Commit: 65a98f00741ba273a2a2a7faa541669c787e4a1b
Parents: 6857179
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jul 22 10:52:16 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jul 22 10:52:16 2016 +0300

----------------------------------------------------------------------
 .../h2/twostep/GridReduceQueryExecutor.java     | 38 +++-----------------
 1 file changed, 5 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/65a98f00/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index c48dccd..04449ac 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -111,9 +111,6 @@ public class GridReduceQueryExecutor {
     private static final IgniteProductVersion DISTRIBUTED_JOIN_SINCE = IgniteProductVersion.fromString("1.7.0");
 
     /** */
-    private boolean oldNodesInTop = true;
-
-    /** */
     private GridKernalContext ctx;
 
     /** */
@@ -362,7 +359,7 @@ public class GridReduceQueryExecutor {
      * @param extraSpaces Extra spaces.
      * @return {@code true} If preloading is active.
      */
-    private boolean isPreloadingActive(final GridCacheContext<?,?> cctx, List<Integer>
extraSpaces) {
+    private boolean isPreloadingActive(final GridCacheContext<?, ?> cctx, List<Integer>
extraSpaces) {
         if (hasMovingPartitions(cctx))
             return true;
 
@@ -380,7 +377,7 @@ public class GridReduceQueryExecutor {
      * @param cctx Cache context.
      * @return {@code true} If cache context
      */
-    private boolean hasMovingPartitions(GridCacheContext<?,?> cctx) {
+    private boolean hasMovingPartitions(GridCacheContext<?, ?> cctx) {
         GridDhtPartitionFullMap fullMap = cctx.topology().partitionMap(false);
 
         for (GridDhtPartitionMap2 map : fullMap.values()) {
@@ -469,33 +466,6 @@ public class GridReduceQueryExecutor {
     }
 
     /**
-     * @return {@code true} If there are old nodes in topology.
-     */
-    private boolean oldNodesInTopology() {
-        if (!oldNodesInTop)
-            return false;
-
-        NavigableMap<IgniteProductVersion, Collection<ClusterNode>> m = ctx.discovery().topologyVersionMap();
-
-        if (!F.isEmpty(m)) {
-            for (Map.Entry<IgniteProductVersion,Collection<ClusterNode>> entry
: m.entrySet()) {
-                if (entry.getKey().compareTo(DISTRIBUTED_JOIN_SINCE) >= 0)
-                    break;
-
-                for (ClusterNode node : entry.getValue()) {
-                    if (!node.isClient() && !node.isDaemon())
-                        return true;
-                }
-            }
-        }
-
-        // If we did not find old nodes, we assume that old node will not join further.
-        oldNodesInTop = false;
-
-        return false;
-    }
-
-    /**
      * @param cctx Cache context.
      * @param qry Query.
      * @param keepPortable Keep portable.
@@ -611,7 +581,9 @@ public class GridReduceQueryExecutor {
 
                 boolean retry = false;
 
-                final boolean oldStyle = oldNodesInTopology();
+                IgniteProductVersion minNodeVer = cctx.shared().exchange().minimumNodeVersion(topVer);
+
+                final boolean oldStyle = minNodeVer.compareToIgnoreTimestamp(DISTRIBUTED_JOIN_SINCE)
< 0;
                 final boolean distributedJoins = qry.distributedJoins();
 
                 if (oldStyle && distributedJoins)


Mime
View raw message