You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/12/30 15:32:39 UTC
[3/5] ignite git commit: IGNITE-2263: Removed "loseList" method.
IGNITE-2263: Removed "loseList" method.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4b7de543
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4b7de543
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4b7de543
Branch: refs/heads/ignite-2263
Commit: 4b7de5433ff2f8a6695f504182d9b81a398dd537
Parents: da168c6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Dec 30 17:27:29 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 30 17:27:29 2015 +0300
----------------------------------------------------------------------
.../loadbalancer/GridLoadBalancerManager.java | 8 ++++-
.../ignite/internal/util/lang/GridFunc.java | 35 --------------------
2 files changed, 7 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4b7de543/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
index 631168b..efe09b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.managers.loadbalancer;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.List;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
@@ -92,7 +93,12 @@ public class GridLoadBalancerManager extends GridManagerAdapter<LoadBalancingSpi
if (F.isEmpty(exclNodes))
return GridLoadBalancerManager.this.getBalancedNode(ses, top, job);
- List<ClusterNode> nodes = F.loseList(top, true, exclNodes);
+ List<ClusterNode> nodes = new LinkedList<>();
+
+ for (ClusterNode topNode : top) {
+ if (!exclNodes.contains(topNode))
+ nodes.add(topNode);
+ }
if (nodes.isEmpty())
return null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/4b7de543/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index a40f188..b15bebe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -857,41 +857,6 @@ public class GridFunc {
}
/**
- * Loses all elements in input list that are contained in {@code filter} collection.
- *
- * @param c Input list.
- * @param cp If {@code true} method creates new list not modifying input,
- * otherwise does <tt>in-place</tt> modifications.
- * @param filter Filter collection. If {@code filter} collection is empty or
- * {@code null} - no elements are lost.
- * @param <T> Type of list.
- * @return List of remaining elements
- */
- // TODO: REMOVE!
- public static <T> List<T> loseList(List<T> c, boolean cp, @Nullable Collection<? super T> filter) {
- A.notNull(c, "c");
-
- List<T> res;
-
- if (!cp) {
- res = c;
-
- if (filter != null)
- res.removeAll(filter);
- }
- else {
- res = new LinkedList<>();
-
- for (T t : c) {
- if (filter == null || !filter.contains(t))
- res.add(t);
- }
- }
-
- return res;
- }
-
- /**
* Gets closure which converts node to node ID.
*
* @return Closure which converts node to node ID.