ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [04/13] ignite git commit: IGNITE-2263: retain -> viewReadOnly in GridDhtPartitionsExchangeFuture and GridCacheDistributedQueryFuture.
Date Sat, 02 Jan 2016 09:21:43 GMT
IGNITE-2263: retain -> viewReadOnly in GridDhtPartitionsExchangeFuture and GridCacheDistributedQueryFuture.


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

Branch: refs/heads/ignite-2263
Commit: fcf76b1e2a973bf2f6dba599d1bec5e63de1bc65
Parents: af834f7
Author: thatcoach <ppozerov@list.ru>
Authored: Sat Jan 2 11:47:26 2016 +0300
Committer: thatcoach <ppozerov@list.ru>
Committed: Sat Jan 2 11:47:26 2016 +0300

----------------------------------------------------------------------
 .../GridDhtPartitionsExchangeFuture.java        |  7 +++--
 .../query/GridCacheDistributedQueryFuture.java  | 29 ++++++++++----------
 2 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fcf76b1e/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 5901f43..2f7ee7f 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
@@ -952,11 +952,14 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
      * @throws IgniteCheckedException If failed.
      */
     private void startCaches() throws IgniteCheckedException {
-        cctx.cache().prepareCachesStart(F.retain(reqs, true, new IgnitePredicate<DynamicCacheChangeRequest>()
{
+        Collection<DynamicCacheChangeRequest> startedReqs = F.viewReadOnly(reqs,
+            F.<DynamicCacheChangeRequest>identity(), new IgnitePredicate<DynamicCacheChangeRequest>()
{
             @Override public boolean apply(DynamicCacheChangeRequest req) {
                 return req.start();
             }
-        }), exchId.topologyVersion());
+        });
+
+        cctx.cache().prepareCachesStart(startedReqs, exchId.topologyVersion());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/fcf76b1e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
index 6110e0c..48102cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
@@ -17,22 +17,22 @@
 
 package org.apache.ignite.internal.processors.cache.query;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CountDownLatch;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+
 /**
  * Distributed query future.
  */
@@ -88,13 +88,12 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
             Collection<ClusterNode> nodes;
 
             synchronized (mux) {
-                nodes = F.retain(allNodes, true,
-                    new P1<ClusterNode>() {
-                        @Override public boolean apply(ClusterNode node) {
-                            return !cctx.localNodeId().equals(node.id()) && subgrid.contains(node.id());
-                        }
-                    }
-                );
+                nodes = new ArrayList<>(allNodes.size());
+
+                for (ClusterNode node : allNodes) {
+                    if (!cctx.localNodeId().equals(node.id()) && subgrid.contains(node.id()))
+                        nodes.add(node);
+                }
 
                 subgrid.clear();
             }


Mime
View raw message