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:57:50 UTC
ignite git commit: IGNITE-2263: DANGEROUS COMMIT! Removed unnecessary
methods from F0.
Repository: ignite
Updated Branches:
refs/heads/ignite-2263 c4cae9d3c -> ec180d642
IGNITE-2263: DANGEROUS COMMIT! Removed unnecessary methods from F0.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ec180d64
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ec180d64
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ec180d64
Branch: refs/heads/ignite-2263
Commit: ec180d642f6c8245acb3ac9850d41bfb99cab850
Parents: c4cae9d
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Dec 30 17:58:45 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 30 17:58:45 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 4 +-
.../processors/cache/GridCacheAdapter.java | 1 -
.../processors/cache/GridCacheContext.java | 3 +-
.../cache/GridCacheEvictionManager.java | 3 +-
.../processors/cache/GridCacheIoManager.java | 5 +-
.../processors/cache/GridCacheProcessor.java | 9 +-
.../dht/GridClientPartitionTopology.java | 3 +-
.../dht/GridDhtPartitionTopologyImpl.java | 3 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 3 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 3 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 5 +-
.../dht/atomic/GridDhtAtomicCache.java | 12 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 5 +-
.../local/atomic/GridLocalAtomicCache.java | 5 +-
.../GridCacheAtomicStampedImpl.java | 5 +-
.../org/apache/ignite/internal/util/F0.java | 325 +------------------
.../ignite/internal/util/lang/GridFunc.java | 24 +-
17 files changed, 53 insertions(+), 365 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index befb9ab..844fd0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -30,7 +30,6 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -79,7 +78,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.jobmetrics.GridJobMetrics;
import org.apache.ignite.internal.processors.security.SecurityContext;
import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridBoundedConcurrentOrderedMap;
import org.apache.ignite.internal.util.GridSpinBusyLock;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -2578,7 +2576,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
nearEnabledCaches = Collections.unmodifiableSet(nearEnabledSet);
daemonNodes = Collections.unmodifiableList(new ArrayList<>(
- F.view(F.concat(false, loc, rmts), F0.not(daemonFilter))));
+ F.view(F.concat(false, loc, rmts), F.not(daemonFilter))));
Map<UUID, ClusterNode> nodeMap = new HashMap<>(allNodes().size() + daemonNodes.size(), 1.0f);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index c8e3ea2..a4cf737 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -106,7 +106,6 @@ import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.lang.GridClosureException;
import org.apache.ignite.internal.util.lang.GridTriple;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
-import org.apache.ignite.internal.util.typedef.C1;
import org.apache.ignite.internal.util.typedef.C2;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.CI2;
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index c10ebf3..ef49567 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -85,7 +85,6 @@ import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
import org.apache.ignite.internal.processors.offheap.GridOffHeapProcessor;
import org.apache.ignite.internal.processors.plugin.CachePluginManager;
import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.lang.GridFunc;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -1512,7 +1511,7 @@ public class GridCacheContext<K, V> implements Externalizable {
Collection<ClusterNode> nearNodes = null;
if (!F.isEmpty(readers)) {
- nearNodes = discovery().nodes(readers, F0.notEqualTo(nearNodeId));
+ nearNodes = discovery().nodes(readers, F.notEqualTo(nearNodeId));
if (log.isDebugEnabled())
log.debug("Mapping entry to near nodes [nodes=" + U.nodeIds(nearNodes) + ", entry=" + entry + ']');
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 7106b43..f542f4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -63,7 +63,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridBusyLock;
import org.apache.ignite.internal.util.GridConcurrentHashSet;
import org.apache.ignite.internal.util.GridUnsafe;
@@ -1341,7 +1340,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
Collection<ClusterNode> backups;
if (evictSync)
- backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F0.notEqualTo(cctx.localNode()));
+ backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F.notEqualTo(cctx.localNode()));
else
backups = Collections.emptySet();
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 0aa8b1b..4c9cdf2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -57,7 +57,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPr
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
import org.apache.ignite.internal.processors.cache.query.GridCacheQueryRequest;
import org.apache.ignite.internal.processors.cache.query.GridCacheQueryResponse;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.GridSpinReadWriteLock;
import org.apache.ignite.internal.util.typedef.CI1;
@@ -731,7 +730,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
if (added) {
- if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
+ if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
if (log.isDebugEnabled())
log.debug("Message will not be sent because all nodes left topology [msg=" + msg +
", nodes=" + U.toShortString(nodes) + ']');
@@ -767,7 +766,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
U.sleep(retryDelay);
}
- if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
+ if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
if (log.isDebugEnabled())
log.debug("Message will not be sent because all nodes left topology [msg=" + msg + ", nodes=" +
U.toShortString(nodes) + ']');
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index ff02e70..f6fc9d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -96,7 +96,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
import org.apache.ignite.internal.processors.plugin.CachePluginManager;
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1160,8 +1159,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
log.debug("Executed onKernalStart() callback for DHT cache: " + dht.name());
}
- for (GridCacheManager mgr : F.view(ctx.managers(), F0.notContains(dhtExcludes(ctx))))
- mgr.onKernalStart();
+ Collection<GridCacheManager> excluded = dhtExcludes(ctx);
+
+ for (GridCacheManager mgr : ctx.managers()) {
+ if (!excluded.contains(mgr))
+ mgr.onKernalStart();
+ }
cache.onKernalStart();
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/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 8aef5ad..9c18ad0 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
@@ -37,7 +37,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
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;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
@@ -698,7 +697,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
// Remove obsolete mappings.
if (cur != null) {
- for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
+ for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
Set<UUID> ids = part2node.get(p);
if (ids != null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/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 a0709c5..cdf0fc2 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
@@ -41,7 +41,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
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;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
@@ -1055,7 +1054,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
// Remove obsolete mappings.
if (cur != null) {
- for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
+ for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
Set<UUID> ids = part2node.get(p);
if (ids != null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index ae24ed1..2b40436 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.lang.GridClosureException;
@@ -1382,7 +1381,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
Collection<ClusterNode> nearNodes = null;
if (!F.isEmpty(readers)) {
- nearNodes = ctx.discovery().nodes(readers, F0.not(F.idForNodeId(nodeId)));
+ nearNodes = ctx.discovery().nodes(readers, F.not(F.idForNodeId(nodeId)));
if (log.isDebugEnabled())
log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) + ", entry=" + cached +
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 534a560..1fe3ae2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -42,7 +42,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanMap;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
@@ -641,7 +640,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
// Otherwise, during rollback we will not know whether locks need
// to be rolled back.
// Loose all skipped and previously locked (we cannot reenter locks here).
- final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F0.notIn(skipped)) : keys;
+ final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F.notIn(skipped)) : keys;
if (log.isDebugEnabled())
log.debug("Lock keys: " + passedKeys);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/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 40399b4..47dafc8 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
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.dr.GridDrType;
import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1287,14 +1286,14 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
if (!F.isEmpty(readers)) {
Collection<ClusterNode> nearNodes =
- cctx.discovery().nodes(readers, F0.not(F.idForNodeId(tx.nearNodeId())));
+ cctx.discovery().nodes(readers, F.not(F.idForNodeId(tx.nearNodeId())));
if (log.isDebugEnabled())
log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) +
", entry=" + entry + ']');
// Exclude DHT nodes.
- map(entry, F.view(nearNodes, F0.notIn(dhtNodes)), nearMap);
+ map(entry, F.view(nearNodes, F.notIn(dhtNodes)), nearMap);
}
else if (log.isDebugEnabled())
log.debug("Entry has no near readers: " + entry);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index d3680db..e0b108b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -77,12 +77,10 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSing
import org.apache.ignite.internal.processors.cache.dr.GridCacheDrExpirationInfo;
import org.apache.ignite.internal.processors.cache.dr.GridCacheDrInfo;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
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.GridCacheVersionEx;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -412,9 +410,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
- A.notNull(key, "key");
+ A.notNull(key, "key", val, "val");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAllAsync0(F.asMap(key, val),
null,
null,
null,
@@ -428,9 +426,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
- A.notNull(key, "key");
+ A.notNull(key, "key", val, "val");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAllAsync0(F.asMap(key, val),
null,
null,
null,
@@ -445,7 +443,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public V tryPutIfAbsent(K key, V val) throws IgniteCheckedException {
A.notNull(key, "key", val, "val");
- return (V)updateAllAsync0(F0.asMap(key, val),
+ return (V)updateAllAsync0(F.asMap(key, val),
null,
null,
null,
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
index 89fd29f..6b03131 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
@@ -43,7 +43,6 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -522,8 +521,8 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
Collection<KeyCacheObject> retryKeys = F.view(
keys,
F.and(
- F0.notIn(missedKeys),
- F0.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key()))
+ F.notIn(missedKeys),
+ F.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key()))
)
);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index a9fbda7..3b60f96 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -189,7 +188,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
@Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key", val, "val");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAllAsync0(F.asMap(key, val),
null,
null,
true,
@@ -202,7 +201,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
@Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key", val, "val");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAllAsync0(F.asMap(key, val),
null,
null,
false,
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index f7a82a9..84c4269 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -30,7 +30,6 @@ import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -179,8 +178,8 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
checkRemoved();
try {
- return CU.outTx(internalCompareAndSet(F0.equalTo(expVal), wrapperClosure(newVal),
- F0.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
+ return CU.outTx(internalCompareAndSet(F.equalTo(expVal), wrapperClosure(newVal),
+ F.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
index 7e9e448..b819226 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
@@ -17,8 +17,6 @@
package org.apache.ignite.internal.util;
-import java.util.Collection;
-import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
@@ -27,11 +25,9 @@ import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
import org.apache.ignite.internal.processors.cache.CacheEntrySerializablePredicate;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
-import org.apache.ignite.internal.util.lang.GridFunc;
import org.apache.ignite.internal.util.lang.GridNodePredicate;
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.CU;
import org.apache.ignite.lang.IgnitePredicate;
import org.jetbrains.annotations.Nullable;
@@ -42,79 +38,6 @@ import org.jetbrains.annotations.Nullable;
*/
public class F0 {
/**
- * Negates given predicates.
- * <p>
- * Gets predicate (not peer-deployable) that evaluates to {@code true} if any of given predicates
- * evaluates to {@code false}. If all predicates evaluate to {@code true} the
- * result predicate will evaluate to {@code false}.
- *
- * @param p Predicate to negate.
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- * @return Negated predicate (not peer-deployable).
- */
- public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
- return F.isAlwaysFalse(p) ? F.<T>alwaysTrue() : F.isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
- @Override public boolean apply(T t) {
- return !F.isAll(t, p);
- }
- };
- }
-
- /**
- * Gets predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
- * to {@code target} or both are {@code null}.
- *
- * @param target Object to compare free variable to.
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- * @return Predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
- * to {@code target} or both are {@code null}.
- */
- public static <T> IgnitePredicate<T> notEqualTo(@Nullable final T target) {
- return new P1<T>() {
- @Override public boolean apply(T t) {
- return !F.eq(t, target);
- }
- };
- }
-
- /**
- * Gets predicate (not peer-deployable) that returns {@code true} if its free variable
- * is not contained in given collection.
- *
- * @param c Collection to check for containment.
- * @param <T> Type of the free variable for the predicate and type of the
- * collection elements.
- * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is not
- * contained in given collection.
- */
- public static <T> IgnitePredicate<T> notIn(@Nullable final Collection<? extends T> c) {
- return F.isEmpty(c) ? GridFunc.<T>alwaysTrue() : new P1<T>() {
- @Override public boolean apply(T t) {
- assert c != null;
-
- return !c.contains(t);
- }
- };
- }
-
- /**
- * Gets predicate (not perr-deployable) that evaluates to {@code true} if its free variable is equal
- * to {@code target} or both are {@code null}.
- *
- * @param target Object to compare free variable to.
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- * @return Predicate that evaluates to {@code true} if its free variable is equal to
- * {@code target} or both are {@code null}.
- */
- public static <T> IgnitePredicate<T> equalTo(@Nullable final T target) {
- return new P1<T>() {
- @Override public boolean apply(T t) {
- return F.eq(t, target);
- }
- };
- }
-
- /**
* @param p1 Filter1.
* @param p2 Filter2.
* @return And filter.
@@ -133,16 +56,12 @@ public class F0 {
if (e1 && e2)
return CU.alwaysTrue0();
- if (e1 && !e2) {
- assert p2 != null;
-
+ if (e1) {
if (p2.length == 1)
return p2[0];
}
- if (!e1 && e2) {
- assert p1 != null;
-
+ if (e2) {
if (p1.length == 1)
return p1[0];
}
@@ -150,16 +69,12 @@ public class F0 {
return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
@Override public boolean apply(GridCacheEntryEx e) {
if (!e1) {
- assert p1 != null;
-
for (CacheEntryPredicate p : p1)
if (p != null && !p.apply(e))
return false;
}
if (!e2) {
- assert p2 != null;
-
for (CacheEntryPredicate p : p2)
if (p != null && !p.apply(e))
return false;
@@ -186,15 +101,11 @@ public class F0 {
@Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
if (!e1) {
- assert p1 != null;
-
for (CacheEntryPredicate p : p1)
p.prepareMarshal(ctx);
}
if (!e2) {
- assert p2 != null;
-
for (CacheEntryPredicate p : p2)
p.prepareMarshal(ctx);
}
@@ -203,63 +114,6 @@ public class F0 {
}
/**
- * @param p Filter1.
- * @param ps Filter2.
- * @return And filter.
- */
- public static CacheEntryPredicate and0(
- @Nullable final CacheEntryPredicate p,
- @Nullable final CacheEntryPredicate... ps) {
- if (p == null && F.isEmptyOrNulls(ps))
- return CU.alwaysTrue0();
-
- if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
- return CU.alwaysFalse0();
-
- if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
- return CU.alwaysTrue0();
-
- return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
- @Override public boolean apply(GridCacheEntryEx e) {
- assert ps != null;
-
- if (p != null && !p.apply(e))
- return false;
-
- for (CacheEntryPredicate p : ps) {
- if (p != null && !p.apply(e))
- return false;
- }
-
- return true;
- }
-
- @Override public void entryLocked(boolean locked) {
- assert ps != null;
-
- if (p != null)
- p.entryLocked(locked);
-
- for (CacheEntryPredicate p : ps) {
- if (p != null)
- p.entryLocked(locked);
- }
- }
-
- @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
- assert ps != null;
-
- if (p != null)
- p.prepareMarshal(ctx);
-
- for (CacheEntryPredicate p : ps)
- if (p != null)
- p.prepareMarshal(ctx);
- }
- });
- }
-
- /**
* Get a predicate (non peer-deployable) that evaluates to {@code true} if each of its component predicates
* evaluates to {@code true}. The components are evaluated in order they are supplied.
* Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
@@ -287,16 +141,12 @@ public class F0 {
if (e1 && e2)
return F.alwaysTrue();
- if (e1 && !e2) {
- assert p2 != null;
-
+ if (e1) {
if (p2.length == 1)
return (IgnitePredicate<T>)p2[0];
}
- if (!e1 && e2) {
- assert p1 != null;
-
+ if (e2) {
if (p1.length == 1)
return (IgnitePredicate<T>)p1[0];
}
@@ -305,15 +155,11 @@ public class F0 {
Set<UUID> ids = new GridLeanSet<>();
if (!e1) {
- assert p1 != null;
-
for (IgnitePredicate<? super T> p : p1)
ids.addAll(((GridNodePredicate)p).nodeIds());
}
if (!e2) {
- assert p2 != null;
-
for (IgnitePredicate<? super T> p : p2)
ids.addAll(((GridNodePredicate)p).nodeIds());
}
@@ -325,16 +171,12 @@ public class F0 {
return new P1<T>() {
@Override public boolean apply(T t) {
if (!e1) {
- assert p1 != null;
-
for (IgnitePredicate<? super T> p : p1)
if (p != null && !p.apply(t))
return false;
}
if (!e2) {
- assert p2 != null;
-
for (IgnitePredicate<? super T> p : p2)
if (p != null && !p.apply(t))
return false;
@@ -347,148 +189,6 @@ public class F0 {
}
/**
- * Get a predicate (not peer-deployable) that evaluates to {@code true} if each of its component predicates
- * evaluates to {@code true}. The components are evaluated in order they are supplied.
- * Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
- * Passed in predicates are NOT copied. If no predicates are passed in the returned
- * predicate will always evaluate to {@code false}.
- *
- * @param ps Passed in predicate. If none provided - always-{@code false} predicate is
- * returned.
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- * @return Predicate that evaluates to {@code true} if each of its component predicates
- * evaluates to {@code true}.
- */
- @SuppressWarnings("unchecked")
- public static <T> IgnitePredicate<T> and(
- @Nullable final IgnitePredicate<? super T> p,
- @Nullable final IgnitePredicate<? super T>... ps
- ) {
- if (p == null && F.isEmptyOrNulls(ps))
- return F.alwaysTrue();
-
- if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
- return F.alwaysFalse();
-
- if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
- return F.alwaysTrue();
-
- if (isAllNodePredicates(p) && isAllNodePredicates(ps)) {
- assert ps != null;
-
- Set<UUID> ids = new GridLeanSet<>();
-
- for (IgnitePredicate<? super T> p0 : ps) {
- Collection<UUID> list = ((GridNodePredicate)p0).nodeIds();
-
- if (ids.isEmpty())
- ids.addAll(list);
- else
- ids.retainAll(list);
- }
-
- Collection<UUID> list = ((GridNodePredicate)p).nodeIds();
-
- if (ids.isEmpty())
- ids.addAll(list);
- else
- ids.retainAll(list);
-
- // T must be <T extends GridNode>.
- return (IgnitePredicate<T>)new GridNodePredicate(ids);
- }
- else {
- return new P1<T>() {
- @Override public boolean apply(T t) {
- assert ps != null;
-
- if (p != null && !p.apply(t))
- return false;
-
- for (IgnitePredicate<? super T> p : ps)
- if (p != null && !p.apply(t))
- return false;
-
- return true;
- }
- };
- }
- }
-
- /**
- * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
- * in given collection.
- *
- * @param c Collection to check for containment.
- * @param <T> Type of the free variable for the predicate and type of the
- * collection elements.
- * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
- * contained in given collection.
- */
- public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
- return F.isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
- @Override public boolean apply(T t) {
- assert c != null;
-
- return c.contains(t);
- }
- };
- }
-
- /**
- * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
- * that is contained in the passed in collection.
- *
- * @param c Collection used for predicate filter.
- * @param <T> Element type.
- * @return Predicate which returns {@code true} if it receives an element
- * that is contained in the passed in collection.
- */
- public static <T> IgnitePredicate<T> contains(@Nullable final Collection<T> c) {
- return c == null || c.isEmpty() ? GridFunc.<T>alwaysFalse() : new P1<T>() {
- @Override public boolean apply(T t) {
- return c.contains(t);
- }
- };
- }
-
- /**
- * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
- * that is not contained in the passed in collection.
- *
- * @param c Collection used for predicate filter.
- * @param <T> Element type.
- * @return Predicate which returns {@code true} if it receives an element
- * that is not contained in the passed in collection.
- */
- public static <T> IgnitePredicate<T> notContains(@Nullable final Collection<T> c) {
- return c == null || c.isEmpty() ? GridFunc.<T>alwaysTrue() : new P1<T>() {
- @Override public boolean apply(T t) {
- return !c.contains(t);
- }
- };
- }
-
- /**
- * Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
- *
- * @param ps Collection of predicates to test.
- * @return {@code True} if all passed in predicates are instances of {@link GridNodePredicate} class.
- */
- public static boolean isAllNodePredicates(@Nullable Iterable<? extends IgnitePredicate<?>> ps) {
- if (F.isEmpty(ps))
- return false;
-
- assert ps != null;
-
- for (IgnitePredicate<?> p : ps)
- if (!(p instanceof GridNodePredicate))
- return false;
-
- return true;
- }
-
- /**
* Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
*
* @param ps Collection of predicates to test.
@@ -498,27 +198,10 @@ public class F0 {
if (F.isEmpty(ps))
return false;
- assert ps != null;
-
for (IgnitePredicate<?> p : ps)
if (!(p instanceof GridNodePredicate))
return false;
return true;
}
-
- /**
- * Creates map with given values, adding a strict not-null check for value.
- *
- * @param key Key.
- * @param val Value.
- * @param <K> Key's type.
- * @param <V> Value's type.
- * @return Created map.
- */
- public static <K, V> Map<K, V> asMap(K key, V val) {
- A.notNull(val, "val");
-
- return F.asMap(key, val);
- }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec180d64/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 b5e7da9..04b51de 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
@@ -815,7 +815,7 @@ public class GridFunc {
public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp, @Nullable Collection<T0> filter) {
A.notNull(c, "c");
- return lose(c, cp, F0.in(filter));
+ return lose(c, cp, in(filter));
}
/**
@@ -941,7 +941,7 @@ public class GridFunc {
@Nullable Collection<? extends T0> filter) {
A.notNull(c, "c");
- return retain(c, cp, F0.in(filter));
+ return retain(c, cp, in(filter));
}
/**
@@ -1900,7 +1900,7 @@ public class GridFunc {
@SuppressWarnings({"unchecked"})
public static <T> GridIterator<T> identityIterator(Iterable<? extends T> c, boolean readOnly,
IgnitePredicate<? super T> p) {
- return F.iterator(c, IDENTITY, readOnly, p);
+ return iterator(c, IDENTITY, readOnly, p);
}
/**
@@ -2368,6 +2368,24 @@ public class GridFunc {
}
/**
+ * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
+ * in given collection.
+ *
+ * @param c Collection to check for containment.
+ * @param <T> Type of the free variable for the predicate and type of the
+ * collection elements.
+ * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
+ * contained in given collection.
+ */
+ public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
+ return isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
+ @Override public boolean apply(T t) {
+ return c.contains(t);
+ }
+ };
+ }
+
+ /**
* Gets predicate that returns {@code true} if its free variable is not
* contained in given collection.
*