ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/3] incubator-ignite git commit: ignite-432 Javadoc fix
Date Tue, 17 Mar 2015 09:52:18 GMT
ignite-432 Javadoc fix


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

Branch: refs/heads/ignite-432
Commit: 0cc2009c76c38185bc6752e36a949536439a705c
Parents: 4ba50f4
Author: avinogradov <avinogradov@gridgain.com>
Authored: Tue Mar 17 12:51:12 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Tue Mar 17 12:51:12 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCache.java     |  12 +-
 .../cache/affinity/CacheAffinityKeyMapped.java  |  44 --
 .../cache/eviction/CacheEvictionFilter.java     |   4 +-
 .../cache/eviction/CacheEvictionPolicy.java     |   7 +-
 .../ignite/internal/util/GridArgumentCheck.java |   1 -
 .../apache/ignite/internal/util/GridTimer.java  |   2 +-
 .../internal/util/io/GridFilenameUtils.java     |   1 -
 .../ignite/internal/util/lang/GridFunc.java     | 476 -------------------
 8 files changed, 12 insertions(+), 535 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index b7fabbd..1a1a3b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -384,10 +384,10 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K,
V>, IgniteAsyncS
     @Override public <T> T invoke(K key, EntryProcessor<K, V, T> entryProcessor,
Object... arguments);
 
     /**
-     * Invokes an {@link IgniteEntryProcessor} against the {@link Entry} specified by
-     * the provided key. If an {@link Entry} does not exist for the specified key,
+     * Invokes an {@link IgniteEntryProcessor} against the {@link Cache.Entry} specified
by
+     * the provided key. If an {@link Cache.Entry} does not exist for the specified key,
      * an attempt is made to load it (if a loader is configured) or a surrogate
-     * {@link Entry}, consisting of the key with a null value is used instead.
+     * {@link Cache.Entry}, consisting of the key with a null value is used instead.
      * This method different
      * <p>
      *
@@ -418,11 +418,11 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K,
V>, IgniteAsyncS
         EntryProcessor<K, V, T> entryProcessor, Object... args);
 
     /**
-     * Invokes an {@link IgniteEntryProcessor} against the set of {@link Entry}s
+     * Invokes an {@link IgniteEntryProcessor} against the set of {@link Cache.Entry}s
      * specified by the set of keys.
      * <p>
-     * If an {@link Entry} does not exist for the specified key, an attempt is made
-     * to load it (if a loader is configured) or a surrogate {@link Entry},
+     * If an {@link Cache.Entry} does not exist for the specified key, an attempt is made
+     * to load it (if a loader is configured) or a surrogate {@link Cache.Entry},
      * consisting of the key and a value of null is provided.
      * <p>
      * The order that the entries for the keys are processed is undefined.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/cache/affinity/CacheAffinityKeyMapped.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/CacheAffinityKeyMapped.java
b/modules/core/src/main/java/org/apache/ignite/cache/affinity/CacheAffinityKeyMapped.java
index 8ad644b..86f432e 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/CacheAffinityKeyMapped.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/CacheAffinityKeyMapped.java
@@ -92,50 +92,6 @@ import java.util.concurrent.*;
  * then {@link org.apache.ignite.spi.loadbalancing.LoadBalancingSpi} will be bypassed, and
computation will be routed to the grid node
  * where the specified affinity key is cached.
  * <p>
- * Here is how this annotation can be used to route a job to a node where Person object
- * is cached with ID "1234":
- * <pre name="code" class="java">
- * G.grid().run(new Runnable() {
- *     // This annotation is optional. If omitted, then default
- *     // no-name cache will be used.
- *     &#64;CacheName
- *     private String cacheName = "myCache";
- *
- *     // This annotation specifies that computation should be routed
- *     // precisely to the node where key '1234' is cached.
- *     &#64;CacheAffinityKeyMapped
- *     private String personKey = "1234";
- *
- *     &#64;Override public void run() {
- *         // Some computation logic here.
- *         ...
- *     }
- * };
- * </pre>
- * The same can be achieved by annotating method instead of field as follows:
- * <pre name="code" class="java">
- * G.grid().run(new Runnable() {
- *     &#64;Override public void run() {
- *         // Some computation logic here.
- *         ...
- *     }
- *
- *     // This annotation is optional. If omitted, then default
- *     // no-name cache will be used.
- *     &#64;CacheName
- *     public String cacheName() {
- *         return "myCache";
- *     }
- *
- *     // This annotation specifies that computation should be routed
- *     // precisely to the node where key '1234' is cached.
- *     &#64;CacheAffinityKeyMapped
- *     public String personKey() {
- *         return "1234";
- *     }
- * };
- * </pre>
- * <p>
  * For more information about cache affinity also see {@link CacheAffinityKeyMapper} and
  * {@link CacheAffinityFunction} documentation.
  * Affinity for a key can be found from any node, regardless of whether it has cache started

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
index a2f532f..f498304 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionFilter.java
@@ -21,8 +21,8 @@ import javax.cache.*;
 
 /**
  * Eviction filter to specify which entries should not be evicted. Not applicable when
- * calling explicit evict via {@link org.apache.ignite.cache.Entry#evict()}.
- * If {@link #evictAllowed(org.apache.ignite.cache.Entry)} method returns {@code false} then
eviction
+ * calling explicit evict via {@link EvictableEntry#evict()}.
+ * If {@link #evictAllowed(Cache.Entry)} method returns {@code false} then eviction
  * policy will not be notified and entry will never be evicted.
  * <p>
  * Eviction filter can be configured via {@link org.apache.ignite.configuration.CacheConfiguration#getEvictionFilter()}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionPolicy.java
b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionPolicy.java
index f794e14..4880584 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/CacheEvictionPolicy.java
@@ -19,10 +19,9 @@ package org.apache.ignite.cache.eviction;
 
 /**
  * Pluggable cache eviction policy. Usually, implementations will internally order
- * cache entries based on {@link #onEntryAccessed(boolean, org.apache.ignite.cache.Entry)}
notifications and
- * whenever an element needs to be evicted, {@link org.apache.ignite.cache.Entry#evict()}
- * method should be called. If you need to access the underlying cache directly
- * from this policy, you can get it via {@link org.apache.ignite.cache.Entry#projection()}
method.
+ * cache entries based on {@link #onEntryAccessed(boolean, EvictableEntry)} notifications
and
+ * whenever an element needs to be evicted, {@link EvictableEntry#evict()}
+ * method should be called.
  * <p>
  * Ignite comes with following eviction policies out-of-the-box:
  * <ul>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
index 00ba210..b94bae6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
@@ -24,7 +24,6 @@ import java.util.*;
 /**
  * This class encapsulates argument check (null and range) for public facing APIs. Unlike
asserts
  * it throws "normal" exceptions with standardized messages.
- * @see A
  */
 public class GridArgumentCheck {
     /** Null pointer error message prefix. */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/internal/util/GridTimer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridTimer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridTimer.java
index 4306d9a..b2e2a0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridTimer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridTimer.java
@@ -112,7 +112,7 @@ public class GridTimer {
     }
 
     /**
-     * @return End time ({@code -1 if not stopped).
+     * @return End time ({@code -1 if not stopped}).
      */
     public long endTime() {
         return end;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFilenameUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFilenameUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFilenameUtils.java
index ba793ac..36d76f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFilenameUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFilenameUtils.java
@@ -506,7 +506,6 @@ public class GridFilenameUtils {
      * @throws IOException
      *             if an IO error occurs while checking the files.
      * @since 2.2
-     * @see FileUtils#directoryContains(File, File)
      */
     public static boolean directoryContains(final String canonicalParent, final String canonicalChild)
             throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cc2009c/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 2ba821f..46d31e9 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
@@ -7679,39 +7679,6 @@ public class GridFunc {
     }
 
     /**
-     * Curries collection of closures with given argument.
-     *
-     * @param iter Collection to curry.
-     * @param arg Argument to curry with.
-     * @param <T1> Type of 1st closure argument.
-     * @param <T2> Type of 2nd closure argument.
-     * @param <R> Type of closure return value.
-     * @return Read only collection of curried closures.
-     */
-    public static <T1, T2, R> Collection<IgniteClosure<T2, R>> curry2(Collection<?
extends IgniteBiClosure<? super T1,
-            T2, R>> iter, final T1 arg) {
-        A.notNull(iter, "iter", arg, "arg");
-
-        return viewReadOnly(iter, new C1<IgniteBiClosure<? super T1, T2, R>, IgniteClosure<T2,
R>>() {
-            @Override public IgniteClosure<T2, R> apply(IgniteBiClosure<? super
T1, T2, R> c) {
-                return curry(c, arg);
-            }
-        });
-    }
-
-    /**
-     * Gets closure that returns key for an entry. The closure internally
-     * delegates to {@link Entry#getKey()} method.
-     *
-     * @param <K> Key type.
-     * @return Closure that returns key for an entry.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K> IgniteClosure<Map.Entry<K, ?>, K> mapEntry2Key()
{
-        return (IgniteClosure<Map.Entry<K, ?>, K>)MAP_ENTRY_KEY;
-    }
-
-    /**
      * Gets closure that returns key for cache entry. The closure internally
      * delegates to {@link Entry#getKey()} method.
      *
@@ -7749,20 +7716,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets closure that returns result of
-     * {@link org.apache.ignite.cache.Entry#peek()} method.
-     *
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Closure that returns result of
-     *      {@link org.apache.ignite.cache.Entry#peek()} method.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> IgniteClosure<Cache.Entry<K, V>, V> cacheEntry2Peek()
{
-        return (IgniteClosure<Cache.Entry<K, V>, V>)CACHE_ENTRY_VAL_PEEK;
-    }
-
-    /**
      * Gets predicate which returns {@code true} if entry's key is contained in given collection.
      * Note that if collection of provided keys is empty this method returns predicate that
      * evaluates to {@code false} when applying.
@@ -7783,24 +7736,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate which returns {@code true} if entry's key is equal to any of provided
keys.
-     * Note that if array of provided keys is {@code null} or empty this method returns predicate
-     * that evaluates to {@code false} when applying.
-     *
-     * @param keys Keys to check.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if entry's key
-     *      is equal to any of provided keys.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheHasKeys(@Nullable
K... keys) {
-        if (isEmpty(keys))
-            return alwaysFalse();
-
-        return cacheHasKeys(asList(keys));
-    }
-
-    /**
      * Gets predicate which returns {@code true} if
      * {@link org.apache.ignite.cache.Entry#peek() Entry.peek()} method
      * returns {@code non-null} value.
@@ -7817,22 +7752,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate which returns {@code true} if
-     * {@link org.apache.ignite.cache.Entry#peek() Entry.peek()}
-     * method returns {@code null} value.
-     *
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if
-     *      {@link org.apache.ignite.cache.Entry#peek() Entry.peek()}
-     *      method returns {@code null} value.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheNoPeekValue()
{
-        return (IgnitePredicate<Cache.Entry<K, V>>)CACHE_ENTRY_NO_PEEK_VAL;
-    }
-
-    /**
      * Gets predicate which returns true if {@link org.apache.ignite.cache.Entry#get()}
      * method returns value that is contained in given collection. Note that if collection
      * of provided values is empty this method returns predicate that evaluates to {@code
false}
@@ -7859,401 +7778,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate which returns true if {@link org.apache.ignite.cache.Entry#get()} method
returns
-     * value that is contained among given values. Note that if array of provided values
-     * is {@code null} or empty this method returns predicate that evaluates to
-     * {@code false} when applying.
-     *
-     * @param vals Values to check in predicate.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns true if {@link org.apache.ignite.cache.Entry#get()}
methods returns
-     *      value that is contained among given values.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsGet(@Nullable
V... vals) {
-        if (isEmpty(vals))
-            return alwaysFalse();
-
-        return cacheContainsGet(asList(vals));
-    }
-
-    /**
-     * Gets predicate which returns true if {@link org.apache.ignite.cache.Entry#peek()}
methods returns
-     * value that is contained in given collection. Note that if collection of provided values
-     * is empty this method returns predicate that evaluates to {@code false}
-     * when applying.
-     *
-     * @param vals Values to check in predicate.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns true if {@link org.apache.ignite.cache.Entry#peek()}
methods returns
-     *      value that is contained in given collection.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsPeek(
-        @Nullable final Collection<? extends V> vals) {
-        return isEmpty(vals) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    V v = e.getValue();
-
-                    assert vals != null;
-
-                    return v != null && vals.contains(v);
-                }
-
-                @Override public String toString() {
-                    return "[Cache entry peek-values predicate [" + vals + "]]";
-                }
-            };
-    }
-
-    /**
-     * Gets predicate which returns true if {@link org.apache.ignite.cache.Entry#peek()}
methods returns
-     * value that is contained among given values. Note that if array of provided values
-     * is {@code null} or empty this method returns predicate that evaluates to {@code false}
-     * when applying.
-     *
-     * @param vals Values to check in predicate.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns true if {@link org.apache.ignite.cache.Entry#peek()}
methods returns
-     *      value that is contained among given values.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsPeek(@Nullable
V... vals) {
-        if (isEmpty(vals))
-            return alwaysFalse();
-
-        return cacheContainsPeek(asList(vals));
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Note that if provided map is empty this method returns predicate that evaluates to
-     * {@code false} when applying.
-     *
-     * @param map Key-value paris to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache contains all given key-value
pairs.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsGet(@Nullable
final Map<K, V> map) {
-        return isEmpty(map) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    assert map != null;
-
-                    return eq(e.getValue(), map.get(e.getKey()));
-                }
-            };
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Note that if provided map is empty this method returns predicate that evaluates to
-     * {@code false} when applying.
-     *
-     * @param map Key-value paris to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsPeek(
-        @Nullable final Map<K, V> map) {
-        return isEmpty(map) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    assert map != null;
-
-                    return eq(e.getValue(), map.get(e.getKey()));
-                }
-            };
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Both, key and value will be checked for containment. Value will be retrieved using
-     * {@link org.apache.ignite.cache.Entry#get()} method. Note that if collection of
-     * provided entries is empty this method returns predicate that evaluates to {@code false}
when
-     * applying.
-     *
-     * @param entries Key-value paris to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     */
-    // cacheEntryPredicateForContainsEntriesGet
-    // ptCacheContainsEntriesGet
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsEntriesGet(
-        @Nullable final Collection<? extends Cache.Entry<K, V>> entries) {
-        return isEmpty(entries) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    K k = e.getKey();
-                    V v = e.getValue();
-
-                    assert entries != null;
-
-                    for (Cache.Entry<K, V> entry : entries) {
-                        if (k.equals(entry.getKey()) && v!= null && v.equals(entry.getValue()))
-                            return true;
-                    }
-
-                    return false;
-                }
-            };
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Both, key and value will be checked for containment. Value will be retrieved using
-     * {@link org.apache.ignite.cache.Entry#peek()} method. Note that if collection
-     * of provided entries is empty this method returns predicate that evaluates to {@code
false}
-     * when applying.
-     *
-     * @param entries Key-value paris to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsEntriesPeek(
-        @Nullable final Collection<? extends Cache.Entry<K, V>> entries) {
-        return isEmpty(entries) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    K k = e.getKey();
-                    V v = e.getValue();
-
-                    assert entries != null;
-
-                    for (Cache.Entry<K, V> entry : entries) {
-                        if (eq(k, entry.getKey()) && eq(v, entry.getValue()))
-                            return true;
-                    }
-
-                    return false;
-                }
-            };
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Both, key and value will be checked for containment. Value will be retrieved using
-     * {@link org.apache.ignite.cache.Entry#get()} method. Note that if array of provided
-     * entries is {@code null} or empty this method returns predicate that evaluates to {@code
false}
-     * when applying.
-     *
-     * @param entries Key-value pairs to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsEntriesGet(
-        @Nullable Cache.Entry<K, V>... entries) {
-        if (isEmpty(entries))
-            return alwaysFalse();
-
-        return cacheContainsEntriesGet(asList(entries));
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     * Both, key and value will be checked for containment. Value will be retrieved using
-     * {@link org.apache.ignite.cache.Entry#peek()} method. Note that if array of
-     * provided entries is {@code null} or empty this method returns predicate that evaluates
-     * to {@code false} when applying.
-     *
-     * @param entries Key-value paris to check for containment.
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if cache entry matches any given key-value
pair.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheContainsEntriesPeek(
-        @Nullable Cache.Entry<K, V>... entries) {
-        if (isEmpty(entries))
-            return alwaysFalse();
-
-        return cacheContainsEntriesPeek(asList(entries));
-    }
-
-    /**
-     * Converts key filter to entry filter using {@link org.apache.ignite.cache.Entry#getKey()}
-     * to get value. Note that if array of provided filters is {@code null} or empty this
-     * method returns predicate that evaluates to {@code true} when applying.
-     *
-     * @param ps Key filter(s) to convert.
-     * @return Entry filter.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheKeys(
-        @Nullable final IgnitePredicate<? super K>... ps) {
-        return isEmpty(ps) || isAlwaysTrue(ps) ? F.<Cache.Entry<K, V>>alwaysTrue()
:
-            isAlwaysFalse(ps) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    return F.isAll(e.getKey(), ps);
-                }
-            };
-    }
-
-    /**
-     * Converts value filter to entry filter using {@link org.apache.ignite.cache.Entry#get()}
to get value.
-     * Note that if array of provided filters is {@code null} or empty this method returns
-     * predicate that evaluates to {@code true} when applying.
-     *
-     * @param ps Value filter(s) to convert.
-     * @return Entry filter.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheValuesGet(
-        @Nullable final IgnitePredicate<? super V>... ps) {
-        return isEmpty(ps) || isAlwaysTrue(ps) ? F.<Cache.Entry<K, V>>alwaysTrue()
:
-            isAlwaysFalse(ps) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    V v = e.getValue();
-
-                    return v != null && F.isAll(v, ps);
-                }
-            };
-    }
-
-    /**
-     * Converts value filter to entry filter using {@link org.apache.ignite.cache.Entry#peek()}
-     * to get value. Note that if array of provided filters is {@code null} or empty this
method returns
-     * predicate that evaluates to {@code true} when applying.
-     *
-     * @param ps Value filter(s) to convert.
-     * @return Entry filter.
-     */
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheValuesPeek(
-        @Nullable final IgnitePredicate<? super V>... ps) {
-        return isEmpty(ps) || isAlwaysTrue(ps) ? F.<Cache.Entry<K, V>>alwaysTrue()
:
-            isAlwaysFalse(ps) ? F.<Cache.Entry<K, V>>alwaysFalse() :
-            new IgnitePredicate<Cache.Entry<K, V>>() {
-                @Override public boolean apply(Cache.Entry<K, V> e) {
-                    V v = e.getValue();
-
-                    return v != null && F.isAll(v, ps);
-                }
-            };
-    }
-
-    /**
-     * Gets node predicate which returns {@code true} for all nodes which have given cache
names
-     * started.
-     *
-     * @param cacheNames Cache names to get predicate for. Empty array means default cache
name. If
-     *      {@code null} array is passed, then {@link #alwaysFalse()} predicate will be returned.
-     * @return Predicate which returns {@code true} for all nodes which have given cache
names
-     *      started.
-     */
-    public static IgnitePredicate<ClusterNode> cacheNodesForNames(@Nullable final String...
cacheNames) {
-        if (cacheNames == null)
-            return alwaysFalse();
-
-        return new P1<ClusterNode>() {
-            @Override public boolean apply(ClusterNode n) {
-                Collection<String> names = U.cacheNames(n);
-
-                for (String name : names) {
-                    if (name == null && cacheNames.length == 0)
-                        return true;
-
-                    if (U.containsStringArray(cacheNames, name, false))
-                        return true;
-                }
-
-                return false;
-            }
-        };
-    }
-
-    /**
-     * Gets event predicate that returns {@code true} only if event type is one of the given.
-     * Note that if array of provided types is {@code null} or empty this method returns
-     * predicate that evaluates to {@code false} when applying.
-     *
-     * @param types Event types.
-     * @return Event predicate.
-     */
-    public static IgnitePredicate<Event> eventType(@Nullable final int... types) {
-        return isEmpty(types) ? F.<Event>alwaysFalse() : new IgnitePredicate<Event>()
{
-            @Override public boolean apply(Event e) {
-                assert e != null;
-
-                assert types != null;
-
-                for (int t : types) {
-                    if (e.type() == t)
-                        return true;
-                }
-
-                return false;
-            }
-        };
-    }
-
-    /**
-     * Gets event predicate that returns {@code true} only if event id is one of the given.
-     * Note that if array of provided ids is empty this method returns predicate that
-     * evaluates to {@code false} when applying.
-     *
-     * @param ids Event ids.
-     * @return Event predicate.
-     */
-    public static IgnitePredicate<Event> eventId(@Nullable final IgniteUuid... ids)
{
-        return isEmpty(ids) ? F.<Event>alwaysFalse() :
-            new IgnitePredicate<Event>() {
-                // Don't set peer deploy aware as UUID is loaded by
-                // system class loader.
-
-                @Override public boolean apply(Event e) {
-                    assert e != null;
-
-                    return F.isAll(e.id(), in(ids));
-                }
-            };
-    }
-
-    /**
-     * Gets event predicate that returns {@code true} only if event was produced
-     * after given timestamp.
-     *
-     * @param tstamp Timestamp.
-     * @return Event predicate.
-     */
-    public static IgnitePredicate<Event> eventAfter(final long tstamp) {
-        A.ensure(tstamp > 0, "tstamp > 0");
-
-        return new IgnitePredicate<Event>() {
-            @Override public boolean apply(Event e) {
-                assert e != null;
-
-                return e.timestamp() > tstamp;
-            }
-        };
-    }
-
-    /**
-     * Gets event predicate that returns {@code true} only if event was produced on one of
-     * given nodes (specified by ids). Note that if array of provided node ids is {@code
null}
-     * or empty this method returns predicate that evaluates to {@code false} when applying.
-     *
-     * @param nodeIds Node ids.
-     * @return Event predicate.
-     */
-    public static IgnitePredicate<Event> eventNodeId(@Nullable final UUID... nodeIds)
{
-        return isEmpty(nodeIds) ? F.<Event>alwaysFalse() : new IgnitePredicate<Event>()
{
-            // Don't set peer deploy aware as UUID is loaded by
-            // system class loader.
-
-            @Override public boolean apply(Event e) {
-                assert e != null;
-
-                return F.isAll(e.node().id(), in(nodeIds));
-            }
-        };
-    }
-
-    /**
      * Gets event predicate that returns {@code true} only if node that produced the event
      * satisfies all given predicates. Note that if array of provided node predicates is
      * {@code null} or empty this method returns predicate that evaluates to {@code true}


Mime
View raw message