You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/12 15:57:58 UTC

[01/11] ignite git commit: ignite-3682: all anonymous classes were extracted

Repository: ignite
Updated Branches:
  refs/heads/master a9ffced14 -> 252f00416


http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
new file mode 100644
index 0000000..546686c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate which returns {@code true} if it receives an element that is contained in the passed in
+ * collection.
+ *
+ * @param <T> Type of the free variable for the predicate and type of the collection elements.
+ */
+public class IgnitePredicateContainWrapper<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T> c;
+
+    /**
+     * @param c Collection to check for containment.
+     */
+    public IgnitePredicateContainWrapper(Collection<? extends T> c) {
+        this.c = c;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        assert c != null;
+
+        return c.contains(t);
+    }
+
+    /** {@inheritDoc} */
+    public String toString() {
+        return S.toString(IgnitePredicateContainWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
new file mode 100644
index 0000000..4283068
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Creates grid node predicate evaluating on the given node ID.
+ */
+public class IgnitePredicateEqualsClusterNodeId<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = -7082730222779476623L;
+
+    /** */
+    private final UUID nodeId;
+
+    /**
+     * @param nodeId (Collection)
+     */
+    public IgnitePredicateEqualsClusterNodeId(UUID nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode e) {
+        return e.id().equals(nodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateEqualsClusterNodeId.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
new file mode 100644
index 0000000..326fe95
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * UUID equals predicate.
+ */
+public class IgnitePredicateEqualsUUID implements IgnitePredicate<UUID> {
+    /** */
+    private static final long serialVersionUID = -5664060422647374863L;
+
+    /** */
+    private final UUID nodeId;
+
+    /**
+     * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+     */
+    public IgnitePredicateEqualsUUID(UUID nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(UUID id) {
+        return id.equals(nodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateEqualsUUID.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
new file mode 100644
index 0000000..a8eca85
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Map;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate evaluates to true for given value.
+ * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
+ */
+public class IgnitePredicateEvaluateEntryByKey<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super K>[] predicates;
+
+    /**
+     * @param predicates Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
+     * returned.
+     */
+    public IgnitePredicateEvaluateEntryByKey(IgnitePredicate<? super K>... predicates) {
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(Map.Entry<K, V> e) {
+        return GridFunc.isAll(e.getKey(), predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateEvaluateEntryByKey.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
new file mode 100644
index 0000000..a082c4e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Map;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate evaluates to true for given value.
+ * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
+ */
+public class IgnitePredicateEvaluateEntryByValue<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super V>[] predicates;
+
+    /**
+     * @param predicates Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
+     * returned.
+     */
+    public IgnitePredicateEvaluateEntryByValue(IgnitePredicate<? super V>... predicates) {
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(Map.Entry<K, V> e) {
+        return GridFunc.isAll(e.getValue(), predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateEvaluateEntryByValue.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
new file mode 100644
index 0000000..6d23ce3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * {@link ClusterNode} has equal id predicate.
+ */
+public class IgnitePredicateHasEqualId<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final UUID locNodeId;
+
+    /**
+     * @param locNodeId Id for check.
+     */
+    public IgnitePredicateHasEqualId(UUID locNodeId) {
+        this.locNodeId = locNodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T n) {
+        return n.id().equals(locNodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateHasEqualId.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
new file mode 100644
index 0000000..2381515
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * {@link ClusterNode} node has NOT equal id predicate.
+ */
+public class IgnitePredicateHasNotEqualId<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final UUID locNodeId;
+
+    /**
+     * @param locNodeId Id for check.
+     */
+    public IgnitePredicateHasNotEqualId(UUID locNodeId) {
+        this.locNodeId = locNodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T n) {
+        return !n.id().equals(locNodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateHasNotEqualId.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
new file mode 100644
index 0000000..e5f3d21
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * IgniteInternalFuture is not done predicate.
+ */
+public class IgnitePredicateIgniteFutureIsNotDone implements IgnitePredicate<IgniteInternalFuture<?>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(IgniteInternalFuture<?> f) {
+        return !f.isDone();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateIgniteFutureIsNotDone.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
new file mode 100644
index 0000000..8177d3e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that evaluates to {@code true} if each of its component predicates evaluates to {@code true}.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IgnitePredicateIsAll<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super T>[] predicates;
+
+    /**
+     * @param predicates Passed in predicate. If none provided - always-{@code false} predicate is returned.
+     */
+    public IgnitePredicateIsAll(IgnitePredicate<? super T>... predicates) {
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return GridFunc.isAll(t, predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateIsAll.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
new file mode 100644
index 0000000..a024d46
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.P1;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Predicate that evaluates to {@code true} if its free variable is instance of the given class.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IgnitePredicateIsAssignableFrom<T> implements P1<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Class<?> cls;
+
+    /**
+     * @param cls Class to compare to.
+     */
+    public IgnitePredicateIsAssignableFrom(Class<?> cls) {
+        this.cls = cls;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return t != null && cls.isAssignableFrom(t.getClass());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateIsAssignableFrom.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
new file mode 100644
index 0000000..51e19cd
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Negated predicate.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IgnitePredicateIsNotAll<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super T>[] predicates;
+
+    /**
+     * @param predicates Predicate to negate.
+     */
+    public IgnitePredicateIsNotAll(IgnitePredicate<? super T>... predicates) {
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return !GridFunc.isAll(t, predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateIsNotAll.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
new file mode 100644
index 0000000..499b554
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which checks a parameter on <code>null</code>.
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IgnitePredicateIsNull<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * @param e Parameter for check.
+     * @return 'true' if parameter equals to <code>null</code>, otherwise 'false'.
+     */
+    @Override public boolean apply(E e) {
+        return e == null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateIsNull.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
new file mode 100644
index 0000000..0dc399d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that returns {@code true} if its free variable is not contained in given collection.
+ *
+ * @param <T> Type of the free variable for the predicate and type of the collection elements.
+ */
+public class IgnitePredicateNotContainWrapper<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T> c;
+
+    /**
+     * @param c Collection to check for containment.
+     */
+    public IgnitePredicateNotContainWrapper(Collection<? extends T> c) {
+        this.c = c;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        assert c != null;
+
+        return !c.contains(t);
+    }
+
+    /** {@inheritDoc} */
+    public String toString() {
+        return S.toString(IgnitePredicateNotContainWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
new file mode 100644
index 0000000..31a165d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that evaluates to {@code true} if its free variable is equal to {@code target} or both are
+ * {@code null}.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IgnitePredicateNotEqual<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final T target;
+
+    /**
+     * @param target Object to compare free variable to.
+     */
+    public IgnitePredicateNotEqual(T target) {
+        this.target = target;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return !GridFunc.eq(t, target);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateNotEqual.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
new file mode 100644
index 0000000..840ab82
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which checks a parameter on <code>null</code>.
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IgnitePredicateNotNull<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * @param e Parameter for check.
+     * @return 'true' if parameter NOT equals to <code>null</code>, otherwise 'false'.
+     */
+    @Override public boolean apply(E e) {
+        return e != null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateNotNull.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
new file mode 100644
index 0000000..389e700
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
+ *
+ * @param <T> Reducer element type.
+ */
+public class IgniteReducerAlwaysTrue<T> implements IgniteReducer<T, T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final T elem;
+
+    /**
+     * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+     */
+    public IgniteReducerAlwaysTrue(T elem) {
+        this.elem = elem;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(T e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T reduce() {
+        return elem;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteReducerAlwaysTrue.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
new file mode 100644
index 0000000..0b811a8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that calculates sum of integer elements.
+ */
+public class IgniteReducerIntSum implements IgniteReducer<Integer, Integer> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private AtomicInteger sum = new AtomicInteger(0);
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(Integer e) {
+        if (e != null)
+            sum.addAndGet(e);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Integer reduce() {
+        return sum.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteReducerIntSum.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
new file mode 100644
index 0000000..a5b8f59
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that calculates sum of long integer elements.
+ */
+public class IgniteReducerLongSum implements IgniteReducer<Long, Long> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private AtomicLong sum = new AtomicLong(0);
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(Long e) {
+        if (e != null)
+            sum.addAndGet(e);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Long reduce() {
+        return sum.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteReducerLongSum.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
new file mode 100644
index 0000000..6f64747
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that concatenates strings using provided delimiter.
+ */
+public class IgniteReducerStringConcat implements IgniteReducer<String, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final String delim;
+
+    /** */
+    private SB sb;
+
+    /** */
+    private boolean first;
+
+    /** */
+    private final Object lock;
+
+    /**
+     * @param delim Delimiter (optional).
+     */
+    public IgniteReducerStringConcat(String delim) {
+        this.delim = delim;
+        sb = new SB();
+        first = true;
+        lock = new Object();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(String s) {
+        synchronized (lock) {
+            if (!first && !GridFunc.isEmpty(delim))
+                sb.a(delim);
+
+            sb.a(s);
+
+            first = false;
+        }
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String reduce() {
+        synchronized (lock) {
+            return sb.toString();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteReducerStringConcat.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MultipleIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MultipleIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MultipleIterator.java
new file mode 100644
index 0000000..c5930af
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MultipleIterator.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Concatenates multiple iterators as single one.
+ *
+ * @param <T> Elements type.
+ */
+public class MultipleIterator<T> implements Iterator<T>, Serializable {
+    /** */
+    private static final long serialVersionUID = 0;
+
+    /** */
+    private final Iterator<Iterator<T>> iters;
+
+    /** */
+    private Iterator<T> it;
+
+    /** */
+    private Iterator<T> last;
+
+    /** */
+    private T next;
+
+    /**
+     * @param iters Iterator over iterators.
+     */
+    public MultipleIterator(Iterator<Iterator<T>> iters) {
+        this.iters = iters;
+        it = iters.next();
+        advance();
+    }
+
+    /** */
+    private void advance() {
+        for (; ; ) {
+            if (it.hasNext()) {
+                next = it.next();
+
+                assert next != null;
+
+                return;
+            }
+
+            if (!iters.hasNext())
+                return;
+
+            it = iters.next();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasNext() {
+        return next != null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T next() {
+        T res = next;
+
+        if (res == null)
+            throw new NoSuchElementException();
+
+        next = null;
+
+        last = it;
+
+        advance();
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void remove() {
+        if (last == null)
+            throw new IllegalStateException();
+
+        last.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(MultipleIterator.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/package-info.java
new file mode 100644
index 0000000..9361826
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <!-- Package description. -->
+ * Contains utilities classes for {@link org.apache.ignite.internal.util.lang.GridFunc}.
+ */
+package org.apache.ignite.internal.util.lang.gridfunc;
\ No newline at end of file


[07/11] ignite git commit: ignite-3682: fixes of notes; refactoring

Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
deleted file mode 100644
index ca50a0b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.ConcurrentMap;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-import org.jsr166.ConcurrentHashMap8;
-
-/**
- * Concurrent hash map factory.
- */
-public class IgniteCallableConcurrentHashMapFactory implements IgniteCallable<ConcurrentMap> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public ConcurrentMap call() {
-        return new ConcurrentHashMap8();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableConcurrentHashMapFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
deleted file mode 100644
index 0a52e4d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.GridConcurrentHashSet;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Concurrent hash set factory.
- */
-public class IgniteCallableConcurrentHashSetFactory implements IgniteCallable<GridConcurrentHashSet> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public GridConcurrentHashSet call() {
-        return new GridConcurrentHashSet();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableConcurrentHashSetFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
deleted file mode 100644
index 9dcc3b5..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-import org.jsr166.ConcurrentLinkedDeque8;
-
-/**
- * Deque factory.
- */
-public class IgniteCallableDequeFactory implements IgniteCallable<ConcurrentLinkedDeque8> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public ConcurrentLinkedDeque8 call() {
-        return new ConcurrentLinkedDeque8();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableDequeFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
deleted file mode 100644
index b361354..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Hash map factory.
- */
-public class IgniteCallableHashMapFactory implements IgniteCallable<Map> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public Map call() {
-        return new HashMap();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableHashMapFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
deleted file mode 100644
index 22d0d10..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Hash set factory.
- */
-public class IgniteCallableHashSetFactory implements IgniteCallable<Set> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public Set call() {
-        return new HashSet();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableHashSetFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
deleted file mode 100644
index 34c4eab..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.LinkedList;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Linked list factory.
- */
-public class IgniteCallableLinkedListFactory implements IgniteCallable<LinkedList> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public LinkedList call() {
-        return new LinkedList();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableLinkedListFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
deleted file mode 100644
index 2fef35e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import javax.cache.Cache;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Cache entry to get-value transformer closure.
- */
-public class IgniteClosureCacheGet implements IgniteClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Nullable @Override public Object apply(Object o) {
-        return ((Cache.Entry)o).getValue();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureCacheGet.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
deleted file mode 100644
index e9cb267..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import javax.cache.Cache;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Map entry to key transformer closure.
- */
-public class IgniteClosureCacheGetKey implements IgniteClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public Object apply(Object o) {
-        return ((Cache.Entry)o).getKey();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureCacheGetKey.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
deleted file mode 100644
index 155b075..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Grid node to node ID transformer closure.
- */
-public class IgniteClosureClusterNodeGetId implements IgniteClosure<ClusterNode, UUID> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public UUID apply(ClusterNode n) {
-        return n.id();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureClusterNodeGetId.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
deleted file mode 100644
index af1641e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Grid node to node ID8 transformer closure.
- */
-public class IgniteClosureClusterNodeGetId8 implements IgniteClosure<ClusterNode, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public String apply(ClusterNode n) {
-        return U.id8(n.id());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureClusterNodeGetId8.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
deleted file mode 100644
index 52d872a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Identity closure.
- */
-public class IgniteClosureIdentity implements IgniteClosure {
-    /** */
-    private static final long serialVersionUID = -6338573080046225172L;
-
-    /** {@inheritDoc} */
-    @Override public Object apply(Object o) {
-        return o;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureIdentity.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
deleted file mode 100644
index a5adfea..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.C1;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Closure that return {@code toString()} value for its free variable.
- *
- * @param <T> Type of the free variable for the closure.
- */
-public class IgniteClosureToString<T> implements C1<T, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public String apply(@Nullable T t) {
-        return String.valueOf(t); // This is null-safe.
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureToString.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
deleted file mode 100644
index fc5fc04..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * UUID to ID8 transformer closure.
- */
-public class IgniteClosureUUIDToId8Transformer implements IgniteClosure<UUID, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public String apply(UUID id) {
-        return U.id8(id);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteClosureUUIDToId8Transformer.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
deleted file mode 100644
index fdf1245..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgniteOutClosure;
-
-/**
- * Wraps given closure.
- *
- * @param <T> Input type.
- * @param <R> Output type.
- */
-public class IgniteOutClosureWrapper<T, R> implements IgniteOutClosure<R> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgniteClosure<? super T, R> closure;
-
-    /** */
-    private final T closureArgument;
-
-    /**
-     * @param closure Closure
-     * @param closureArgument Parameter
-     */
-    public IgniteOutClosureWrapper(IgniteClosure<? super T, R> closure, T closureArgument) {
-        this.closure = closure;
-        this.closureArgument = closureArgument;
-    }
-
-    /** {@inheritDoc} */
-    @Override public R apply() {
-        return closure.apply(closureArgument);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteOutClosureWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
deleted file mode 100644
index 297e749..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Defines a predicate which accepts a parameter and always returns {@code false}
- *
- * @param <E> Type of predicate parameter.
- */
-public class IgnitePredicateAlwaysFalse<E> implements IgnitePredicate<E> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * Predicate body.
-     *
-     * @param e Predicate parameter.
-     * @return Always <code>false</code>
-     */
-    @Override public boolean apply(E e) {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateAlwaysFalse.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
deleted file mode 100644
index ff0f96e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Defines a predicate which accepts a parameter and always returns {@code true}
- *
- * @param <E> Type of predicate parameter.
- */
-public class IgnitePredicateAlwaysTrue<E> implements IgnitePredicate<E> {
-    /** */
-    private static final long serialVersionUID = 6101914246981105862L;
-
-    /**
-     * Predicate body.
-     *
-     * @param e Predicate parameter.
-     * @return Always <code>true</code>.
-     */
-    @Override public boolean apply(E e) {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateAlwaysTrue.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
deleted file mode 100644
index b286f50..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import javax.cache.Cache;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Cache entry has-peek-value predicate.
- */
-public class IgnitePredicateCacheHasPeek implements IgnitePredicate {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Override public boolean apply(Object o) {
-        return ((Cache.Entry)o).getValue() != null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateCacheHasPeek.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
deleted file mode 100644
index 0911e37..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Grid node predicate evaluating on the given node IDs.
- */
-public class IgnitePredicateContainNodeId<T extends ClusterNode> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = -5664060422647374863L;
-
-    /** */
-    private final Collection<UUID> nodeIds;
-
-    /**
-     * @param nodeIds (Collection)
-     */
-    public IgnitePredicateContainNodeId(Collection<UUID> nodeIds) {
-        this.nodeIds = nodeIds;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(ClusterNode e) {
-        return nodeIds.contains(e.id());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateContainNodeId.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
deleted file mode 100644
index 546686c..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainWrapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate which returns {@code true} if it receives an element that is contained in the passed in
- * collection.
- *
- * @param <T> Type of the free variable for the predicate and type of the collection elements.
- */
-public class IgnitePredicateContainWrapper<T> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Collection<? extends T> c;
-
-    /**
-     * @param c Collection to check for containment.
-     */
-    public IgnitePredicateContainWrapper(Collection<? extends T> c) {
-        this.c = c;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        assert c != null;
-
-        return c.contains(t);
-    }
-
-    /** {@inheritDoc} */
-    public String toString() {
-        return S.toString(IgnitePredicateContainWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
deleted file mode 100644
index 4283068..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsClusterNodeId.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Creates grid node predicate evaluating on the given node ID.
- */
-public class IgnitePredicateEqualsClusterNodeId<T extends ClusterNode> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = -7082730222779476623L;
-
-    /** */
-    private final UUID nodeId;
-
-    /**
-     * @param nodeId (Collection)
-     */
-    public IgnitePredicateEqualsClusterNodeId(UUID nodeId) {
-        this.nodeId = nodeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(ClusterNode e) {
-        return e.id().equals(nodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateEqualsClusterNodeId.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
deleted file mode 100644
index 326fe95..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEqualsUUID.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * UUID equals predicate.
- */
-public class IgnitePredicateEqualsUUID implements IgnitePredicate<UUID> {
-    /** */
-    private static final long serialVersionUID = -5664060422647374863L;
-
-    /** */
-    private final UUID nodeId;
-
-    /**
-     * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
-     */
-    public IgnitePredicateEqualsUUID(UUID nodeId) {
-        this.nodeId = nodeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(UUID id) {
-        return id.equals(nodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateEqualsUUID.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
deleted file mode 100644
index a8eca85..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByKey.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Map;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate evaluates to true for given value.
- * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
- */
-public class IgnitePredicateEvaluateEntryByKey<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgnitePredicate<? super K>[] predicates;
-
-    /**
-     * @param predicates Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
-     * returned.
-     */
-    public IgnitePredicateEvaluateEntryByKey(IgnitePredicate<? super K>... predicates) {
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(Map.Entry<K, V> e) {
-        return GridFunc.isAll(e.getKey(), predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateEvaluateEntryByKey.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
deleted file mode 100644
index a082c4e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateEvaluateEntryByValue.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Map;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate evaluates to true for given value.
- * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
- */
-public class IgnitePredicateEvaluateEntryByValue<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgnitePredicate<? super V>[] predicates;
-
-    /**
-     * @param predicates Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
-     * returned.
-     */
-    public IgnitePredicateEvaluateEntryByValue(IgnitePredicate<? super V>... predicates) {
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(Map.Entry<K, V> e) {
-        return GridFunc.isAll(e.getValue(), predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateEvaluateEntryByValue.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
deleted file mode 100644
index 6d23ce3..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasEqualId.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * {@link ClusterNode} has equal id predicate.
- */
-public class IgnitePredicateHasEqualId<T extends ClusterNode> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final UUID locNodeId;
-
-    /**
-     * @param locNodeId Id for check.
-     */
-    public IgnitePredicateHasEqualId(UUID locNodeId) {
-        this.locNodeId = locNodeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T n) {
-        return n.id().equals(locNodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateHasEqualId.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
deleted file mode 100644
index 2381515..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateHasNotEqualId.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * {@link ClusterNode} node has NOT equal id predicate.
- */
-public class IgnitePredicateHasNotEqualId<T extends ClusterNode> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final UUID locNodeId;
-
-    /**
-     * @param locNodeId Id for check.
-     */
-    public IgnitePredicateHasNotEqualId(UUID locNodeId) {
-        this.locNodeId = locNodeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T n) {
-        return !n.id().equals(locNodeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateHasNotEqualId.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
deleted file mode 100644
index e5f3d21..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIgniteFutureIsNotDone.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * IgniteInternalFuture is not done predicate.
- */
-public class IgnitePredicateIgniteFutureIsNotDone implements IgnitePredicate<IgniteInternalFuture<?>> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(IgniteInternalFuture<?> f) {
-        return !f.isDone();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateIgniteFutureIsNotDone.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
deleted file mode 100644
index 8177d3e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAll.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate that evaluates to {@code true} if each of its component predicates evaluates to {@code true}.
- *
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- */
-public class IgnitePredicateIsAll<T> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgnitePredicate<? super T>[] predicates;
-
-    /**
-     * @param predicates Passed in predicate. If none provided - always-{@code false} predicate is returned.
-     */
-    public IgnitePredicateIsAll(IgnitePredicate<? super T>... predicates) {
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        return GridFunc.isAll(t, predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateIsAll.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
deleted file mode 100644
index a024d46..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsAssignableFrom.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.P1;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Predicate that evaluates to {@code true} if its free variable is instance of the given class.
- *
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- */
-public class IgnitePredicateIsAssignableFrom<T> implements P1<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Class<?> cls;
-
-    /**
-     * @param cls Class to compare to.
-     */
-    public IgnitePredicateIsAssignableFrom(Class<?> cls) {
-        this.cls = cls;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        return t != null && cls.isAssignableFrom(t.getClass());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateIsAssignableFrom.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
deleted file mode 100644
index 51e19cd..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNotAll.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Negated predicate.
- *
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- */
-public class IgnitePredicateIsNotAll<T> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgnitePredicate<? super T>[] predicates;
-
-    /**
-     * @param predicates Predicate to negate.
-     */
-    public IgnitePredicateIsNotAll(IgnitePredicate<? super T>... predicates) {
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        return !GridFunc.isAll(t, predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateIsNotAll.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
deleted file mode 100644
index 499b554..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateIsNull.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Defines a predicate which checks a parameter on <code>null</code>.
- *
- * @param <E> Type of predicate parameter.
- */
-public class IgnitePredicateIsNull<E> implements IgnitePredicate<E> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * @param e Parameter for check.
-     * @return 'true' if parameter equals to <code>null</code>, otherwise 'false'.
-     */
-    @Override public boolean apply(E e) {
-        return e == null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateIsNull.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
deleted file mode 100644
index 0dc399d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotContainWrapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate that returns {@code true} if its free variable is not contained in given collection.
- *
- * @param <T> Type of the free variable for the predicate and type of the collection elements.
- */
-public class IgnitePredicateNotContainWrapper<T> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Collection<? extends T> c;
-
-    /**
-     * @param c Collection to check for containment.
-     */
-    public IgnitePredicateNotContainWrapper(Collection<? extends T> c) {
-        this.c = c;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        assert c != null;
-
-        return !c.contains(t);
-    }
-
-    /** {@inheritDoc} */
-    public String toString() {
-        return S.toString(IgnitePredicateNotContainWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
deleted file mode 100644
index 31a165d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotEqual.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate that evaluates to {@code true} if its free variable is equal to {@code target} or both are
- * {@code null}.
- *
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- */
-public class IgnitePredicateNotEqual<T> implements IgnitePredicate<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final T target;
-
-    /**
-     * @param target Object to compare free variable to.
-     */
-    public IgnitePredicateNotEqual(T target) {
-        this.target = target;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        return !GridFunc.eq(t, target);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateNotEqual.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
deleted file mode 100644
index 840ab82..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateNotNull.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Defines a predicate which checks a parameter on <code>null</code>.
- *
- * @param <E> Type of predicate parameter.
- */
-public class IgnitePredicateNotNull<E> implements IgnitePredicate<E> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * @param e Parameter for check.
-     * @return 'true' if parameter NOT equals to <code>null</code>, otherwise 'false'.
-     */
-    @Override public boolean apply(E e) {
-        return e != null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgnitePredicateNotNull.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
deleted file mode 100644
index 389e700..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerAlwaysTrue.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteReducer;
-
-/**
- * Reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
- *
- * @param <T> Reducer element type.
- */
-public class IgniteReducerAlwaysTrue<T> implements IgniteReducer<T, T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final T elem;
-
-    /**
-     * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
-     */
-    public IgniteReducerAlwaysTrue(T elem) {
-        this.elem = elem;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean collect(T e) {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public T reduce() {
-        return elem;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteReducerAlwaysTrue.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
deleted file mode 100644
index 0b811a8..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerIntSum.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteReducer;
-
-/**
- * Reducer that calculates sum of integer elements.
- */
-public class IgniteReducerIntSum implements IgniteReducer<Integer, Integer> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private AtomicInteger sum = new AtomicInteger(0);
-
-    /** {@inheritDoc} */
-    @Override public boolean collect(Integer e) {
-        if (e != null)
-            sum.addAndGet(e);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Integer reduce() {
-        return sum.get();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteReducerIntSum.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
deleted file mode 100644
index a5b8f59..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerLongSum.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicLong;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteReducer;
-
-/**
- * Reducer that calculates sum of long integer elements.
- */
-public class IgniteReducerLongSum implements IgniteReducer<Long, Long> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private AtomicLong sum = new AtomicLong(0);
-
-    /** {@inheritDoc} */
-    @Override public boolean collect(Long e) {
-        if (e != null)
-            sum.addAndGet(e);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Long reduce() {
-        return sum.get();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteReducerLongSum.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
deleted file mode 100644
index 6f64747..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteReducerStringConcat.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.SB;
-import org.apache.ignite.lang.IgniteReducer;
-
-/**
- * Reducer that concatenates strings using provided delimiter.
- */
-public class IgniteReducerStringConcat implements IgniteReducer<String, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final String delim;
-
-    /** */
-    private SB sb;
-
-    /** */
-    private boolean first;
-
-    /** */
-    private final Object lock;
-
-    /**
-     * @param delim Delimiter (optional).
-     */
-    public IgniteReducerStringConcat(String delim) {
-        this.delim = delim;
-        sb = new SB();
-        first = true;
-        lock = new Object();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean collect(String s) {
-        synchronized (lock) {
-            if (!first && !GridFunc.isEmpty(delim))
-                sb.a(delim);
-
-            sb.a(s);
-
-            first = false;
-        }
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String reduce() {
-        synchronized (lock) {
-            return sb.toString();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteReducerStringConcat.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IntSumReducer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IntSumReducer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IntSumReducer.java
new file mode 100644
index 0000000..cb87d79
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IntSumReducer.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that calculates sum of integer elements.
+ */
+public class IntSumReducer implements IgniteReducer<Integer, Integer> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private AtomicInteger sum = new AtomicInteger(0);
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(Integer e) {
+        if (e != null)
+            sum.addAndGet(e);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Integer reduce() {
+        return sum.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IntSumReducer.class, this);
+    }
+}


[03/11] ignite git commit: ignite-3682: all anonymous classes were extracted

Posted by ag...@apache.org.
ignite-3682: all anonymous classes were extracted


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

Branch: refs/heads/master
Commit: 9165b0d684f6d3a7bdb2f6bcb0f2d9edc876744d
Parents: b99c198
Author: daradurvs <da...@gmail.com>
Authored: Sat Mar 18 18:47:30 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Mon Apr 10 19:36:45 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 1158 ++----------------
 .../gridfunc/GridAbsClosureNoOperation.java     |   39 +
 .../util/lang/gridfunc/GridAbsClosurePrint.java |   49 +
 .../gridfunc/GridAbsClosureRunnableWrapper.java |   51 +
 .../lang/gridfunc/GridAbsClosureWrapper.java    |   57 +
 ...IteratorAdapterClosurePredicatesWrapper.java |  138 +++
 .../gridfunc/GridIteratorAdapterWrapper.java    |  100 ++
 ...GridIteratorOverInnerCollectionsAdapter.java |  100 ++
 ...dSerializableCollectionPredicateWrapper.java |   78 ++
 .../GridSerializableCollectionWrapper.java      |   66 +
 ...ializableListReadOnlyWithTransformation.java |   78 ++
 ...alizableMapPredicatesTransformerWrapper.java |  168 +++
 .../GridSerializableMapPredicatesWrapper.java   |  121 ++
 ...zableMapReadOnlyClosurePredicateWrapper.java |  165 +++
 ...SerializableMapReadOnlyPredicateWrapper.java |  153 +++
 ...zableReadOnlyCollectionPredicateWrapper.java |   79 ++
 ...idSerializableReadOnlyCollectionWrapper.java |   95 ++
 ...rializableReadOnlyTwoCollectionsWrapper.java |  100 ++
 .../IgniteCallableArrayListFactory.java         |   41 +
 .../IgniteCallableAtomicBooleanFactory.java     |   40 +
 .../IgniteCallableAtomicIntegerFactory.java     |   40 +
 .../IgniteCallableAtomicLongFactory.java        |   40 +
 .../IgniteCallableAtomicReferenceFactory.java   |   40 +
 .../IgniteCallableConcurrentHashMapFactory.java |   41 +
 .../IgniteCallableConcurrentHashSetFactory.java |   40 +
 .../gridfunc/IgniteCallableDequeFactory.java    |   40 +
 .../gridfunc/IgniteCallableHashMapFactory.java  |   41 +
 .../gridfunc/IgniteCallableHashSetFactory.java  |   41 +
 .../IgniteCallableLinkedListFactory.java        |   40 +
 .../lang/gridfunc/IgniteClosureCacheGet.java    |   42 +
 .../lang/gridfunc/IgniteClosureCacheGetKey.java |   40 +
 .../gridfunc/IgniteClosureClusterNodeGetId.java |   41 +
 .../IgniteClosureClusterNodeGetId8.java         |   41 +
 .../lang/gridfunc/IgniteClosureIdentity.java    |   39 +
 .../lang/gridfunc/IgniteClosureToString.java    |   42 +
 .../IgniteClosureUUIDToId8Transformer.java      |   41 +
 .../lang/gridfunc/IgniteOutClosureWrapper.java  |   58 +
 .../gridfunc/IgnitePredicateAlwaysFalse.java    |   46 +
 .../gridfunc/IgnitePredicateAlwaysTrue.java     |   46 +
 .../gridfunc/IgnitePredicateCacheHasPeek.java   |   41 +
 .../gridfunc/IgnitePredicateContainNodeId.java  |   52 +
 .../gridfunc/IgnitePredicateContainWrapper.java |   55 +
 .../IgnitePredicateEqualsClusterNodeId.java     |   51 +
 .../gridfunc/IgnitePredicateEqualsUUID.java     |   50 +
 .../IgnitePredicateEvaluateEntryByKey.java      |   53 +
 .../IgnitePredicateEvaluateEntryByValue.java    |   53 +
 .../gridfunc/IgnitePredicateHasEqualId.java     |   51 +
 .../gridfunc/IgnitePredicateHasNotEqualId.java  |   51 +
 .../IgnitePredicateIgniteFutureIsNotDone.java   |   40 +
 .../lang/gridfunc/IgnitePredicateIsAll.java     |   52 +
 .../IgnitePredicateIsAssignableFrom.java        |   51 +
 .../lang/gridfunc/IgnitePredicateIsNotAll.java  |   52 +
 .../lang/gridfunc/IgnitePredicateIsNull.java    |   44 +
 .../IgnitePredicateNotContainWrapper.java       |   54 +
 .../lang/gridfunc/IgnitePredicateNotEqual.java  |   53 +
 .../lang/gridfunc/IgnitePredicateNotNull.java   |   44 +
 .../lang/gridfunc/IgniteReducerAlwaysTrue.java  |   56 +
 .../util/lang/gridfunc/IgniteReducerIntSum.java |   51 +
 .../lang/gridfunc/IgniteReducerLongSum.java     |   51 +
 .../gridfunc/IgniteReducerStringConcat.java     |   79 ++
 .../util/lang/gridfunc/MultipleIterator.java    |  106 ++
 .../util/lang/gridfunc/package-info.java        |   22 +
 62 files changed, 3854 insertions(+), 1033 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/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 a00abe9..d246ee3 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
@@ -29,14 +29,12 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.NavigableSet;
-import java.util.NoSuchElementException;
 import java.util.RandomAccess;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
 import javax.cache.Cache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
@@ -47,17 +45,60 @@ import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.GridLeanSet;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.GridSerializableIterator;
-import org.apache.ignite.internal.util.GridSerializableMap;
-import org.apache.ignite.internal.util.GridSerializableSet;
-import org.apache.ignite.internal.util.typedef.C1;
-import org.apache.ignite.internal.util.typedef.CA;
+import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureNoOperation;
+import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosurePrint;
+import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureRunnableWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorAdapterClosurePredicatesWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorOverInnerCollectionsAdapter;
+import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorAdapterWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableCollectionPredicateWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyCollectionPredicateWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableCollectionWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapPredicatesTransformerWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapPredicatesWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapReadOnlyClosurePredicateWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapReadOnlyPredicateWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyCollectionWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyTwoCollectionsWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableArrayListFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableAtomicIntegerFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableConcurrentHashMapFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableConcurrentHashSetFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableDequeFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableHashMapFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableHashSetFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableLinkedListFactory;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureCacheGet;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureCacheGetKey;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureClusterNodeGetId;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureClusterNodeGetId8;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureIdentity;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureToString;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureUUIDToId8Transformer;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsAll;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateAlwaysFalse;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateAlwaysTrue;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateCacheHasPeek;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateContainNodeId;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateContainWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateEqualsClusterNodeId;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateEqualsUUID;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateHasEqualId;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateHasNotEqualId;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIgniteFutureIsNotDone;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsNotAll;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsNull;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotContainWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotEqual;
+import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotNull;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerAlwaysTrue;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerIntSum;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerLongSum;
+import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerStringConcat;
+import org.apache.ignite.internal.util.lang.gridfunc.MultipleIterator;
 import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.P1;
-import org.apache.ignite.internal.util.typedef.R1;
 import org.apache.ignite.internal.util.typedef.internal.A;
-import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiClosure;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -66,9 +107,7 @@ import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteReducer;
-import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
-import org.jsr166.ConcurrentHashMap8;
 import org.jsr166.ConcurrentLinkedDeque8;
 import org.jsr166.ThreadLocalRandom8;
 
@@ -93,167 +132,64 @@ import org.jsr166.ThreadLocalRandom8;
 @SuppressWarnings("unchecked")
 public class GridFunc {
     /** */
-    private static final GridAbsClosure NOOP = new CA() {
-        @Override public void apply() { /* No-op. */ }
-    };
+    private static final GridAbsClosure NOOP = new GridAbsClosureNoOperation();
 
     /** */
-    private static final IgniteClosure IDENTITY = new C1() {
-        /** */
-        private static final long serialVersionUID = -6338573080046225172L;
-
-        @Override public Object apply(Object o) {
-            return o;
-        }
-
-        @Override public String toString() {
-            return "Identity closure.";
-        }
-    };
+    private static final IgniteClosure IDENTITY = new IgniteClosureIdentity();
 
     /** */
-    private static final IgnitePredicate<Object> ALWAYS_TRUE = new P1<Object>() {
-        /** */
-        private static final long serialVersionUID = 6101914246981105862L;
-
-        @Override public boolean apply(Object e) {
-            return true;
-        }
-
-        @Override public String toString() {
-            return "Always true predicate.";
-        }
-    };
+    private static final IgnitePredicate<Object> ALWAYS_TRUE = new IgnitePredicateAlwaysTrue<>();
 
     /** */
-    private static final IgnitePredicate<Object> ALWAYS_FALSE = new P1<Object>() {
-        @Override public boolean apply(Object e) {
-            return false;
-        }
-
-        @Override public String toString() {
-            return "Always false predicate.";
-        }
-    };
+    private static final IgnitePredicate<Object> ALWAYS_FALSE = new IgnitePredicateAlwaysFalse<>();
 
     /** */
-    private static final IgniteCallable<?> DEQUE_FACTORY = new IgniteCallable<ConcurrentLinkedDeque8>() {
-        @Override public ConcurrentLinkedDeque8 call() {
-            return new ConcurrentLinkedDeque8();
-        }
-
-        @Override public String toString() {
-            return "Deque factory.";
-        }
-    };
+    private static final IgniteCallable<?> DEQUE_FACTORY = new IgniteCallableDequeFactory();
 
     /** */
-    private static final IgnitePredicate<Object> IS_NOT_NULL = new P1<Object>() {
-        @Override public boolean apply(Object o) {
-            return o != null;
-        }
-    };
+    private static final IgnitePredicate<Object> IS_NOT_NULL = new IgnitePredicateNotNull();
 
     /** */
-    private static final IgniteCallable<?> SET_FACTORY = new IgniteCallable<Set>() {
-        @Override public Set call() {
-            return new HashSet();
-        }
-
-        @Override public String toString() {
-            return "Hash set factory.";
-        }
-    };
+    private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallableArrayListFactory();
 
     /** */
-    private static final IgniteCallable<AtomicInteger> ATOMIC_INT_FACTORY = new IgniteCallable<AtomicInteger>() {
-        @Override public AtomicInteger call() {
-            return new AtomicInteger(0);
-        }
-
-        @Override public String toString() {
-            return "Atomic integer factory.";
-        }
-    };
+    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new IgniteCallableLinkedListFactory();
 
     /** */
-    private static final IgniteCallable<?> MAP_FACTORY = new IgniteCallable<Map>() {
-        @Override public Map call() {
-            return new HashMap();
-        }
-
-        @Override public String toString() {
-            return "Hash map factory.";
-        }
-    };
+    private static final IgniteCallable<?> SET_FACTORY = new IgniteCallableHashSetFactory();
 
     /** */
-    private static final IgniteCallable<?> CONCURRENT_MAP_FACTORY = new IgniteCallable<ConcurrentMap>() {
-        @Override public ConcurrentMap call() {
-            return new ConcurrentHashMap8();
-        }
-
-        @Override public String toString() {
-            return "Concurrent hash map factory.";
-        }
-    };
+    private static final IgniteCallable<AtomicInteger> ATOMIC_INT_FACTORY = new IgniteCallableAtomicIntegerFactory();
 
     /** */
-    private static final IgniteCallable<?> CONCURRENT_SET_FACTORY = new IgniteCallable<GridConcurrentHashSet>() {
-        @Override public GridConcurrentHashSet call() {
-            return new GridConcurrentHashSet();
-        }
+    private static final IgniteCallable<?> MAP_FACTORY = new IgniteCallableHashMapFactory();
 
-        @Override public String toString() {
-            return "Concurrent hash set factory.";
-        }
-    };
+    /** */
+    private static final IgniteCallable<?> CONCURRENT_MAP_FACTORY = new IgniteCallableConcurrentHashMapFactory();
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
-        @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getKey();
-        }
+    private static final IgniteCallable<?> CONCURRENT_SET_FACTORY = new IgniteCallableConcurrentHashSetFactory();
 
-        @Override public String toString() {
-            return "Map entry to key transformer closure.";
-        }
-    };
+    /** */
+    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosureCacheGetKey();
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
-        @SuppressWarnings({"unchecked"})
-        @Nullable @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getValue();
-        }
+    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosureCacheGet();
 
-        @Override public String toString() {
-            return "Cache entry to get-value transformer closure.";
-        }
-    };
+    /** */
+    private static final IgnitePredicate CACHE_ENTRY_HAS_PEEK_VAL = new IgnitePredicateCacheHasPeek();
 
     /** */
-    private static final IgnitePredicate CACHE_ENTRY_HAS_PEEK_VAL = new IgnitePredicate() {
-        @SuppressWarnings({"unchecked"})
-        @Override public boolean apply(Object o) {
-            return ((Cache.Entry)o).getValue() != null;
-        }
+    private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosureClusterNodeGetId();
 
-        @Override public String toString() {
-            return "Cache entry has-peek-value predicate.";
-        }
-    };
+    /** */
+    private static final IgniteClosure<ClusterNode, String> NODE2ID8 = new IgniteClosureClusterNodeGetId8();
 
     /** */
-    private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosure<ClusterNode, UUID>() {
-        @Override public UUID apply(ClusterNode n) {
-            return n.id();
-        }
+    private static final IgniteClosure<UUID, String> ID2ID8 = new IgniteClosureUUIDToId8Transformer();
 
-        @Override public String toString() {
-            return "Grid node to node ID transformer closure.";
-        }
-    };
+    /** */
+    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IgnitePredicateIgniteFutureIsNotDone();
 
     /**
      * Gets predicate that evaluates to {@code true} only for given local node ID.
@@ -263,11 +199,7 @@ public class GridFunc {
      * @return Return {@code true} only for the node with given local node ID.
      */
     public static <T extends ClusterNode> IgnitePredicate<T> localNode(final UUID locNodeId) {
-        return new P1<T>() {
-            @Override public boolean apply(T n) {
-                return n.id().equals(locNodeId);
-            }
-        };
+        return new IgnitePredicateHasEqualId<>(locNodeId);
     }
 
     /**
@@ -278,11 +210,7 @@ public class GridFunc {
      * @return Return {@code false} for the given local node ID.
      */
     public static <T extends ClusterNode> IgnitePredicate<T> remoteNodes(final UUID locNodeId) {
-        return new P1<T>() {
-            @Override public boolean apply(T n) {
-                return !n.id().equals(locNodeId);
-            }
-        };
+        return new IgnitePredicateHasNotEqualId<>(locNodeId);
     }
 
     /**
@@ -331,15 +259,7 @@ public class GridFunc {
      * @return Passed in element.
      */
     public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
-        return new R1<T, T>() {
-            @Override public boolean collect(T e) {
-                return true;
-            }
-
-            @Override public T reduce() {
-                return elem;
-            }
-        };
+        return new IgniteReducerAlwaysTrue<>(elem);
     }
 
     /**
@@ -351,20 +271,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<Integer, Integer> sumIntReducer() {
-        return new R1<Integer, Integer>() {
-            private AtomicInteger sum = new AtomicInteger(0);
-
-            @Override public boolean collect(Integer e) {
-                if (e != null)
-                    sum.addAndGet(e);
-
-                return true;
-            }
-
-            @Override public Integer reduce() {
-                return sum.get();
-            }
-        };
+        return new IgniteReducerIntSum();
     }
 
     /**
@@ -376,20 +283,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<Long, Long> sumLongReducer() {
-        return new R1<Long, Long>() {
-            private AtomicLong sum = new AtomicLong(0);
-
-            @Override public boolean collect(Long e) {
-                if (e != null)
-                    sum.addAndGet(e);
-
-                return true;
-            }
-
-            @Override public Long reduce() {
-                return sum.get();
-            }
-        };
+        return new IgniteReducerLongSum();
     }
 
     /**
@@ -424,32 +318,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
-        return new R1<String, String>() {
-            private SB sb = new SB();
-
-            private boolean first = true;
-
-            private final Object lock = new Object();
-
-            @Override public boolean collect(String s) {
-                synchronized (lock) {
-                    if (!first && !isEmpty(delim))
-                        sb.a(delim);
-
-                    sb.a(s);
-
-                    first = false;
-                }
-
-                return true;
-            }
-
-            @Override public String reduce() {
-                synchronized (lock) {
-                    return sb.toString();
-                }
-            }
-        };
+        return new IgniteReducerStringConcat(delim);
     }
 
     /**
@@ -490,11 +359,7 @@ public class GridFunc {
      */
     @Deprecated
     public static GridAbsClosure println(final String msg) {
-        return new CA() {
-            @Override public void apply() {
-                System.out.println(msg);
-            }
-        };
+        return new GridAbsClosurePrint(msg);
     }
 
     /**
@@ -584,40 +449,7 @@ public class GridFunc {
             if (isEmpty(c))
                 return Collections.singletonList(t);
 
-            return new GridSerializableCollection<T>() {
-                @NotNull
-                @Override public Iterator<T> iterator() {
-                    return new GridSerializableIterator<T>() {
-                        private Iterator<T> it;
-
-                        @Override public boolean hasNext() {
-                            return it == null || it.hasNext();
-                        }
-
-                        @Nullable @Override public T next() {
-                            if (it == null) {
-                                it = c.iterator();
-
-                                return t;
-                            }
-
-                            return it.next();
-                        }
-
-                        @Override public void remove() {
-                            throw new UnsupportedOperationException();
-                        }
-                    };
-                }
-
-                @Override public int size() {
-                    return c.size() + 1;
-                }
-
-                @Override public boolean equals(Object obj) {
-                    return obj instanceof Collection && eqNotOrdered(this, (Collection)obj);
-                }
-            };
+            return new GridSerializableReadOnlyCollectionWrapper<>(c, t);
         }
     }
 
@@ -666,45 +498,7 @@ public class GridFunc {
                 return c;
             }
 
-            return new GridSerializableCollection<T>() {
-                @NotNull
-                @Override public Iterator<T> iterator() {
-                    return new GridSerializableIterator<T>() {
-                        private Iterator<T> it1 = c1.iterator();
-                        private Iterator<T> it2 = c2.iterator();
-
-                        @Override public boolean hasNext() {
-                            if (it1 != null)
-                                if (!it1.hasNext())
-                                    it1 = null;
-                                else
-                                    return true;
-
-                            return it2.hasNext();
-                        }
-
-                        @Override public T next() {
-                            return it1 != null ? it1.next() : it2.next();
-                        }
-
-                        @Override public void remove() {
-                            throw new UnsupportedOperationException();
-                        }
-                    };
-                }
-
-                @Override public boolean contains(Object o) {
-                    return c1.contains(o) || c2.contains(o);
-                }
-
-                @Override public int size() {
-                    return c1.size() + c2.size();
-                }
-
-                @Override public boolean equals(Object obj) {
-                    return obj instanceof Collection && eqNotOrdered(this, (Collection<?>)obj);
-                }
-            };
+            return new GridSerializableReadOnlyTwoCollectionsWrapper<>(c1, c2);
         }
     }
 
@@ -754,60 +548,7 @@ public class GridFunc {
         if (!iters.hasNext())
             return Collections.<T>emptySet().iterator();
 
-        return new Iterator<T>() {
-            private Iterator<T> it = iters.next();
-
-            private Iterator<T> last;
-
-            private T next;
-
-            {
-                advance();
-            }
-
-            private void advance() {
-                for (;;) {
-                    if (it.hasNext()) {
-                        next = it.next();
-
-                        assert next != null;
-
-                        return;
-                    }
-
-                    if (!iters.hasNext())
-                        return;
-
-                    it = iters.next();
-                }
-            }
-
-            @Override public boolean hasNext() {
-                return next != null;
-            }
-
-            @Override public T next() {
-                T res = next;
-
-                if (res == null)
-                    throw new NoSuchElementException();
-
-                next = null;
-
-                last = it;
-
-                advance();
-
-                return res;
-            }
-
-            @Override public void remove() {
-                if (last == null)
-                    throw new IllegalStateException();
-
-                last.remove();
-            }
-        };
+        return new MultipleIterator<>(iters);
     }
 
     /**
@@ -999,14 +740,7 @@ public class GridFunc {
     public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeId(final UUID nodeId) {
         A.notNull(nodeId, "nodeId");
 
-        return new P1<T>() {
-            /** */
-            private static final long serialVersionUID = -7082730222779476623L;
-
-            @Override public boolean apply(ClusterNode e) {
-                return e.id().equals(nodeId);
-            }
-        };
+        return new IgnitePredicateEqualsClusterNodeId<>(nodeId);
     }
 
     /**
@@ -1022,14 +756,7 @@ public class GridFunc {
         if (isEmpty(nodeIds))
             return alwaysFalse();
 
-        return new P1<T>() {
-            /** */
-            private static final long serialVersionUID = -5664060422647374863L;
-
-            @Override public boolean apply(ClusterNode e) {
-                return nodeIds.contains(e.id());
-            }
-        };
+        return new IgnitePredicateContainNodeId<>(nodeIds);
     }
 
     /**
@@ -1043,11 +770,7 @@ public class GridFunc {
     public static IgnitePredicate<UUID> idForNodeId(final UUID nodeId) {
         A.notNull(nodeId, "nodeId");
 
-        return new P1<UUID>() {
-            @Override public boolean apply(UUID id) {
-                return id.equals(nodeId);
-            }
-        };
+        return new IgnitePredicateEqualsUUID(nodeId);
     }
 
     /**
@@ -1144,6 +867,19 @@ public class GridFunc {
     }
 
     /**
+     * Curries given closure.
+     *
+     * @param f Closure.
+     * @param e Parameter.
+     * @param <T> Input type.
+     * @return Curried closure.
+     */
+    @Deprecated
+    public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
+        return new GridAbsClosureWrapper<>(f, e);
+    }
+
+    /**
      * Converts array to {@link List}. Note that resulting list cannot
      * be altered in size, as it it based on the passed in array -
      * only current elements can be changed.
@@ -1190,20 +926,7 @@ public class GridFunc {
         if (F.isEmpty(c))
             return Collections.emptyList();
 
-        return new GridSerializableCollection<T>() {
-            @NotNull
-            @Override public Iterator<T> iterator() {
-                return flat((Iterable<? extends Iterable<T>>)c);
-            }
-
-            @Override public int size() {
-                return F.size(iterator());
-            }
-
-            @Override public boolean isEmpty() {
-                return !iterator().hasNext();
-            }
-        };
+        return new GridSerializableCollectionWrapper<>(c);
     }
 
     /**
@@ -1216,54 +939,7 @@ public class GridFunc {
      * @return Iterable over the elements of the inner collections.
      */
     public static <T> GridIterator<T> flat(@Nullable final Iterable<? extends Iterable<T>> c) {
-        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
-            /** */
-            private Iterator<? extends Iterable<T>> a = c.iterator();
-
-            /** */
-            private Iterator<T> b;
-
-            /** */
-            private boolean moved = true;
-
-            /** */
-            private boolean more;
-
-            @Override public boolean hasNextX() {
-                if (!moved)
-                    return more;
-
-                moved = false;
-
-                if (b != null && b.hasNext())
-                    return more = true;
-
-                while (a.hasNext()) {
-                    b = a.next().iterator();
-
-                    if (b.hasNext())
-                        return more = true;
-                }
-
-                return more = false;
-            }
-
-            @Override public T nextX() {
-                if (hasNext()) {
-                    moved = true;
-
-                    return b.next();
-                }
-
-                throw new NoSuchElementException();
-            }
-
-            @Override public void removeX() {
-                assert b != null;
-
-                b.remove();
-            }
-        };
+        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorOverInnerCollectionsAdapter<>(c);
     }
 
     /**
@@ -1275,54 +951,7 @@ public class GridFunc {
      * @return Iterator over the elements of given iterators.
      */
     public static <T> Iterator<T> flatIterators(@Nullable final Iterable<Iterator<T>> c) {
-        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
-            /** */
-            private Iterator<? extends Iterator<T>> a = c.iterator();
-
-            /** */
-            private Iterator<T> b;
-
-            /** */
-            private boolean moved = true;
-
-            /** */
-            private boolean more;
-
-            @Override public boolean hasNextX() {
-                if (!moved)
-                    return more;
-
-                moved = false;
-
-                if (b != null && b.hasNext())
-                    return more = true;
-
-                while (a.hasNext()) {
-                    b = a.next();
-
-                    if (b.hasNext())
-                        return more = true;
-                }
-
-                return more = false;
-            }
-
-            @Override public T nextX() {
-                if (hasNext()) {
-                    moved = true;
-
-                    return b.next();
-                }
-
-                throw new NoSuchElementException();
-            }
-
-            @Override public void removeX() {
-                assert b != null;
-
-                b.remove();
-            }
-        };
+        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapterWrapper<>(c);
     }
 
     /**
@@ -1333,12 +962,7 @@ public class GridFunc {
      */
     @Deprecated
     public static GridAbsClosure as(@Nullable final Runnable r) {
-        return new CA() {
-            @Override public void apply() {
-                if (r != null)
-                    r.run();
-            }
-        };
+        return new GridAbsClosureRunnableWrapper(r);
     }
 
     /**
@@ -1398,25 +1022,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? c : new GridSerializableCollection<T>() {
-            // Pass through (will fail for readonly).
-            @Override public boolean add(T e) {
-                return isAll(e, p) && c.add(e);
-            }
-
-            @NotNull
-            @Override public Iterator<T> iterator() {
-                return F.iterator0(c, false, p);
-            }
-
-            @Override public int size() {
-                return F.size(c, p);
-            }
-
-            @Override public boolean isEmpty() {
-                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
-            }
-        };
+        return isEmpty(p) || isAlwaysTrue(p) ? c : new GridSerializableCollectionPredicateWrapper<>(c, p);
     }
 
     /**
@@ -1442,20 +1048,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        return new GridSerializableCollection<T2>() {
-            @NotNull
-            @Override public Iterator<T2> iterator() {
-                return F.<T1, T2>iterator(c, trans, true, p);
-            }
-
-            @Override public int size() {
-                return F.isEmpty(p) ? c.size() : F.size(iterator());
-            }
-
-            @Override public boolean isEmpty() {
-                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
-            }
-        };
+        return new GridSerializableReadOnlyCollectionPredicateWrapper<T2, T1>(c, trans, p);
     }
 
     /**
@@ -1476,68 +1069,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? m : new GridSerializableMap<K, V>() {
-            /** */
-            private static final long serialVersionUID = 5531745605372387948L;
-
-            /** Entry predicate. */
-            private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K, V>>() {
-                @Override public boolean apply(Entry<K, V> e) {
-                    return isAll(e.getKey(), p);
-                }
-            };
-
-            @NotNull
-            @Override public Set<Entry<K, V>> entrySet() {
-                return new GridSerializableSet<Map.Entry<K, V>>() {
-                    @NotNull
-                    @Override public Iterator<Entry<K, V>> iterator() {
-                        return iterator0(m.entrySet(), false, ep);
-                    }
-
-                    @Override public int size() {
-                        return F.size(m.keySet(), p);
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean remove(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().remove(o);
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
-                    }
-
-                    @Override public boolean isEmpty() {
-                        return !iterator().hasNext();
-                    }
-                };
-            }
-
-            @Override public boolean isEmpty() {
-                return entrySet().isEmpty();
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Nullable @Override public V get(Object key) {
-                return isAll((K)key, p) ? m.get(key) : null;
-            }
-
-            @Nullable @Override public V put(K key, V val) {
-                V oldVal = get(key);
-
-                if (isAll(key, p))
-                    m.put(key, val);
-
-                return oldVal;
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
-            }
-        };
+        return isEmpty(p) || isAlwaysTrue(p) ? m : new GridSerializableMapPredicatesWrapper<K, V>(m, p);
     }
 
     /**
@@ -1562,101 +1094,9 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        final boolean hasPred = p != null && p.length > 0;
-
-        return new GridSerializableMap<K, V1>() {
-            /** Entry predicate. */
-            private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K, V>>() {
-                @Override public boolean apply(Entry<K, V> e) {
-                    return isAll(e.getKey(), p);
-                }
-            };
-
-            @NotNull
-            @Override public Set<Entry<K, V1>> entrySet() {
-                return new GridSerializableSet<Map.Entry<K, V1>>() {
-                    @NotNull
-                    @Override public Iterator<Entry<K, V1>> iterator() {
-                        return new Iterator<Entry<K, V1>>() {
-                            private Iterator<Entry<K, V>> it = iterator0(m.entrySet(), true, ep);
-
-                            @Override public boolean hasNext() {
-                                return it.hasNext();
-                            }
-
-                            @Override public Entry<K, V1> next() {
-                                final Entry<K, V> e = it.next();
-
-                                return new Entry<K, V1>() {
-                                    @Override public K getKey() {
-                                        return e.getKey();
-                                    }
-
-                                    @Override public V1 getValue() {
-                                        return trans.apply(e.getValue());
-                                    }
-
-                                    @Override public V1 setValue(V1 val) {
-                                        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-                                    }
-                                };
-                            }
-
-                            @Override public void remove() {
-                                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                            }
-                        };
-                    }
-
-                    @Override public int size() {
-                        return hasPred ? F.size(m.keySet(), p) : m.size();
-                    }
+        assert m != null;
 
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean remove(Object o) {
-                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
-                    }
-
-                    @Override public boolean isEmpty() {
-                        return hasPred ? !iterator().hasNext() : m.isEmpty();
-                    }
-                };
-            }
-
-            @Override public boolean isEmpty() {
-                return hasPred ? entrySet().isEmpty() : m.isEmpty();
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Nullable @Override public V1 get(Object key) {
-                if (isAll((K)key, p)) {
-                    V v = m.get(key);
-
-                    if (v != null)
-                        return trans.apply(v);
-                }
-
-                return null;
-            }
-
-            @Nullable @Override public V1 put(K key, V1 val) {
-                throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-            }
-
-            @Override public V1 remove(Object key) {
-                throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
-            }
-        };
+        return new GridSerializableMapPredicatesTransformerWrapper<K, V1, V>(m, trans, p);
     }
 
     /**
@@ -1682,100 +1122,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new GridSerializableMap<K, V1>() {
-            /** Entry predicate. */
-            private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K, V>>() {
-                @Override public boolean apply(Entry<K, V> e) {
-                    return isAll(e.getKey(), p);
-                }
-            };
-
-            @NotNull
-            @Override public Set<Entry<K, V1>> entrySet() {
-                return new GridSerializableSet<Map.Entry<K, V1>>() {
-                    @NotNull
-                    @Override public Iterator<Entry<K, V1>> iterator() {
-                        return new Iterator<Entry<K, V1>>() {
-                            private Iterator<Entry<K, V>> it = iterator0(m.entrySet(), true, ep);
-
-                            @Override public boolean hasNext() {
-                                return it.hasNext();
-                            }
-
-                            @Override public Entry<K, V1> next() {
-                                final Entry<K, V> e = it.next();
-
-                                return new Entry<K, V1>() {
-                                    @Override public K getKey() {
-                                        return e.getKey();
-                                    }
-
-                                    @Override public V1 getValue() {
-                                        return trans.apply(e.getKey(), e.getValue());
-                                    }
-
-                                    @Override public V1 setValue(V1 val) {
-                                        throw new UnsupportedOperationException(
-                                            "Put is not supported for readonly map view.");
-                                    }
-                                };
-                            }
-
-                            @Override public void remove() {
-                                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                            }
-                        };
-                    }
-
-                    @Override public int size() {
-                        return F.size(m.keySet(), p);
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean remove(Object o) {
-                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
-                    }
-
-                    @Override public boolean isEmpty() {
-                        return !iterator().hasNext();
-                    }
-                };
-            }
-
-            @Override public boolean isEmpty() {
-                return entrySet().isEmpty();
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Nullable @Override public V1 get(Object key) {
-                if (isAll((K)key, p)) {
-                    V v = m.get(key);
-
-                    if (v != null)
-                        return trans.apply((K)key, v);
-                }
-
-                return null;
-            }
-
-            @Nullable @Override public V1 put(K key, V1 val) {
-                throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-            }
-
-            @Override public V1 remove(Object key) {
-                throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
-            }
-        };
+        return new GridSerializableMapReadOnlyClosurePredicateWrapper<K, V, V1>(m, trans, p);
     }
 
     /**
@@ -1802,87 +1149,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new GridSerializableMap<K, V>() {
-            /** Entry predicate. */
-            private IgnitePredicate<K> ep = new P1<K>() {
-                @Override public boolean apply(K e) {
-                    return isAll(e, p);
-                }
-            };
-
-            @NotNull @Override public Set<Entry<K, V>> entrySet() {
-                return new GridSerializableSet<Entry<K, V>>() {
-                    @NotNull @Override public Iterator<Entry<K, V>> iterator() {
-                        return new Iterator<Entry<K, V>>() {
-                            private Iterator<K> it = iterator0(c, true, ep);
-
-                            @Override public boolean hasNext() {
-                                return it.hasNext();
-                            }
-
-                            @Override public Entry<K, V> next() {
-                                final K e = it.next();
-
-                                return new Entry<K, V>() {
-                                    @Override public K getKey() {
-                                        return e;
-                                    }
-
-                                    @Override public V getValue() {
-                                        return mapClo.apply(e);
-                                    }
-
-                                    @Override public V setValue(V val) {
-                                        throw new UnsupportedOperationException(
-                                            "Put is not supported for readonly collection view.");
-                                    }
-                                };
-                            }
-
-                            @Override public void remove() {
-                                throw new UnsupportedOperationException(
-                                    "Remove is not support for readonly collection view.");
-                            }
-                        };
-                    }
-
-                    @Override public int size() {
-                        return F.size(c, p);
-                    }
-
-                    @Override public boolean remove(Object o) {
-                        throw new UnsupportedOperationException("Remove is not support for readonly collection view.");
-                    }
-
-                    @Override public boolean isEmpty() {
-                        return !iterator().hasNext();
-                    }
-                };
-            }
-
-            @Override public boolean isEmpty() {
-                return entrySet().isEmpty();
-            }
-
-            @Nullable @Override public V get(Object key) {
-                if (containsKey(key))
-                    return mapClo.apply((K)key);
-
-                return null;
-            }
-
-            @Nullable @Override public V put(K key, V val) {
-                throw new UnsupportedOperationException("Put is not supported for readonly collection view.");
-            }
-
-            @Override public V remove(Object key) {
-                throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
-            }
-
-            @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && c.contains(key);
-            }
-        };
+        return new GridSerializableMapReadOnlyPredicateWrapper<K, V>(c, mapClo, p);
     }
 
     /**
@@ -2106,76 +1373,7 @@ public class GridFunc {
         if (isAlwaysFalse(p))
             return F.emptyIterator();
 
-        return new GridIteratorAdapter<T2>() {
-            /** */
-            private T1 elem;
-
-            /** */
-            private boolean moved = true;
-
-            /** */
-            private boolean more;
-
-            /** */
-            private Iterator<? extends T1> iter = c.iterator();
-
-            @Override public boolean hasNextX() {
-                if (isEmpty(p))
-                    return iter.hasNext();
-                else {
-                    if (!moved)
-                        return more;
-                    else {
-                        more = false;
-
-                        while (iter.hasNext()) {
-                            elem = iter.next();
-
-                            boolean isAll = true;
-
-                            for (IgnitePredicate<? super T1> r : p)
-                                if (r != null && !r.apply(elem)) {
-                                    isAll = false;
-
-                                    break;
-                                }
-
-                            if (isAll) {
-                                more = true;
-                                moved = false;
-
-                                return true;
-                            }
-                        }
-
-                        elem = null; // Give to GC.
-
-                        return false;
-                    }
-                }
-            }
-
-            @Nullable @Override public T2 nextX() {
-                if (isEmpty(p))
-                    return trans.apply(iter.next());
-                else {
-                    if (hasNext()) {
-                        moved = true;
-
-                        return trans.apply(elem);
-                    }
-                    else
-                        throw new NoSuchElementException();
-                }
-            }
-
-            @Override public void removeX() {
-                if (readOnly)
-                    throw new UnsupportedOperationException("Cannot modify read-only iterator.");
-
-                iter.remove();
-            }
-        };
+        return new GridIteratorAdapterClosurePredicatesWrapper<>(c.iterator(), trans, readOnly, p);
     }
 
     /**
@@ -2196,76 +1394,7 @@ public class GridFunc {
         if (isAlwaysFalse(p))
             return F.emptyIterator();
 
-        return new GridIteratorAdapter<T2>() {
-            /** */
-            private T1 elem;
-
-            /** */
-            private boolean moved = true;
-
-            /** */
-            private boolean more;
-
-            /** */
-            private Iterator<? extends T1> iter = c;
-
-            @Override public boolean hasNextX() {
-                if (isEmpty(p))
-                    return iter.hasNext();
-                else {
-                    if (!moved)
-                        return more;
-                    else {
-                        more = false;
-
-                        while (iter.hasNext()) {
-                            elem = iter.next();
-
-                            boolean isAll = true;
-
-                            for (IgnitePredicate<? super T1> r : p)
-                                if (r != null && !r.apply(elem)) {
-                                    isAll = false;
-
-                                    break;
-                                }
-
-                            if (isAll) {
-                                more = true;
-                                moved = false;
-
-                                return true;
-                            }
-                        }
-
-                        elem = null; // Give to GC.
-
-                        return false;
-                    }
-                }
-            }
-
-            @Nullable @Override public T2 nextX() {
-                if (isEmpty(p))
-                    return trans.apply(iter.next());
-                else {
-                    if (hasNext()) {
-                        moved = true;
-
-                        return trans.apply(elem);
-                    }
-                    else
-                        throw new NoSuchElementException();
-                }
-            }
-
-            @Override public void removeX() {
-                if (readOnly)
-                    throw new UnsupportedOperationException("Cannot modify read-only iterator.");
-
-                iter.remove();
-            }
-        };
+        return new GridIteratorAdapterClosurePredicatesWrapper<>(c, trans, readOnly, p);
     }
 
     /**
@@ -2362,11 +1491,7 @@ public class GridFunc {
      */
     @SafeVarargs
     public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
-        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !isAll(t, p);
-            }
-        };
+        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new IgnitePredicateIsNotAll<>(p);
     }
 
     /**
@@ -2380,11 +1505,7 @@ public class GridFunc {
      */
     @Deprecated
     public static <T> IgnitePredicate<T> equalTo(@Nullable final T target) {
-        return new P1<T>() {
-            @Override public boolean apply(T t) {
-                return eq(t, target);
-            }
-        };
+        return new IgnitePredicateNotEqual<>(target);
     }
 
     /**
@@ -2397,11 +1518,7 @@ public class GridFunc {
      *      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 !eq(t, target);
-            }
-        };
+        return new IgnitePredicateNotEqual<>(target);
     }
 
     /**
@@ -2549,17 +1666,8 @@ public class GridFunc {
             // T must be <T extends ClusterNode>.
             return (IgnitePredicate<T>)new GridNodePredicate(ids);
         }
-        else {
-            return new P1<T>() {
-                @Override public boolean apply(T t) {
-                    for (IgnitePredicate<? super T> p : ps)
-                        if (p != null && !p.apply(t))
-                            return false;
-
-                    return true;
-                }
-            };
-        }
+        else
+            return new IgnitePredicateIsAll<>(ps);
     }
 
     /**
@@ -2581,11 +1689,7 @@ public class GridFunc {
      */
     @Deprecated
     public static <T> IgniteClosure<T, String> string() {
-        return new C1<T, String>() {
-            @Override public String apply(@Nullable T t) {
-                return String.valueOf(t); // This is null-safe.
-            }
-        };
+        return new IgniteClosureToString<>();
     }
 
     /**
@@ -2599,11 +1703,7 @@ public class GridFunc {
      *      contained in given collection.
      */
     public static <T> IgnitePredicate<T> notIn(@Nullable final Collection<? extends T> c) {
-        return isEmpty(c) ? GridFunc.<T>alwaysTrue() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !c.contains(t);
-            }
-        };
+        return isEmpty(c) ? GridFunc.<T>alwaysTrue() : new IgnitePredicateNotContainWrapper<>(c);
     }
 
     /**
@@ -3690,11 +2790,7 @@ public class GridFunc {
      *  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);
-            }
-        };
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysFalse() : new IgnitePredicateContainWrapper(c);
     }
 
     /**
@@ -3707,11 +2803,7 @@ public class GridFunc {
      *  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);
-            }
-        };
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysTrue() : new IgnitePredicateNotContainWrapper(c);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
new file mode 100644
index 0000000..196df80
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Absolute closure that does nothing.
+ */
+public class GridAbsClosureNoOperation extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridAbsClosureNoOperation.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
new file mode 100644
index 0000000..33070f5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Absolute closure that print message.
+ */
+public class GridAbsClosurePrint extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private String message;
+
+    /**
+     * @param message Message to print.
+     */
+    public GridAbsClosurePrint(String message) {
+        this.message = message;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        System.out.println(message);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridAbsClosurePrint.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
new file mode 100644
index 0000000..6fa98f8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Closure that wraps given runnable.
+ * Note that wrapping closure always returns {@code null}.
+ */
+public class GridAbsClosureRunnableWrapper extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Runnable r;
+
+    /**
+     * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+     */
+    public GridAbsClosureRunnableWrapper(Runnable r) {
+        this.r = r;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        if (r != null)
+            r.run();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridAbsClosureRunnableWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
new file mode 100644
index 0000000..9902e2b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteInClosure;
+
+/**
+ * Wraps given closure.
+ *
+ * @param <T> Input type.
+ */
+public class GridAbsClosureWrapper<T> extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgniteInClosure<? super T> closure;
+
+    /** */
+    private final T closureArgument;
+
+    /**
+     * @param closure Closure.
+     * @param closureArgument Closure argument.
+     */
+    public GridAbsClosureWrapper(IgniteInClosure<? super T> closure, T closureArgument) {
+        this.closure = closure;
+        this.closureArgument = closureArgument;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        closure.apply(closureArgument);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridAbsClosureWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
new file mode 100644
index 0000000..eeb31b3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Iterator from given iterator and optional filtering predicate.
+ */
+public class GridIteratorAdapterClosurePredicatesWrapper<T2, T1> extends GridIteratorAdapter<T2> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgniteClosure<? super T1, T2> transformer;
+
+    /** */
+    private final boolean readOnly;
+
+    /** */
+    private final IgnitePredicate<? super T1>[] predicates;
+
+    /** */
+    private T1 elem;
+
+    /** */
+    private boolean more;
+
+    /** */
+    private boolean moved;
+
+    /** */
+    private Iterator<? extends T1> iterator;
+
+    /**
+     * @param iterator Input iterator.
+     * @param transformer Transforming closure to convert from T1 to T2.
+     * @param readOnly If {@code true}, then resulting iterator will not allow modifications to the underlying
+     * collection.
+     * @param predicates Optional filtering predicates.
+     */
+    public GridIteratorAdapterClosurePredicatesWrapper(Iterator<? extends T1> iterator, IgniteClosure<? super T1, T2> transformer,
+        boolean readOnly,
+        IgnitePredicate<? super T1>... predicates) {
+        this.transformer = transformer;
+        this.readOnly = readOnly;
+        this.predicates = predicates;
+        this.iterator = iterator;
+        this.moved = true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasNextX() {
+        if (GridFunc.isEmpty(predicates))
+            return iterator.hasNext();
+        else {
+            if (!moved)
+                return more;
+            else {
+                more = false;
+
+                while (iterator.hasNext()) {
+                    elem = iterator.next();
+
+                    boolean isAll = true;
+
+                    for (IgnitePredicate<? super T1> r : predicates)
+                        if (r != null && !r.apply(elem)) {
+                            isAll = false;
+
+                            break;
+                        }
+
+                    if (isAll) {
+                        more = true;
+                        moved = false;
+
+                        return true;
+                    }
+                }
+
+                elem = null; // Give to GC.
+
+                return false;
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public T2 nextX() {
+        if (GridFunc.isEmpty(predicates))
+            return transformer.apply(iterator.next());
+        else {
+            if (hasNext()) {
+                moved = true;
+
+                return transformer.apply(elem);
+            }
+            else
+                throw new NoSuchElementException();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void removeX() {
+        if (readOnly)
+            throw new UnsupportedOperationException("Cannot modify read-only iterator.");
+
+        iterator.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridIteratorAdapterClosurePredicatesWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
new file mode 100644
index 0000000..22e2033
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Iterator over the elements of given iterators.
+ *
+ * @param <T> Type of the inner iterators.
+ */
+public class GridIteratorAdapterWrapper<T> extends GridIteratorAdapter<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Iterable<Iterator<T>> iterable;
+
+    /** */
+    private Iterator<? extends Iterator<T>> iterator;
+
+    /** */
+    private Iterator<T> next;
+
+    /** */
+    private boolean moved;
+
+    /** */
+    private boolean more;
+
+    /**
+     * @param iterable Input iterable of iterators.
+     */
+    public GridIteratorAdapterWrapper(Iterable<Iterator<T>> iterable) {
+        this.iterable = iterable;
+        iterator = iterable.iterator();
+        moved = true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasNextX() {
+        if (!moved)
+            return more;
+
+        moved = false;
+
+        if (next != null && next.hasNext())
+            return more = true;
+
+        while (iterator.hasNext()) {
+            next = iterator.next();
+
+            if (next.hasNext())
+                return more = true;
+        }
+
+        return more = false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T nextX() {
+        if (hasNext()) {
+            moved = true;
+
+            return next.next();
+        }
+
+        throw new NoSuchElementException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void removeX() {
+        assert next != null;
+
+        next.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridIteratorAdapterWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
new file mode 100644
index 0000000..c309232
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Wrapper wich iterable over the elements of the inner collections.
+ *
+ * @param <T> Type of the inner collections.
+ */
+public class GridIteratorOverInnerCollectionsAdapter<T> extends GridIteratorAdapter<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Iterable<? extends Iterable<T>> iterable;
+
+    /** */
+    private Iterator<? extends Iterable<T>> iterator;
+
+    /** */
+    private Iterator<T> next;
+
+    /** */
+    private boolean moved;
+
+    /** */
+    private boolean more;
+
+    /**
+     * @param iterable Input collection of collections.
+     */
+    public GridIteratorOverInnerCollectionsAdapter(Iterable<? extends Iterable<T>> iterable) {
+        this.iterable = iterable;
+        iterator = iterable.iterator();
+        moved = true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasNextX() {
+        if (!moved)
+            return more;
+
+        moved = false;
+
+        if (next != null && next.hasNext())
+            return more = true;
+
+        while (iterator.hasNext()) {
+            next = iterator.next().iterator();
+
+            if (next.hasNext())
+                return more = true;
+        }
+
+        return more = false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T nextX() {
+        if (hasNext()) {
+            moved = true;
+
+            return next.next();
+        }
+
+        throw new NoSuchElementException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void removeX() {
+        assert next != null;
+
+        next.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridIteratorOverInnerCollectionsAdapter.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
new file mode 100644
index 0000000..771da37
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Light-weight view on given collection with provided predicate.
+ *
+ * @param <T> Type of the collection.
+ */
+public class GridSerializableCollectionPredicateWrapper<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<T> collection;
+
+    /** */
+    private final IgnitePredicate<? super T>[] predicates;
+
+    /**
+     * @param collection Input collection that serves as a base for the view.
+     * @param predicates Optional predicates. If predicates are not provided - all elements will be in the view.
+     */
+    public GridSerializableCollectionPredicateWrapper(Collection<T> collection, IgnitePredicate<? super T>... predicates) {
+        this.collection = collection;
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean add(T e) {
+        // Pass through (will fail for readonly).
+        return GridFunc.isAll(e, predicates) && collection.add(e);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T> iterator() {
+        return F.iterator0(collection, false, predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.size(collection, predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return F.isEmpty(predicates) ? collection.isEmpty() : !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableCollectionPredicateWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
new file mode 100644
index 0000000..cbabe9b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Wrapper which iterable over the elements of the inner collections.
+ *
+ * @param <T> Type of the inner collections.
+ */
+public class GridSerializableCollectionWrapper<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends Collection<T>> collections;
+
+    /**
+     * @param collections Input collection of collections.
+     */
+    public GridSerializableCollectionWrapper(Collection<? extends Collection<T>> collections) {
+        this.collections = collections;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T> iterator() {
+        return GridFunc.flat((Iterable<? extends Iterable<T>>)collections);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.size(iterator());
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableCollectionWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
new file mode 100644
index 0000000..a932e37
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.List;
+import org.apache.ignite.internal.util.GridSerializableList;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Light-weight view on given list with provided transformation.
+ *
+ * @param <T1> Element type after transformation.
+ * @param <T2> Element type.
+ */
+public class GridSerializableListReadOnlyWithTransformation<T1, T2> extends GridSerializableList<T1> {
+    /** */
+    private static final long serialVersionUID = 3126625219739967068L;
+
+    /** */
+    private final IgniteClosure<? super T2, T1> closure;
+
+    /** */
+    private final List<? extends T2> list;
+
+    /**
+     * @param closure closure Transformation closure.
+     * @param list Input list that serves as a base for the view.
+     */
+    public GridSerializableListReadOnlyWithTransformation(IgniteClosure<? super T2, T1> closure,
+        List<? extends T2> list) {
+        this.closure = closure;
+        this.list = list;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T1 get(int idx) {
+        return closure.apply(list.get(idx));
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T1> iterator() {
+        return F.<T2, T1>iterator(list, closure, true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return list.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return list.isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableListReadOnlyWithTransformation.class, this);
+    }
+}


[06/11] ignite git commit: ignite-3682: fixes of notes; refactoring

Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAllPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAllPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAllPredicate.java
new file mode 100644
index 0000000..e829bef
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAllPredicate.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that evaluates to {@code true} if each of its component preds evaluates to {@code true}.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IsAllPredicate<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super T>[] preds;
+
+    /**
+     * @param preds Passed in predicate. If none provided - always-{@code false} predicate is returned.
+     */
+    public IsAllPredicate(IgnitePredicate<? super T>... preds) {
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return GridFunc.isAll(t, preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsAllPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
new file mode 100644
index 0000000..51838e4
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.P1;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Predicate that evaluates to {@code true} if its free variable is instance of the given class.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IsAssignableFromPredicate<T> implements P1<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Class<?> cls;
+
+    /**
+     * @param cls Class to compare to.
+     */
+    public IsAssignableFromPredicate(Class<?> cls) {
+        this.cls = cls;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return t != null && cls.isAssignableFrom(t.getClass());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsAssignableFromPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotAllPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotAllPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotAllPredicate.java
new file mode 100644
index 0000000..ebcb8a9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotAllPredicate.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Negated predicate.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class IsNotAllPredicate<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super T>[] preds;
+
+    /**
+     * @param preds Predicate to negate.
+     */
+    public IsNotAllPredicate(IgnitePredicate<? super T>... preds) {
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return !GridFunc.isAll(t, preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsNotAllPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
new file mode 100644
index 0000000..4d9762d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * IgniteInternalFuture is not done predicate.
+ */
+public class IsNotDonePredicate implements IgnitePredicate<IgniteInternalFuture<?>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(IgniteInternalFuture<?> f) {
+        return !f.isDone();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsNotDonePredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotNullPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotNullPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotNullPredicate.java
new file mode 100644
index 0000000..c67a015
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotNullPredicate.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which checks a parameter on <code>null</code>.
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IsNotNullPredicate<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * @param e Parameter for check.
+     * @return 'true' if parameter NOT equals to <code>null</code>, otherwise 'false'.
+     */
+    @Override public boolean apply(E e) {
+        return e != null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsNotNullPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
new file mode 100644
index 0000000..7972928
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which checks a parameter on <code>null</code>.
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IsNullPredicate<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * @param e Parameter for check.
+     * @return 'true' if parameter equals to <code>null</code>, otherwise 'false'.
+     */
+    @Override public boolean apply(E e) {
+        return e == null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IsNullPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
new file mode 100644
index 0000000..4bf9948
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.LinkedList;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Linked list factory.
+ */
+public class LinkedListFactoryCallable implements IgniteCallable<LinkedList> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public LinkedList call() {
+        return new LinkedList();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(LinkedListFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LongSumReducer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LongSumReducer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LongSumReducer.java
new file mode 100644
index 0000000..8b5d6dc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LongSumReducer.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that calculates sum of long integer elements.
+ */
+public class LongSumReducer implements IgniteReducer<Long, Long> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private AtomicLong sum = new AtomicLong(0);
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(Long e) {
+        if (e != null)
+            sum.addAndGet(e);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Long reduce() {
+        return sum.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(LongSumReducer.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MapFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MapFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MapFactoryCallable.java
new file mode 100644
index 0000000..ff59817
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/MapFactoryCallable.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Hash map factory.
+ */
+public class MapFactoryCallable implements IgniteCallable<Map> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Map call() {
+        return new HashMap();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(MapFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NoOpClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NoOpClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NoOpClosure.java
new file mode 100644
index 0000000..b687a4b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NoOpClosure.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Absolute closure that does nothing.
+ */
+public class NoOpClosure extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(NoOpClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotContainsPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotContainsPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotContainsPredicate.java
new file mode 100644
index 0000000..5f8ba9a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotContainsPredicate.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that returns {@code true} if its free variable is not contained in given collection.
+ *
+ * @param <T> Type of the free variable for the predicate and type of the collection elements.
+ */
+public class NotContainsPredicate<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T> col;
+
+    /**
+     * @param col Collection to check for containment.
+     */
+    public NotContainsPredicate(Collection<? extends T> col) {
+        this.col = col;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        assert col != null;
+
+        return !col.contains(t);
+    }
+
+    /** {@inheritDoc} */
+    public String toString() {
+        return S.toString(NotContainsPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotEqualPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotEqualPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotEqualPredicate.java
new file mode 100644
index 0000000..c84e849
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/NotEqualPredicate.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate that evaluates to {@code true} if its free variable is equal to {@code target} or both are
+ * {@code null}.
+ *
+ * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+ */
+public class NotEqualPredicate<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final T target;
+
+    /**
+     * @param target Object to compare free variable to.
+     */
+    public NotEqualPredicate(T target) {
+        this.target = target;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        return !GridFunc.eq(t, target);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(NotEqualPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateCollectionView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateCollectionView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateCollectionView.java
new file mode 100644
index 0000000..b4785a7
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateCollectionView.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Light-weight view on given col with provided predicate.
+ *
+ * @param <T> Type of the col.
+ */
+public class PredicateCollectionView<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<T> col;
+
+    /** */
+    private final IgnitePredicate<? super T>[] preds;
+
+    /**
+     * @param col Input col that serves as a base for the view.
+     * @param preds Optional preds. If preds are not provided - all elements will be in the view.
+     */
+    public PredicateCollectionView(Collection<T> col, IgnitePredicate<? super T>... preds) {
+        this.col = col;
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean add(T e) {
+        // Pass through (will fail for readonly).
+        return GridFunc.isAll(e, preds) && col.add(e);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T> iterator() {
+        return F.iterator0(col, false, preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.size(col, preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return F.isEmpty(preds) ? col.isEmpty() : !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PredicateCollectionView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateMapView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateMapView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateMapView.java
new file mode 100644
index 0000000..d5b97a6
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateMapView.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the value.
+ */
+public class PredicateMapView<K, V> extends GridSerializableMap<K, V> {
+    /** */
+    private static final long serialVersionUID = 5531745605372387948L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgnitePredicate<? super K>[] preds;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> entryPred;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param preds Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public PredicateMapView(Map<K, V> map, IgnitePredicate<? super K>... preds) {
+        this.map = map;
+        this.preds = preds;
+        this.entryPred = new EntryByKeyEvaluationPredicate(preds);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V>> entrySet() {
+        return new GridSerializableSet<Entry<K, V>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V>> iterator() {
+                return GridFunc.iterator0(map.entrySet(), false, entryPred);
+            }
+
+            @Override public int size() {
+                return F.size(map.keySet(), preds);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPred) && map.entrySet().remove(o);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPred) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V get(Object key) {
+        return GridFunc.isAll((K)key, preds) ? map.get(key) : null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V put(K key, V val) {
+        V oldVal = get(key);
+
+        if (GridFunc.isAll(key, preds))
+            map.put(key, val);
+
+        return oldVal;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, preds) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PredicateMapView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateSetView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateSetView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateSetView.java
new file mode 100644
index 0000000..99fc2fd
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateSetView.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided preds and mapping.
+ *
+ * @param <K> Key type.
+ * @param <V> Value type.
+ */
+public class PredicateSetView<K, V> extends GridSerializableMap<K, V> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Set<K> set;
+
+    /** */
+    private final IgniteClosure<? super K, V> clo;
+
+    /** */
+    private final IgnitePredicate<? super K>[] preds;
+
+    /** Entry predicate. */
+    private IgnitePredicate<K> entryPred;
+
+    /**
+     * @param set Input collection.
+     * @param clo Mapping closure, that maps key to value.
+     * @param preds Optional predicates to filter input collection. If predicates are not provided - all elements
+     * will be in
+     */
+    @SuppressWarnings({"unchecked"})
+    public PredicateSetView(Set<K> set, IgniteClosure<? super K, V> clo,
+        IgnitePredicate<? super K>... preds) {
+        this.set = set;
+        this.clo = clo;
+        this.preds = preds;
+        this.entryPred = new IsAllPredicate(preds);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V>> entrySet() {
+        return new GridSerializableSet<Entry<K, V>>() {
+            @NotNull @Override public Iterator<Entry<K, V>> iterator() {
+                return new Iterator<Entry<K, V>>() {
+
+                    private Iterator<K> it = GridFunc.iterator0(set, true, entryPred);
+
+                    @Override public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override public Entry<K, V> next() {
+                        final K e = it.next();
+
+                        return new Entry<K, V>() {
+                            @Override public K getKey() {
+                                return e;
+                            }
+
+                            @Override public V getValue() {
+                                return clo.apply(e);
+                            }
+
+                            @Override public V setValue(V val) {
+                                throw new UnsupportedOperationException(
+                                    "Put is not supported for readonly collection view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException(
+                            "Remove is not support for readonly collection view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return F.size(set, preds);
+            }
+
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly collection view.");
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V get(Object key) {
+        if (containsKey(key))
+            return clo.apply((K)key);
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V put(K key, V val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly collection view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, preds) && set.contains(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PredicateSetView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView.java
new file mode 100644
index 0000000..8186914
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.GridSerializableIterator;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Collection wrapper.
+ * A read-only view will be created over the element and given
+ * col and no copying will happen.
+ *
+ * @param <T> Element type.
+ */
+public class ReadOnlyCollectionView<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Collection. */
+    private final Collection<T> col;
+
+    /** First element in the col. */
+    private final T elem;
+
+    /**
+     * @param col Collection to wrap.
+     * @param elem First element.
+     */
+    public ReadOnlyCollectionView(@NotNull Collection<T> col, @NotNull T elem) {
+        this.col = col;
+        this.elem = elem;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull
+    @Override public Iterator<T> iterator() {
+        return new GridSerializableIterator<T>() {
+            private Iterator<T> it;
+
+            @Override public boolean hasNext() {
+                return it == null || it.hasNext();
+            }
+
+            @Nullable @Override public T next() {
+                if (it == null) {
+                    it = col.iterator();
+
+                    return elem;
+                }
+
+                return it.next();
+            }
+
+            @Override public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return col.size() + 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object obj) {
+        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection)obj);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ReadOnlyCollectionView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView2X.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView2X.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView2X.java
new file mode 100644
index 0000000..82ec651
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionView2X.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.GridSerializableIterator;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Collections wrapper.
+ * A read-only view will be created over the element and given
+ * collections and no copying will happen.
+ *
+ * @param <T> Element type.
+ */
+public class ReadOnlyCollectionView2X<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** First collection. */
+    private final Collection<T> c1;
+
+    /** SecondCollection. */
+    private final Collection<T> c2;
+
+    /**
+     * @param c1 First collection.
+     * @param c2 SecondCollection.
+     */
+    public ReadOnlyCollectionView2X(Collection<T> c1, Collection<T> c2) {
+        this.c1 = c1;
+        this.c2 = c2;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull
+    @Override public Iterator<T> iterator() {
+        return new GridSerializableIterator<T>() {
+            private Iterator<T> it1 = c1.iterator();
+            private Iterator<T> it2 = c2.iterator();
+
+            @Override public boolean hasNext() {
+                if (it1 != null)
+                    if (!it1.hasNext())
+                        it1 = null;
+                    else
+                        return true;
+
+                return it2.hasNext();
+            }
+
+            @Override public T next() {
+                return it1 != null ? it1.next() : it2.next();
+            }
+
+            @Override public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean contains(Object o) {
+        return c1.contains(o) || c2.contains(o);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return c1.size() + c2.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object obj) {
+        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection<?>)obj);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ReadOnlyCollectionView2X.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/SetFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/SetFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/SetFactoryCallable.java
new file mode 100644
index 0000000..17ac68c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/SetFactoryCallable.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Hash set factory.
+ */
+public class SetFactoryCallable implements IgniteCallable<Set> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Set call() {
+        return new HashSet();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(SetFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/StringConcatReducer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/StringConcatReducer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/StringConcatReducer.java
new file mode 100644
index 0000000..4a2b2a3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/StringConcatReducer.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer that concatenates strings using provided delimiter.
+ */
+public class StringConcatReducer implements IgniteReducer<String, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final String delim;
+
+    /** */
+    private SB sb;
+
+    /** */
+    private boolean first;
+
+    /** */
+    private final Object lock;
+
+    /**
+     * @param delim Delimiter (optional).
+     */
+    public StringConcatReducer(String delim) {
+        this.delim = delim;
+        sb = new SB();
+        first = true;
+        lock = new Object();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(String s) {
+        synchronized (lock) {
+            if (!first && !GridFunc.isEmpty(delim))
+                sb.a(delim);
+
+            sb.a(s);
+
+            first = false;
+        }
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String reduce() {
+        synchronized (lock) {
+            return sb.toString();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(StringConcatReducer.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ToStringClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ToStringClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ToStringClosure.java
new file mode 100644
index 0000000..7cf47cb
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ToStringClosure.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.C1;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Closure that return {@code toString()} value for its free variable.
+ *
+ * @param <T> Type of the free variable for the closure.
+ */
+public class ToStringClosure<T> implements C1<T, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(@Nullable T t) {
+        return String.valueOf(t); // This is null-safe.
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ToStringClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java
new file mode 100644
index 0000000..2c317df
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Light-weight view on given collection with provided predicate.
+ *
+ * @param <T1> Element type after transformation.
+ * @param <T2> Element type.
+ */
+public class TransformCollectionView<T1, T2> extends GridSerializableCollection<T1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T2> col;
+
+    /** */
+    private final IgniteClosure<? super T2, T1> clos;
+
+    /** */
+    private final IgnitePredicate<? super T2>[] preds;
+
+    /**
+     * @param col Input collection that serves as a base for the view.
+     * @param clos Transformation closure.
+     * @param preds Optional predicated. If predicates are not provided - all elements will be in the view.
+     */
+    public TransformCollectionView(Collection<? extends T2> col,
+        IgniteClosure<? super T2, T1> clos, IgnitePredicate<? super T2>... preds) {
+        this.col = col;
+        this.clos = clos;
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T1> iterator() {
+        return F.<T2, T1>iterator(col, clos, true, preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.isEmpty(preds) ? col.size() : F.size(iterator());
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return F.isEmpty(preds) ? col.isEmpty() : !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(TransformCollectionView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformFilteringIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformFilteringIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformFilteringIterator.java
new file mode 100644
index 0000000..9ddd729
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformFilteringIterator.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Iterator from given iter and optional filtering predicate.
+ */
+public class TransformFilteringIterator<T2, T1> extends GridIteratorAdapter<T2> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgniteClosure<? super T1, T2> clos;
+
+    /** */
+    private final boolean readOnly;
+
+    /** */
+    private final IgnitePredicate<? super T1>[] preds;
+
+    /** */
+    private T1 elem;
+
+    /** */
+    private boolean more;
+
+    /** */
+    private boolean moved;
+
+    /** */
+    private Iterator<? extends T1> iter;
+
+    /**
+     * @param iter Input iter.
+     * @param clos Transforming closure to convert from T1 to T2.
+     * @param readOnly If {@code true}, then resulting iter will not allow modifications to the underlying
+     * collection.
+     * @param preds Optional filtering predicates.
+     */
+    public TransformFilteringIterator(Iterator<? extends T1> iter, IgniteClosure<? super T1, T2> clos,
+        boolean readOnly,
+        IgnitePredicate<? super T1>... preds) {
+        this.clos = clos;
+        this.readOnly = readOnly;
+        this.preds = preds;
+        this.iter = iter;
+        this.moved = true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasNextX() {
+        if (GridFunc.isEmpty(preds))
+            return iter.hasNext();
+        else {
+            if (!moved)
+                return more;
+            else {
+                more = false;
+
+                while (iter.hasNext()) {
+                    elem = iter.next();
+
+                    boolean isAll = true;
+
+                    for (IgnitePredicate<? super T1> r : preds)
+                        if (r != null && !r.apply(elem)) {
+                            isAll = false;
+
+                            break;
+                        }
+
+                    if (isAll) {
+                        more = true;
+                        moved = false;
+
+                        return true;
+                    }
+                }
+
+                elem = null; // Give to GC.
+
+                return false;
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public T2 nextX() {
+        if (GridFunc.isEmpty(preds))
+            return clos.apply(iter.next());
+        else {
+            if (hasNext()) {
+                moved = true;
+
+                return clos.apply(elem);
+            }
+            else
+                throw new NoSuchElementException();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void removeX() {
+        if (readOnly)
+            throw new UnsupportedOperationException("Cannot modify read-only iter.");
+
+        iter.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(TransformFilteringIterator.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java
new file mode 100644
index 0000000..91b8302
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate and clos.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the input map value.
+ * @param <V1> Type of the output map value.
+ */
+public class TransformMapView<K, V1, V> extends GridSerializableMap<K, V1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgniteClosure<V, V1> clos;
+
+    /** */
+    private final boolean hasPred;
+
+    /** */
+    private final IgnitePredicate<? super K>[] preds;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> entryPred;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param clos Transformer for map value transformation.
+     * @param preds Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public TransformMapView(Map<K, V> map, IgniteClosure<V, V1> clos,
+        IgnitePredicate<? super K>... preds) {
+        this.map = map;
+        this.clos = clos;
+        this.hasPred = (preds != null && preds.length > 0);
+        this.preds = preds;
+        this.entryPred = new EntryByKeyEvaluationPredicate(preds);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
+        return new GridSerializableSet<Entry<K, V1>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V1>> iterator() {
+                return new Iterator<Entry<K, V1>>() {
+                    private Iterator<Entry<K, V>> iter = GridFunc.iterator0(map.entrySet(), true, entryPred);
+
+                    @Override public boolean hasNext() {
+                        return iter.hasNext();
+                    }
+
+                    @Override public Entry<K, V1> next() {
+                        final Entry<K, V> e = iter.next();
+
+                        return new Entry<K, V1>() {
+                            @Override public K getKey() {
+                                return e.getKey();
+                            }
+
+                            @Override public V1 getValue() {
+                                return clos.apply(e.getValue());
+                            }
+
+                            @Override public V1 setValue(V1 val) {
+                                throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return hasPred ? F.size(map.keySet(), preds) : map.size();
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPred) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return hasPred ? !iterator().hasNext() : map.isEmpty();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return hasPred ? entrySet().isEmpty() : map.isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V1 get(Object key) {
+        if (GridFunc.isAll((K)key, preds)) {
+            V v = map.get(key);
+
+            if (v != null)
+                return clos.apply(v);
+        }
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V1 put(K key, V1 val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V1 remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, preds) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(TransformMapView.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView2.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView2.java
new file mode 100644
index 0000000..523d4cc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView2.java
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteBiClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate and clos.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the input map value.
+ * @param <V1> Type of the output map value.
+ */
+public class TransformMapView2<K, V, V1> extends GridSerializableMap<K, V1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgniteBiClosure<K, V, V1> clos;
+
+    /** */
+    private final IgnitePredicate<? super K>[] preds;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> entryPred;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param clos Transformer for map value transformation.
+     * @param preds Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public TransformMapView2(Map<K, V> map, IgniteBiClosure<K, V, V1> clos,
+        IgnitePredicate<? super K>... preds) {
+        this.map = map;
+        this.clos = clos;
+        this.preds = preds;
+        entryPred = new EntryByKeyEvaluationPredicate(preds);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
+        return new GridSerializableSet<Entry<K, V1>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V1>> iterator() {
+                return new Iterator<Entry<K, V1>>() {
+                    private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, entryPred);
+
+                    @Override public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override public Entry<K, V1> next() {
+                        final Entry<K, V> e = it.next();
+
+                        return new Entry<K, V1>() {
+                            @Override public K getKey() {
+                                return e.getKey();
+                            }
+
+                            @Override public V1 getValue() {
+                                return clos.apply(e.getKey(), e.getValue());
+                            }
+
+                            @Override public V1 setValue(V1 val) {
+                                throw new UnsupportedOperationException(
+                                    "Put is not supported for readonly map view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return F.size(map.keySet(), preds);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPred) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V1 get(Object key) {
+        if (GridFunc.isAll((K)key, preds)) {
+            V v = map.get(key);
+
+            if (v != null)
+                return clos.apply((K)key, v);
+        }
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V1 put(K key, V1 val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V1 remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, preds) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(TransformMapView2.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
new file mode 100644
index 0000000..dcf165b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * UUID to ID8 transformer closure.
+ */
+public class UuidToId8Closure implements IgniteClosure<UUID, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(UUID id) {
+        return U.id8(id);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(UuidToId8Closure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
index 6b745ab..68d6bf1 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
@@ -454,8 +454,6 @@ public abstract class GridIndexingSpiAbstractSelfTest extends GridCommonAbstract
 
             String res = log.toString();
 
-            F.println(res);
-
             assertTrue(res.contains("/* PUBLIC.RANGE_INDEX */"));
         }
         finally {


[09/11] ignite git commit: ignite-3682: fixes of notes; refactoring

Posted by ag...@apache.org.
ignite-3682: fixes of notes; refactoring


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

Branch: refs/heads/master
Commit: a3f845b048fd9cadc8d1c722060447e5cc98ef23
Parents: 9165b0d
Author: daradurvs <da...@gmail.com>
Authored: Thu Mar 30 23:36:25 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Mon Apr 10 19:39:06 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 288 ++++++++++---------
 .../lang/gridfunc/AlwaysFalsePredicate.java     |  46 +++
 .../util/lang/gridfunc/AlwaysTruePredicate.java |  46 +++
 .../util/lang/gridfunc/AlwaysTrueReducer.java   |  56 ++++
 .../lang/gridfunc/ArrayListFactoryCallable.java |  41 +++
 .../gridfunc/AtomicBooleanFactoryCallable.java  |  40 +++
 .../gridfunc/AtomicIntegerFactoryCallable.java  |  40 +++
 .../gridfunc/AtomicLongFactoryCallable.java     |  40 +++
 .../AtomicReferenceFactoryCallable.java         |  40 +++
 .../lang/gridfunc/CacheEntryGetKeyClosure.java  |  40 +++
 .../gridfunc/CacheEntryGetValueClosure.java     |  42 +++
 .../gridfunc/CacheEntryHasPeekPredicate.java    |  41 +++
 .../lang/gridfunc/ClusterNodeGetId8Closure.java |  41 +++
 .../lang/gridfunc/ClusterNodeGetIdClosure.java  |  41 +++
 .../ConcurrentDequeFactoryCallable.java         |  40 +++
 .../ConcurrentHashSetFactoryCallable.java       |  40 +++
 .../gridfunc/ConcurrentMapFactoryCallable.java  |  41 +++
 .../lang/gridfunc/ContainsNodeIdsPredicate.java |  52 ++++
 .../util/lang/gridfunc/ContainsPredicate.java   |  55 ++++
 .../gridfunc/EntryByKeyEvaluationPredicate.java |  53 ++++
 .../EntryByValueEvaluationPredicate.java        |  53 ++++
 .../gridfunc/EqualsClusterNodeIdPredicate.java  |  51 ++++
 .../util/lang/gridfunc/EqualsUuidPredicate.java |  50 ++++
 .../lang/gridfunc/FlatCollectionWrapper.java    |  66 +++++
 .../util/lang/gridfunc/FlatIterator.java        | 102 +++++++
 .../gridfunc/GridAbsClosureNoOperation.java     |  39 ---
 .../util/lang/gridfunc/GridAbsClosurePrint.java |  49 ----
 .../gridfunc/GridAbsClosureRunnableWrapper.java |  51 ----
 .../lang/gridfunc/GridAbsClosureWrapper.java    |  57 ----
 ...IteratorAdapterClosurePredicatesWrapper.java | 138 ---------
 .../gridfunc/GridIteratorAdapterWrapper.java    | 100 -------
 ...GridIteratorOverInnerCollectionsAdapter.java | 100 -------
 ...dSerializableCollectionPredicateWrapper.java |  78 -----
 .../GridSerializableCollectionWrapper.java      |  66 -----
 ...ializableListReadOnlyWithTransformation.java |  78 -----
 ...alizableMapPredicatesTransformerWrapper.java | 168 -----------
 .../GridSerializableMapPredicatesWrapper.java   | 121 --------
 ...zableMapReadOnlyClosurePredicateWrapper.java | 165 -----------
 ...SerializableMapReadOnlyPredicateWrapper.java | 153 ----------
 ...zableReadOnlyCollectionPredicateWrapper.java |  79 -----
 ...idSerializableReadOnlyCollectionWrapper.java |  95 ------
 ...rializableReadOnlyTwoCollectionsWrapper.java | 100 -------
 .../util/lang/gridfunc/HasEqualIdPredicate.java |  51 ++++
 .../lang/gridfunc/HasNotEqualIdPredicate.java   |  51 ++++
 .../util/lang/gridfunc/IdentityClosure.java     |  39 +++
 .../IgniteCallableArrayListFactory.java         |  41 ---
 .../IgniteCallableAtomicBooleanFactory.java     |  40 ---
 .../IgniteCallableAtomicIntegerFactory.java     |  40 ---
 .../IgniteCallableAtomicLongFactory.java        |  40 ---
 .../IgniteCallableAtomicReferenceFactory.java   |  40 ---
 .../IgniteCallableConcurrentHashMapFactory.java |  41 ---
 .../IgniteCallableConcurrentHashSetFactory.java |  40 ---
 .../gridfunc/IgniteCallableDequeFactory.java    |  40 ---
 .../gridfunc/IgniteCallableHashMapFactory.java  |  41 ---
 .../gridfunc/IgniteCallableHashSetFactory.java  |  41 ---
 .../IgniteCallableLinkedListFactory.java        |  40 ---
 .../lang/gridfunc/IgniteClosureCacheGet.java    |  42 ---
 .../lang/gridfunc/IgniteClosureCacheGetKey.java |  40 ---
 .../gridfunc/IgniteClosureClusterNodeGetId.java |  41 ---
 .../IgniteClosureClusterNodeGetId8.java         |  41 ---
 .../lang/gridfunc/IgniteClosureIdentity.java    |  39 ---
 .../lang/gridfunc/IgniteClosureToString.java    |  42 ---
 .../IgniteClosureUUIDToId8Transformer.java      |  41 ---
 .../lang/gridfunc/IgniteOutClosureWrapper.java  |  58 ----
 .../gridfunc/IgnitePredicateAlwaysFalse.java    |  46 ---
 .../gridfunc/IgnitePredicateAlwaysTrue.java     |  46 ---
 .../gridfunc/IgnitePredicateCacheHasPeek.java   |  41 ---
 .../gridfunc/IgnitePredicateContainNodeId.java  |  52 ----
 .../gridfunc/IgnitePredicateContainWrapper.java |  55 ----
 .../IgnitePredicateEqualsClusterNodeId.java     |  51 ----
 .../gridfunc/IgnitePredicateEqualsUUID.java     |  50 ----
 .../IgnitePredicateEvaluateEntryByKey.java      |  53 ----
 .../IgnitePredicateEvaluateEntryByValue.java    |  53 ----
 .../gridfunc/IgnitePredicateHasEqualId.java     |  51 ----
 .../gridfunc/IgnitePredicateHasNotEqualId.java  |  51 ----
 .../IgnitePredicateIgniteFutureIsNotDone.java   |  40 ---
 .../lang/gridfunc/IgnitePredicateIsAll.java     |  52 ----
 .../IgnitePredicateIsAssignableFrom.java        |  51 ----
 .../lang/gridfunc/IgnitePredicateIsNotAll.java  |  52 ----
 .../lang/gridfunc/IgnitePredicateIsNull.java    |  44 ---
 .../IgnitePredicateNotContainWrapper.java       |  54 ----
 .../lang/gridfunc/IgnitePredicateNotEqual.java  |  53 ----
 .../lang/gridfunc/IgnitePredicateNotNull.java   |  44 ---
 .../lang/gridfunc/IgniteReducerAlwaysTrue.java  |  56 ----
 .../util/lang/gridfunc/IgniteReducerIntSum.java |  51 ----
 .../lang/gridfunc/IgniteReducerLongSum.java     |  51 ----
 .../gridfunc/IgniteReducerStringConcat.java     |  79 -----
 .../util/lang/gridfunc/IntSumReducer.java       |  51 ++++
 .../util/lang/gridfunc/IsAllPredicate.java      |  52 ++++
 .../gridfunc/IsAssignableFromPredicate.java     |  51 ++++
 .../util/lang/gridfunc/IsNotAllPredicate.java   |  52 ++++
 .../util/lang/gridfunc/IsNotDonePredicate.java  |  40 +++
 .../util/lang/gridfunc/IsNotNullPredicate.java  |  44 +++
 .../util/lang/gridfunc/IsNullPredicate.java     |  44 +++
 .../gridfunc/LinkedListFactoryCallable.java     |  40 +++
 .../util/lang/gridfunc/LongSumReducer.java      |  51 ++++
 .../util/lang/gridfunc/MapFactoryCallable.java  |  41 +++
 .../util/lang/gridfunc/NoOpClosure.java         |  39 +++
 .../lang/gridfunc/NotContainsPredicate.java     |  54 ++++
 .../util/lang/gridfunc/NotEqualPredicate.java   |  53 ++++
 .../lang/gridfunc/PredicateCollectionView.java  |  78 +++++
 .../util/lang/gridfunc/PredicateMapView.java    | 121 ++++++++
 .../util/lang/gridfunc/PredicateSetView.java    | 153 ++++++++++
 .../lang/gridfunc/ReadOnlyCollectionView.java   |  95 ++++++
 .../lang/gridfunc/ReadOnlyCollectionView2X.java | 100 +++++++
 .../util/lang/gridfunc/SetFactoryCallable.java  |  41 +++
 .../util/lang/gridfunc/StringConcatReducer.java |  79 +++++
 .../util/lang/gridfunc/ToStringClosure.java     |  42 +++
 .../lang/gridfunc/TransformCollectionView.java  |  79 +++++
 .../gridfunc/TransformFilteringIterator.java    | 138 +++++++++
 .../util/lang/gridfunc/TransformMapView.java    | 168 +++++++++++
 .../util/lang/gridfunc/TransformMapView2.java   | 165 +++++++++++
 .../util/lang/gridfunc/UuidToId8Closure.java    |  41 +++
 .../h2/GridIndexingSpiAbstractSelfTest.java     |   2 -
 114 files changed, 3368 insertions(+), 3733 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/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 d246ee3..71ff014 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
@@ -45,58 +45,60 @@ import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.GridLeanSet;
-import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureNoOperation;
-import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosurePrint;
-import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureRunnableWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridAbsClosureWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorAdapterClosurePredicatesWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorOverInnerCollectionsAdapter;
-import org.apache.ignite.internal.util.lang.gridfunc.GridIteratorAdapterWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableCollectionPredicateWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyCollectionPredicateWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableCollectionWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapPredicatesTransformerWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapPredicatesWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapReadOnlyClosurePredicateWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableMapReadOnlyPredicateWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyCollectionWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.GridSerializableReadOnlyTwoCollectionsWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableArrayListFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableAtomicIntegerFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableConcurrentHashMapFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableConcurrentHashSetFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableDequeFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableHashMapFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableHashSetFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteCallableLinkedListFactory;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureCacheGet;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureCacheGetKey;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureClusterNodeGetId;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureClusterNodeGetId8;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureIdentity;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureToString;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteClosureUUIDToId8Transformer;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsAll;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateAlwaysFalse;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateAlwaysTrue;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateCacheHasPeek;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateContainNodeId;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateContainWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateEqualsClusterNodeId;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateEqualsUUID;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateHasEqualId;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateHasNotEqualId;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIgniteFutureIsNotDone;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsNotAll;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateIsNull;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotContainWrapper;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotEqual;
-import org.apache.ignite.internal.util.lang.gridfunc.IgnitePredicateNotNull;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerAlwaysTrue;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerIntSum;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerLongSum;
-import org.apache.ignite.internal.util.lang.gridfunc.IgniteReducerStringConcat;
+import org.apache.ignite.internal.util.lang.gridfunc.AlwaysFalsePredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.AlwaysTruePredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.AlwaysTrueReducer;
+import org.apache.ignite.internal.util.lang.gridfunc.ArrayListFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.AtomicBooleanFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.AtomicIntegerFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.AtomicLongFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.AtomicReferenceFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetValueClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetKeyClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryHasPeekPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetId8Closure;
+import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetIdClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentDequeFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentHashSetFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentMapFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.ContainsNodeIdsPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.ContainsPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.EntryByKeyEvaluationPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.EntryByValueEvaluationPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.EqualsClusterNodeIdPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.EqualsUuidPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.FlatCollectionWrapper;
+import org.apache.ignite.internal.util.lang.gridfunc.FlatIterator;
+import org.apache.ignite.internal.util.lang.gridfunc.HasEqualIdPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.HasNotEqualIdPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IdentityClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.IntSumReducer;
+import org.apache.ignite.internal.util.lang.gridfunc.IsAllPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IsAssignableFromPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IsNotAllPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IsNotDonePredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IsNotNullPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.IsNullPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.LinkedListFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.LongSumReducer;
+import org.apache.ignite.internal.util.lang.gridfunc.MapFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.MultipleIterator;
+import org.apache.ignite.internal.util.lang.gridfunc.NoOpClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.NotContainsPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.NotEqualPredicate;
+import org.apache.ignite.internal.util.lang.gridfunc.PredicateCollectionView;
+import org.apache.ignite.internal.util.lang.gridfunc.PredicateMapView;
+import org.apache.ignite.internal.util.lang.gridfunc.PredicateSetView;
+import org.apache.ignite.internal.util.lang.gridfunc.ReadOnlyCollectionView;
+import org.apache.ignite.internal.util.lang.gridfunc.ReadOnlyCollectionView2X;
+import org.apache.ignite.internal.util.lang.gridfunc.SetFactoryCallable;
+import org.apache.ignite.internal.util.lang.gridfunc.StringConcatReducer;
+import org.apache.ignite.internal.util.lang.gridfunc.ToStringClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.TransformCollectionView;
+import org.apache.ignite.internal.util.lang.gridfunc.TransformFilteringIterator;
+import org.apache.ignite.internal.util.lang.gridfunc.TransformMapView;
+import org.apache.ignite.internal.util.lang.gridfunc.TransformMapView2;
+import org.apache.ignite.internal.util.lang.gridfunc.UuidToId8Closure;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -132,64 +134,64 @@ import org.jsr166.ThreadLocalRandom8;
 @SuppressWarnings("unchecked")
 public class GridFunc {
     /** */
-    private static final GridAbsClosure NOOP = new GridAbsClosureNoOperation();
+    private static final GridAbsClosure NOOP = new NoOpClosure();
 
     /** */
-    private static final IgniteClosure IDENTITY = new IgniteClosureIdentity();
+    private static final IgniteClosure IDENTITY = new IdentityClosure();
 
     /** */
-    private static final IgnitePredicate<Object> ALWAYS_TRUE = new IgnitePredicateAlwaysTrue<>();
+    private static final IgnitePredicate<Object> ALWAYS_TRUE = new AlwaysTruePredicate<>();
 
     /** */
-    private static final IgnitePredicate<Object> ALWAYS_FALSE = new IgnitePredicateAlwaysFalse<>();
+    private static final IgnitePredicate<Object> ALWAYS_FALSE = new AlwaysFalsePredicate<>();
 
     /** */
-    private static final IgniteCallable<?> DEQUE_FACTORY = new IgniteCallableDequeFactory();
+    private static final IgniteCallable<?> DEQUE_FACTORY = new ConcurrentDequeFactoryCallable();
 
     /** */
-    private static final IgnitePredicate<Object> IS_NOT_NULL = new IgnitePredicateNotNull();
+    private static final IgnitePredicate<Object> IS_NOT_NULL = new IsNotNullPredicate();
 
     /** */
-    private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallableArrayListFactory();
+    private static final IgniteCallable<?> LIST_FACTORY = new ArrayListFactoryCallable();
 
     /** */
-    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new IgniteCallableLinkedListFactory();
+    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new LinkedListFactoryCallable();
 
     /** */
-    private static final IgniteCallable<?> SET_FACTORY = new IgniteCallableHashSetFactory();
+    private static final IgniteCallable<?> SET_FACTORY = new SetFactoryCallable();
 
     /** */
-    private static final IgniteCallable<AtomicInteger> ATOMIC_INT_FACTORY = new IgniteCallableAtomicIntegerFactory();
+    private static final IgniteCallable<AtomicInteger> ATOMIC_INT_FACTORY = new AtomicIntegerFactoryCallable();
 
     /** */
-    private static final IgniteCallable<?> MAP_FACTORY = new IgniteCallableHashMapFactory();
+    private static final IgniteCallable<?> MAP_FACTORY = new MapFactoryCallable();
 
     /** */
-    private static final IgniteCallable<?> CONCURRENT_MAP_FACTORY = new IgniteCallableConcurrentHashMapFactory();
+    private static final IgniteCallable<?> CONCURRENT_MAP_FACTORY = new ConcurrentMapFactoryCallable();
 
     /** */
-    private static final IgniteCallable<?> CONCURRENT_SET_FACTORY = new IgniteCallableConcurrentHashSetFactory();
+    private static final IgniteCallable<?> CONCURRENT_SET_FACTORY = new ConcurrentHashSetFactoryCallable();
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosureCacheGetKey();
+    private static final IgniteClosure CACHE_ENTRY_KEY = new CacheEntryGetKeyClosure();
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosureCacheGet();
+    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new CacheEntryGetValueClosure();
 
     /** */
-    private static final IgnitePredicate CACHE_ENTRY_HAS_PEEK_VAL = new IgnitePredicateCacheHasPeek();
+    private static final IgnitePredicate CACHE_ENTRY_HAS_PEEK_VAL = new CacheEntryHasPeekPredicate();
 
     /** */
-    private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosureClusterNodeGetId();
+    private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new ClusterNodeGetIdClosure();
 
     /** */
-    private static final IgniteClosure<ClusterNode, String> NODE2ID8 = new IgniteClosureClusterNodeGetId8();
+    private static final IgniteClosure<ClusterNode, String> NODE2ID8 = new ClusterNodeGetId8Closure();
 
     /** */
-    private static final IgniteClosure<UUID, String> ID2ID8 = new IgniteClosureUUIDToId8Transformer();
+    private static final IgniteClosure<UUID, String> ID2ID8 = new UuidToId8Closure();
 
     /** */
-    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IgnitePredicateIgniteFutureIsNotDone();
+    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IsNotDonePredicate();
 
     /**
      * Gets predicate that evaluates to {@code true} only for given local node ID.
@@ -199,7 +201,7 @@ public class GridFunc {
      * @return Return {@code true} only for the node with given local node ID.
      */
     public static <T extends ClusterNode> IgnitePredicate<T> localNode(final UUID locNodeId) {
-        return new IgnitePredicateHasEqualId<>(locNodeId);
+        return new HasEqualIdPredicate<>(locNodeId);
     }
 
     /**
@@ -210,7 +212,7 @@ public class GridFunc {
      * @return Return {@code false} for the given local node ID.
      */
     public static <T extends ClusterNode> IgnitePredicate<T> remoteNodes(final UUID locNodeId) {
-        return new IgnitePredicateHasNotEqualId<>(locNodeId);
+        return new HasNotEqualIdPredicate<>(locNodeId);
     }
 
     /**
@@ -259,7 +261,7 @@ public class GridFunc {
      * @return Passed in element.
      */
     public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
-        return new IgniteReducerAlwaysTrue<>(elem);
+        return new AlwaysTrueReducer<>(elem);
     }
 
     /**
@@ -271,7 +273,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<Integer, Integer> sumIntReducer() {
-        return new IgniteReducerIntSum();
+        return new IntSumReducer();
     }
 
     /**
@@ -283,7 +285,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<Long, Long> sumLongReducer() {
-        return new IgniteReducerLongSum();
+        return new LongSumReducer();
     }
 
     /**
@@ -318,7 +320,7 @@ public class GridFunc {
      */
     @Deprecated
     public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
-        return new IgniteReducerStringConcat(delim);
+        return new StringConcatReducer(delim);
     }
 
     /**
@@ -352,14 +354,40 @@ public class GridFunc {
     }
 
     /**
-     * Creates absolute closure that does <tt>System.out.println(msg)</tt>.
+     * Convenient utility method that returns collection of node ID8s for a given
+     * collection of grid nodes. ID8 is a shorter string representation of node ID,
+     * mainly the first 8 characters.
+     * <p>
+     * Note that this method doesn't create a new collection but simply iterates
+     * over the input one.
+     *
+     * @param nodes Collection of grid nodes.
+     * @return Collection of node IDs for given collection of grid nodes.
+     */
+    public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
+        if (nodes == null || nodes.isEmpty())
+            return Collections.emptyList();
+
+        return F.viewReadOnly(nodes, NODE2ID8);
+    }
+
+    /**
+     * Convenient utility method that returns collection of node ID8s for a given
+     * collection of node IDs. ID8 is a shorter string representation of node ID,
+     * mainly the first 8 characters.
+     * <p>
+     * Note that this method doesn't create a new collection but simply iterates
+     * over the input one.
      *
-     * @param msg Message to print.
-     * @return Absolute closure that print message.
+     * @param ids Collection of nodeIds.
+     * @return Collection of node IDs for given collection of grid nodes.
      */
     @Deprecated
-    public static GridAbsClosure println(final String msg) {
-        return new GridAbsClosurePrint(msg);
+    public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
+        if (ids == null || ids.isEmpty())
+            return Collections.emptyList();
+
+        return F.viewReadOnly(ids, ID2ID8);
     }
 
     /**
@@ -449,7 +477,7 @@ public class GridFunc {
             if (isEmpty(c))
                 return Collections.singletonList(t);
 
-            return new GridSerializableReadOnlyCollectionWrapper<>(c, t);
+            return new ReadOnlyCollectionView<>(c, t);
         }
     }
 
@@ -498,7 +526,7 @@ public class GridFunc {
                 return c;
             }
 
-            return new GridSerializableReadOnlyTwoCollectionsWrapper<>(c1, c2);
+            return new ReadOnlyCollectionView2X<>(c1, c2);
         }
     }
 
@@ -740,7 +768,7 @@ public class GridFunc {
     public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeId(final UUID nodeId) {
         A.notNull(nodeId, "nodeId");
 
-        return new IgnitePredicateEqualsClusterNodeId<>(nodeId);
+        return new EqualsClusterNodeIdPredicate<>(nodeId);
     }
 
     /**
@@ -756,7 +784,7 @@ public class GridFunc {
         if (isEmpty(nodeIds))
             return alwaysFalse();
 
-        return new IgnitePredicateContainNodeId<>(nodeIds);
+        return new ContainsNodeIdsPredicate<>(nodeIds);
     }
 
     /**
@@ -770,7 +798,7 @@ public class GridFunc {
     public static IgnitePredicate<UUID> idForNodeId(final UUID nodeId) {
         A.notNull(nodeId, "nodeId");
 
-        return new IgnitePredicateEqualsUUID(nodeId);
+        return new EqualsUuidPredicate(nodeId);
     }
 
     /**
@@ -867,19 +895,6 @@ public class GridFunc {
     }
 
     /**
-     * Curries given closure.
-     *
-     * @param f Closure.
-     * @param e Parameter.
-     * @param <T> Input type.
-     * @return Curried closure.
-     */
-    @Deprecated
-    public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
-        return new GridAbsClosureWrapper<>(f, e);
-    }
-
-    /**
      * Converts array to {@link List}. Note that resulting list cannot
      * be altered in size, as it it based on the passed in array -
      * only current elements can be changed.
@@ -926,7 +941,7 @@ public class GridFunc {
         if (F.isEmpty(c))
             return Collections.emptyList();
 
-        return new GridSerializableCollectionWrapper<>(c);
+        return new FlatCollectionWrapper<>(c);
     }
 
     /**
@@ -939,7 +954,7 @@ public class GridFunc {
      * @return Iterable over the elements of the inner collections.
      */
     public static <T> GridIterator<T> flat(@Nullable final Iterable<? extends Iterable<T>> c) {
-        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorOverInnerCollectionsAdapter<>(c);
+        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new FlatIterator<T>(c);
     }
 
     /**
@@ -951,18 +966,7 @@ public class GridFunc {
      * @return Iterator over the elements of given iterators.
      */
     public static <T> Iterator<T> flatIterators(@Nullable final Iterable<Iterator<T>> c) {
-        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapterWrapper<>(c);
-    }
-
-    /**
-     * Converts given runnable to an absolute closure.
-     *
-     * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
-     * @return Closure that wraps given runnable. Note that wrapping closure always returns {@code null}.
-     */
-    @Deprecated
-    public static GridAbsClosure as(@Nullable final Runnable r) {
-        return new GridAbsClosureRunnableWrapper(r);
+        return isEmpty(c) ? GridFunc.<T>emptyIterator() : new FlatIterator<T>(c);
     }
 
     /**
@@ -1022,7 +1026,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? c : new GridSerializableCollectionPredicateWrapper<>(c, p);
+        return isEmpty(p) || isAlwaysTrue(p) ? c : new PredicateCollectionView<>(c, p);
     }
 
     /**
@@ -1048,7 +1052,31 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        return new GridSerializableReadOnlyCollectionPredicateWrapper<T2, T1>(c, trans, p);
+        assert c != null;
+
+        return new TransformCollectionView<T2, T1>(c, trans, p);
+    }
+
+    /**
+     * Creates a view on given list with provided transformer and predicates.
+     * Resulting list will only "have" elements for which all provided predicates, if any,
+     * evaluate to {@code true}. Note that a new collection will be created and data will
+     * be copied.
+     *
+     * @param c Input list that serves as a base for the view.
+     * @param trans Transforming closure from T1 to T2.
+     * @param p Optional predicates. If predicates are not provided - all elements will be in the view.
+     * @return View on given list with provided predicate.
+     */
+    @Deprecated
+    public static <T1, T2> List<T2> transformList(Collection<? extends T1> c,
+        IgniteClosure<? super T1, T2> trans, @Nullable IgnitePredicate<? super T1>... p) {
+        A.notNull(c, "c", trans, "trans");
+
+        if (isAlwaysFalse(p))
+            return Collections.emptyList();
+
+        return new ArrayList<>(transform(retain(c, true, p), trans));
     }
 
     /**
@@ -1069,7 +1097,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? m : new GridSerializableMapPredicatesWrapper<K, V>(m, p);
+        return isEmpty(p) || isAlwaysTrue(p) ? m : new PredicateMapView<K, V>(m, p);
     }
 
     /**
@@ -1096,7 +1124,7 @@ public class GridFunc {
 
         assert m != null;
 
-        return new GridSerializableMapPredicatesTransformerWrapper<K, V1, V>(m, trans, p);
+        return new TransformMapView<K, V1, V>(m, trans, p);
     }
 
     /**
@@ -1122,7 +1150,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new GridSerializableMapReadOnlyClosurePredicateWrapper<K, V, V1>(m, trans, p);
+        return new TransformMapView2<K, V, V1>(m, trans, p);
     }
 
     /**
@@ -1149,7 +1177,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new GridSerializableMapReadOnlyPredicateWrapper<K, V>(c, mapClo, p);
+        return new PredicateSetView<K, V>(c, mapClo, p);
     }
 
     /**
@@ -1373,7 +1401,7 @@ public class GridFunc {
         if (isAlwaysFalse(p))
             return F.emptyIterator();
 
-        return new GridIteratorAdapterClosurePredicatesWrapper<>(c.iterator(), trans, readOnly, p);
+        return new TransformFilteringIterator<>(c.iterator(), trans, readOnly, p);
     }
 
     /**
@@ -1394,7 +1422,7 @@ public class GridFunc {
         if (isAlwaysFalse(p))
             return F.emptyIterator();
 
-        return new GridIteratorAdapterClosurePredicatesWrapper<>(c, trans, readOnly, p);
+        return new TransformFilteringIterator<>(c, trans, readOnly, p);
     }
 
     /**
@@ -1491,7 +1519,7 @@ public class GridFunc {
      */
     @SafeVarargs
     public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
-        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new IgnitePredicateIsNotAll<>(p);
+        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new IsNotAllPredicate<>(p);
     }
 
     /**
@@ -1505,7 +1533,7 @@ public class GridFunc {
      */
     @Deprecated
     public static <T> IgnitePredicate<T> equalTo(@Nullable final T target) {
-        return new IgnitePredicateNotEqual<>(target);
+        return new NotEqualPredicate<>(target);
     }
 
     /**
@@ -1518,7 +1546,7 @@ public class GridFunc {
      *      to {@code target} or both are {@code null}.
      */
     public static <T> IgnitePredicate<T> notEqualTo(@Nullable final T target) {
-        return new IgnitePredicateNotEqual<>(target);
+        return new NotEqualPredicate<>(target);
     }
 
     /**
@@ -1667,7 +1695,7 @@ public class GridFunc {
             return (IgnitePredicate<T>)new GridNodePredicate(ids);
         }
         else
-            return new IgnitePredicateIsAll<>(ps);
+            return new IsAllPredicate<>(ps);
     }
 
     /**
@@ -1689,7 +1717,7 @@ public class GridFunc {
      */
     @Deprecated
     public static <T> IgniteClosure<T, String> string() {
-        return new IgniteClosureToString<>();
+        return new ToStringClosure<>();
     }
 
     /**
@@ -1703,7 +1731,7 @@ public class GridFunc {
      *      contained in given collection.
      */
     public static <T> IgnitePredicate<T> notIn(@Nullable final Collection<? extends T> c) {
-        return isEmpty(c) ? GridFunc.<T>alwaysTrue() : new IgnitePredicateNotContainWrapper<>(c);
+        return isEmpty(c) ? GridFunc.<T>alwaysTrue() : new NotContainsPredicate<>(c);
     }
 
     /**
@@ -2790,7 +2818,7 @@ public class GridFunc {
      *  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 IgnitePredicateContainWrapper(c);
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysFalse() : new ContainsPredicate(c);
     }
 
     /**
@@ -2803,7 +2831,7 @@ public class GridFunc {
      *  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 IgnitePredicateNotContainWrapper(c);
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysTrue() : new NotContainsPredicate(c);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
new file mode 100644
index 0000000..6e1dbb5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which accepts a parameter and always returns {@code false}
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class AlwaysFalsePredicate<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Predicate body.
+     *
+     * @param e Predicate parameter.
+     * @return Always <code>false</code>
+     */
+    @Override public boolean apply(E e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AlwaysFalsePredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTruePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTruePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTruePredicate.java
new file mode 100644
index 0000000..e675820
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTruePredicate.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which accepts a parameter and always returns {@code true}
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class AlwaysTruePredicate<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 6101914246981105862L;
+
+    /**
+     * Predicate body.
+     *
+     * @param e Predicate parameter.
+     * @return Always <code>true</code>.
+     */
+    @Override public boolean apply(E e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AlwaysTruePredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTrueReducer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTrueReducer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTrueReducer.java
new file mode 100644
index 0000000..70ab566
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysTrueReducer.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteReducer;
+
+/**
+ * Reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
+ *
+ * @param <T> Reducer element type.
+ */
+public class AlwaysTrueReducer<T> implements IgniteReducer<T, T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final T elem;
+
+    /**
+     * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+     */
+    public AlwaysTrueReducer(T elem) {
+        this.elem = elem;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean collect(T e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T reduce() {
+        return elem;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AlwaysTrueReducer.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
new file mode 100644
index 0000000..7612e49
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Array list factory.
+ */
+public class ArrayListFactoryCallable implements IgniteCallable<List> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ArrayList call() {
+        return new ArrayList();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ArrayListFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
new file mode 100644
index 0000000..7084e70
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic boolean factory.
+ */
+public class AtomicBooleanFactoryCallable implements IgniteCallable<AtomicBoolean> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicBoolean call() {
+        return new AtomicBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AtomicBooleanFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicIntegerFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicIntegerFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicIntegerFactoryCallable.java
new file mode 100644
index 0000000..43c326c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicIntegerFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic integer factory.
+ */
+public class AtomicIntegerFactoryCallable implements IgniteCallable<AtomicInteger> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicInteger call() {
+        return new AtomicInteger(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AtomicIntegerFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
new file mode 100644
index 0000000..c7074b2
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic long factory.
+ */
+public class AtomicLongFactoryCallable implements IgniteCallable<AtomicLong> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicLong call() {
+        return new AtomicLong(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AtomicLongFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
new file mode 100644
index 0000000..6c20880
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic reference factory.
+ */
+public class AtomicReferenceFactoryCallable implements IgniteCallable<AtomicReference> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicReference call() {
+        return new AtomicReference();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(AtomicReferenceFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
new file mode 100644
index 0000000..98d1c8a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Map entry to key transformer closure.
+ */
+public class CacheEntryGetKeyClosure implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Object apply(Object o) {
+        return ((Cache.Entry)o).getKey();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheEntryGetKeyClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetValueClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetValueClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetValueClosure.java
new file mode 100644
index 0000000..578813b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetValueClosure.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Cache entry to get-value transformer closure.
+ */
+public class CacheEntryGetValueClosure implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public Object apply(Object o) {
+        return ((Cache.Entry)o).getValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheEntryGetValueClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryHasPeekPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryHasPeekPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryHasPeekPredicate.java
new file mode 100644
index 0000000..35042f0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryHasPeekPredicate.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Cache entry has-peek-value predicate.
+ */
+public class CacheEntryHasPeekPredicate implements IgnitePredicate {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean apply(Object o) {
+        return ((Cache.Entry)o).getValue() != null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheEntryHasPeekPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
new file mode 100644
index 0000000..9568cdf
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Grid node to node ID8 transformer closure.
+ */
+public class ClusterNodeGetId8Closure implements IgniteClosure<ClusterNode, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(ClusterNode n) {
+        return U.id8(n.id());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ClusterNodeGetId8Closure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetIdClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetIdClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetIdClosure.java
new file mode 100644
index 0000000..49ac70b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetIdClosure.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Grid node to node ID transformer closure.
+ */
+public class ClusterNodeGetIdClosure implements IgniteClosure<ClusterNode, UUID> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public UUID apply(ClusterNode n) {
+        return n.id();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ClusterNodeGetIdClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentDequeFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentDequeFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentDequeFactoryCallable.java
new file mode 100644
index 0000000..8af7fc8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentDequeFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+import org.jsr166.ConcurrentLinkedDeque8;
+
+/**
+ * Deque factory.
+ */
+public class ConcurrentDequeFactoryCallable implements IgniteCallable<ConcurrentLinkedDeque8> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ConcurrentLinkedDeque8 call() {
+        return new ConcurrentLinkedDeque8();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ConcurrentDequeFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentHashSetFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentHashSetFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentHashSetFactoryCallable.java
new file mode 100644
index 0000000..ce92eb1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentHashSetFactoryCallable.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.GridConcurrentHashSet;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Concurrent hash set factory.
+ */
+public class ConcurrentHashSetFactoryCallable implements IgniteCallable<GridConcurrentHashSet> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public GridConcurrentHashSet call() {
+        return new GridConcurrentHashSet();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ConcurrentHashSetFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentMapFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentMapFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentMapFactoryCallable.java
new file mode 100644
index 0000000..696944c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ConcurrentMapFactoryCallable.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.ConcurrentMap;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+import org.jsr166.ConcurrentHashMap8;
+
+/**
+ * Concurrent hash map factory.
+ */
+public class ConcurrentMapFactoryCallable implements IgniteCallable<ConcurrentMap> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ConcurrentMap call() {
+        return new ConcurrentHashMap8();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ConcurrentMapFactoryCallable.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java
new file mode 100644
index 0000000..61f36dd
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Grid node predicate evaluating on the given node IDs.
+ */
+public class ContainsNodeIdsPredicate<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = -5664060422647374863L;
+
+    /** */
+    private final Collection<UUID> nodeIds;
+
+    /**
+     * @param nodeIds (Collection)
+     */
+    public ContainsNodeIdsPredicate(Collection<UUID> nodeIds) {
+        this.nodeIds = nodeIds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode e) {
+        return nodeIds.contains(e.id());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(ContainsNodeIdsPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsPredicate.java
new file mode 100644
index 0000000..e3d613a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsPredicate.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate which returns {@code true} if it receives an element that is contained in the passed in
+ * collection.
+ *
+ * @param <T> Type of the free variable for the predicate and type of the collection elements.
+ */
+public class ContainsPredicate<T> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T> c;
+
+    /**
+     * @param c Collection to check for containment.
+     */
+    public ContainsPredicate(Collection<? extends T> c) {
+        this.c = c;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T t) {
+        assert c != null;
+
+        return c.contains(t);
+    }
+
+    /** {@inheritDoc} */
+    public String toString() {
+        return S.toString(ContainsPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByKeyEvaluationPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByKeyEvaluationPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByKeyEvaluationPredicate.java
new file mode 100644
index 0000000..c67ef3d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByKeyEvaluationPredicate.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Map;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate evaluates to true for given value.
+ * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
+ */
+public class EntryByKeyEvaluationPredicate<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super K>[] preds;
+
+    /**
+     * @param preds Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
+     * returned.
+     */
+    public EntryByKeyEvaluationPredicate(IgnitePredicate<? super K>... preds) {
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(Map.Entry<K, V> e) {
+        return GridFunc.isAll(e.getKey(), preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(EntryByKeyEvaluationPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
new file mode 100644
index 0000000..77099da
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Map;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Predicate evaluates to true for given value.
+ * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
+ */
+public class EntryByValueEvaluationPredicate<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgnitePredicate<? super V>[] preds;
+
+    /**
+     * @param preds Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
+     * returned.
+     */
+    public EntryByValueEvaluationPredicate(IgnitePredicate<? super V>... preds) {
+        this.preds = preds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(Map.Entry<K, V> e) {
+        return GridFunc.isAll(e.getValue(), preds);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(EntryByValueEvaluationPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java
new file mode 100644
index 0000000..22f83b8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Creates grid node predicate evaluating on the given node ID.
+ */
+public class EqualsClusterNodeIdPredicate<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = -7082730222779476623L;
+
+    /** */
+    private final UUID nodeId;
+
+    /**
+     * @param nodeId (Collection)
+     */
+    public EqualsClusterNodeIdPredicate(UUID nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode e) {
+        return e.id().equals(nodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(EqualsClusterNodeIdPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsUuidPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsUuidPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsUuidPredicate.java
new file mode 100644
index 0000000..4bb5c57
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsUuidPredicate.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * UUID equals predicate.
+ */
+public class EqualsUuidPredicate implements IgnitePredicate<UUID> {
+    /** */
+    private static final long serialVersionUID = -5664060422647374863L;
+
+    /** */
+    private final UUID nodeId;
+
+    /**
+     * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+     */
+    public EqualsUuidPredicate(UUID nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(UUID id) {
+        return id.equals(nodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(EqualsUuidPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatCollectionWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatCollectionWrapper.java
new file mode 100644
index 0000000..80d3862
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatCollectionWrapper.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Wrapper which iterable over the elements of the inner collections.
+ *
+ * @param <T> Type of the inner collections.
+ */
+public class FlatCollectionWrapper<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends Collection<T>> cols;
+
+    /**
+     * @param cols Input collection of collections.
+     */
+    public FlatCollectionWrapper(Collection<? extends Collection<T>> cols) {
+        this.cols = cols;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T> iterator() {
+        return GridFunc.flat((Iterable<? extends Iterable<T>>)cols);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.size(iterator());
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(FlatCollectionWrapper.class, this);
+    }
+}


[10/11] ignite git commit: ignite-3682 review

Posted by ag...@apache.org.
ignite-3682 review


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

Branch: refs/heads/master
Commit: 13dbff06a1089eca499e46b35c59c5e31b8f295c
Parents: 7e1d583
Author: agura <ag...@apache.org>
Authored: Mon Apr 10 21:17:55 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Wed Apr 12 18:20:48 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 149 ++-----------------
 .../ignite/internal/util/lang/GridTupleV.java   |   1 -
 .../lang/gridfunc/AlwaysFalsePredicate.java     |   2 +-
 .../lang/gridfunc/ArrayListFactoryCallable.java |  41 -----
 .../gridfunc/AtomicBooleanFactoryCallable.java  |  40 -----
 .../gridfunc/AtomicLongFactoryCallable.java     |  40 -----
 .../AtomicReferenceFactoryCallable.java         |  40 -----
 .../lang/gridfunc/CacheEntryGetKeyClosure.java  |  40 -----
 .../lang/gridfunc/ClusterNodeGetId8Closure.java |  41 -----
 .../EntryByValueEvaluationPredicate.java        |  53 -------
 .../gridfunc/IsAssignableFromPredicate.java     |  51 -------
 .../util/lang/gridfunc/IsNotDonePredicate.java  |  40 -----
 .../util/lang/gridfunc/IsNullPredicate.java     |  44 ------
 .../gridfunc/LinkedListFactoryCallable.java     |  40 -----
 .../util/lang/gridfunc/UuidToId8Closure.java    |  41 -----
 .../datastreamer/DataStreamerImplSelfTest.java  |  36 -----
 16 files changed, 14 insertions(+), 685 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/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 c93f077..64a364d 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
@@ -48,23 +48,15 @@ import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.lang.gridfunc.AlwaysFalsePredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.AlwaysTruePredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.AlwaysTrueReducer;
-import org.apache.ignite.internal.util.lang.gridfunc.ArrayListFactoryCallable;
-import org.apache.ignite.internal.util.lang.gridfunc.AtomicBooleanFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.AtomicIntegerFactoryCallable;
-import org.apache.ignite.internal.util.lang.gridfunc.AtomicLongFactoryCallable;
-import org.apache.ignite.internal.util.lang.gridfunc.AtomicReferenceFactoryCallable;
-import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetKeyClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetValueClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryHasPeekPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetId8Closure;
 import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetIdClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentDequeFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentHashSetFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.ConcurrentMapFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.ContainsNodeIdsPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.ContainsPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.EntryByKeyEvaluationPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.EntryByValueEvaluationPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.EqualsClusterNodeIdPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.EqualsUuidPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.FlatCollectionWrapper;
@@ -74,12 +66,8 @@ import org.apache.ignite.internal.util.lang.gridfunc.HasNotEqualIdPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.IdentityClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.IntSumReducer;
 import org.apache.ignite.internal.util.lang.gridfunc.IsAllPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.IsAssignableFromPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.IsNotAllPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.IsNotDonePredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.IsNotNullPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.IsNullPredicate;
-import org.apache.ignite.internal.util.lang.gridfunc.LinkedListFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.LongSumReducer;
 import org.apache.ignite.internal.util.lang.gridfunc.MapFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.MultipleIterator;
@@ -99,7 +87,6 @@ import org.apache.ignite.internal.util.lang.gridfunc.TransformCollectionView;
 import org.apache.ignite.internal.util.lang.gridfunc.TransformFilteringIterator;
 import org.apache.ignite.internal.util.lang.gridfunc.TransformMapView;
 import org.apache.ignite.internal.util.lang.gridfunc.TransformMapView2;
-import org.apache.ignite.internal.util.lang.gridfunc.UuidToId8Closure;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -153,12 +140,6 @@ public class GridFunc {
     private static final IgnitePredicate<Object> IS_NOT_NULL = new IsNotNullPredicate();
 
     /** */
-    private static final IgniteCallable<?> LIST_FACTORY = new ArrayListFactoryCallable();
-
-    /** */
-    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new LinkedListFactoryCallable();
-
-    /** */
     private static final IgniteCallable<?> SET_FACTORY = new SetFactoryCallable();
 
     /** */
@@ -174,9 +155,6 @@ public class GridFunc {
     private static final IgniteCallable<?> CONCURRENT_SET_FACTORY = new ConcurrentHashSetFactoryCallable();
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_KEY = new CacheEntryGetKeyClosure();
-
-    /** */
     private static final IgniteClosure CACHE_ENTRY_VAL_GET = new CacheEntryGetValueClosure();
 
     /** */
@@ -185,15 +163,6 @@ public class GridFunc {
     /** */
     private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new ClusterNodeGetIdClosure();
 
-    /** */
-    private static final IgniteClosure<ClusterNode, String> NODE2ID8 = new ClusterNodeGetId8Closure();
-
-    /** */
-    private static final IgniteClosure<UUID, String> ID2ID8 = new UuidToId8Closure();
-
-    /** */
-    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IsNotDonePredicate();
-
     /**
      * Gets predicate that evaluates to {@code true} only for given local node ID.
      *
@@ -314,17 +283,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets reducer closure that concatenates strings using provided delimiter.
-     *
-     * @param delim Delimiter (optional).
-     * @return Reducer that concatenates strings using provided delimeter.
-     */
-    @Deprecated
-    public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
-        return new StringConcatReducer(delim);
-    }
-
-    /**
      * Concatenates strings using provided delimiter.
      *
      * @param c Input collection.
@@ -334,7 +292,13 @@ public class GridFunc {
     public static String concat(Iterable<String> c, @Nullable String delim) {
         A.notNull(c, "c");
 
-        return reduce(c, concatReducer(delim));
+        IgniteReducer<? super String, String> f = new StringConcatReducer(delim);
+
+        for (String x : c)
+            if (!f.collect(x))
+                break;
+
+        return f.reduce();
     }
 
     /**
@@ -355,43 +319,6 @@ public class GridFunc {
     }
 
     /**
-     * Convenient utility method that returns collection of node ID8s for a given
-     * collection of grid nodes. ID8 is a shorter string representation of node ID,
-     * mainly the first 8 characters.
-     * <p>
-     * Note that this method doesn't create a new collection but simply iterates
-     * over the input one.
-     *
-     * @param nodes Collection of grid nodes.
-     * @return Collection of node IDs for given collection of grid nodes.
-     */
-    public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
-        if (nodes == null || nodes.isEmpty())
-            return Collections.emptyList();
-
-        return F.viewReadOnly(nodes, NODE2ID8);
-    }
-
-    /**
-     * Convenient utility method that returns collection of node ID8s for a given
-     * collection of node IDs. ID8 is a shorter string representation of node ID,
-     * mainly the first 8 characters.
-     * <p>
-     * Note that this method doesn't create a new collection but simply iterates
-     * over the input one.
-     *
-     * @param ids Collection of nodeIds.
-     * @return Collection of node IDs for given collection of grid nodes.
-     */
-    @Deprecated
-    public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
-        if (ids == null || ids.isEmpty())
-            return Collections.emptyList();
-
-        return F.viewReadOnly(ids, ID2ID8);
-    }
-
-    /**
      * Gets random value from given collection.
      *
      * @param c Input collection (no {@code null} and not emtpy).
@@ -1064,9 +991,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        assert c != null;
-
-        return new TransformCollectionView<T2, T1>(c, trans, p);
+        return new TransformCollectionView<>(c, trans, p);
     }
 
     /**
@@ -1109,7 +1034,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? m : new PredicateMapView<K, V>(m, p);
+        return isEmpty(p) || isAlwaysTrue(p) ? m : new PredicateMapView<>(m, p);
     }
 
     /**
@@ -1134,9 +1059,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        assert m != null;
-
-        return new TransformMapView<K, V1, V>(m, trans, p);
+        return new TransformMapView<>(m, trans, p);
     }
 
     /**
@@ -1162,7 +1085,7 @@ public class GridFunc {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new TransformMapView2<K, V, V1>(m, trans, p);
+        return new TransformMapView2<>(m, trans, p);
     }
 
     /**
@@ -1189,7 +1112,7 @@ public class GridFunc {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return new PredicateSetView<K, V>(c, mapClo, p);
+        return new PredicateSetView<>(c, mapClo, p);
     }
 
     /**
@@ -1906,27 +1829,6 @@ public class GridFunc {
     }
 
     /**
-     * Reduces collection into single value using given for-all closure.
-     *
-     * @param c Collection to reduce.
-     * @param f For-all closure used for reduction.
-     * @param <X> Type of the free variable for the closure and type of the
-     *      collection elements.
-     * @param <Y> Type of the closure's return value.
-     * @return Single value as a result of collection reduction.
-     */
-    @Deprecated
-    public static <X, Y> Y reduce(Iterable<? extends X> c, IgniteReducer<? super X, Y> f) {
-        A.notNull(c, "c", f, "f");
-
-        for (X x : c)
-            if (!f.collect(x))
-                break;
-
-        return f.reduce();
-    }
-
-    /**
      * Calls given {@code side-effect only} closure over the each element of the provided
      * collection.
      *
@@ -2543,19 +2445,6 @@ public class GridFunc {
     }
 
     /**
-     * Creates vararg tuple with given values.
-     *
-     * @param objs Values for vararg tuple.
-     * @return Vararg tuple with given values.
-     */
-    @Deprecated
-    public static GridTupleV tv(Object... objs) {
-        assert objs != null;
-
-        return new GridTupleV(objs);
-    }
-
-    /**
      * Factory method returning new empty tuple.
      *
      * @param <V1> Type of the 1st tuple parameter.
@@ -2794,7 +2683,7 @@ public class GridFunc {
      * @param <T> Element's type.
      * @return Created set.
      */
-    @SuppressWarnings( {"RedundantTypeArguments"})
+    @SuppressWarnings({"RedundantTypeArguments"})
     @Deprecated
     public static <T> Set<T> asSet(@Nullable T... t) {
         if (t == null || t.length == 0)
@@ -3087,18 +2976,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets closure that returns key for cache entry. The closure internally
-     * delegates to {@link javax.cache.Cache.Entry#getKey()} method.
-     *
-     * @param <K> Key type.
-     * @return Closure that returns key for an entry.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> IgniteClosure<Cache.Entry<K, V>, K> cacheEntry2Key() {
-        return (IgniteClosure<Cache.Entry<K, V>, K>)CACHE_ENTRY_KEY;
-    }
-
-    /**
      * Gets closure that returns value for an entry. The closure internally
      * delegates to {@link javax.cache.Cache.Entry#get(Object)} method.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTupleV.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTupleV.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTupleV.java
index 89c8ee2..9fcb69c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTupleV.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTupleV.java
@@ -35,7 +35,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
  * This class doesn't provide any synchronization for multi-threaded access
  * and it is responsibility of the user of this class to provide outside
  * synchronization, if needed.
- * @see GridFunc#tv(Object...)
  */
 @Deprecated
 public class GridTupleV implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
index 6e1dbb5..3689e75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AlwaysFalsePredicate.java
@@ -36,7 +36,7 @@ public class AlwaysFalsePredicate<E> implements IgnitePredicate<E> {
      * @return Always <code>false</code>
      */
     @Override public boolean apply(E e) {
-        return true;
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
deleted file mode 100644
index 7612e49..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ArrayListFactoryCallable.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Array list factory.
- */
-public class ArrayListFactoryCallable implements IgniteCallable<List> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public ArrayList call() {
-        return new ArrayList();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(ArrayListFactoryCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
deleted file mode 100644
index 7084e70..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicBooleanFactoryCallable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic boolean factory.
- */
-public class AtomicBooleanFactoryCallable implements IgniteCallable<AtomicBoolean> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicBoolean call() {
-        return new AtomicBoolean();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(AtomicBooleanFactoryCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
deleted file mode 100644
index c7074b2..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicLongFactoryCallable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicLong;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic long factory.
- */
-public class AtomicLongFactoryCallable implements IgniteCallable<AtomicLong> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicLong call() {
-        return new AtomicLong(0);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(AtomicLongFactoryCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
deleted file mode 100644
index 6c20880..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/AtomicReferenceFactoryCallable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicReference;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic reference factory.
- */
-public class AtomicReferenceFactoryCallable implements IgniteCallable<AtomicReference> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicReference call() {
-        return new AtomicReference();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(AtomicReferenceFactoryCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
deleted file mode 100644
index 98d1c8a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/CacheEntryGetKeyClosure.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import javax.cache.Cache;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Map entry to key transformer closure.
- */
-public class CacheEntryGetKeyClosure implements IgniteClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public Object apply(Object o) {
-        return ((Cache.Entry)o).getKey();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(CacheEntryGetKeyClosure.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
deleted file mode 100644
index 9568cdf..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ClusterNodeGetId8Closure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * Grid node to node ID8 transformer closure.
- */
-public class ClusterNodeGetId8Closure implements IgniteClosure<ClusterNode, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public String apply(ClusterNode n) {
-        return U.id8(n.id());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(ClusterNodeGetId8Closure.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
deleted file mode 100644
index 77099da..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EntryByValueEvaluationPredicate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Map;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Predicate evaluates to true for given value.
- * Note that evaluation will be short-circuit when first predicate evaluated to false is found.
- */
-public class EntryByValueEvaluationPredicate<K, V> implements IgnitePredicate<Map.Entry<K, V>> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgnitePredicate<? super V>[] preds;
-
-    /**
-     * @param preds Optional set of predicates to use for filtration. If none provided - original map (or its copy) will be
-     * returned.
-     */
-    public EntryByValueEvaluationPredicate(IgnitePredicate<? super V>... preds) {
-        this.preds = preds;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(Map.Entry<K, V> e) {
-        return GridFunc.isAll(e.getValue(), preds);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(EntryByValueEvaluationPredicate.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
deleted file mode 100644
index 51838e4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsAssignableFromPredicate.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.P1;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Predicate that evaluates to {@code true} if its free variable is instance of the given class.
- *
- * @param <T> Type of the free variable, i.e. the element the predicate is called on.
- */
-public class IsAssignableFromPredicate<T> implements P1<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Class<?> cls;
-
-    /**
-     * @param cls Class to compare to.
-     */
-    public IsAssignableFromPredicate(Class<?> cls) {
-        this.cls = cls;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T t) {
-        return t != null && cls.isAssignableFrom(t.getClass());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IsAssignableFromPredicate.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
deleted file mode 100644
index 4d9762d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNotDonePredicate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * IgniteInternalFuture is not done predicate.
- */
-public class IsNotDonePredicate implements IgnitePredicate<IgniteInternalFuture<?>> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(IgniteInternalFuture<?> f) {
-        return !f.isDone();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IsNotDonePredicate.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
deleted file mode 100644
index 7972928..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IsNullPredicate.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-
-/**
- * Defines a predicate which checks a parameter on <code>null</code>.
- *
- * @param <E> Type of predicate parameter.
- */
-public class IsNullPredicate<E> implements IgnitePredicate<E> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * @param e Parameter for check.
-     * @return 'true' if parameter equals to <code>null</code>, otherwise 'false'.
-     */
-    @Override public boolean apply(E e) {
-        return e == null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IsNullPredicate.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
deleted file mode 100644
index 4bf9948..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/LinkedListFactoryCallable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.LinkedList;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Linked list factory.
- */
-public class LinkedListFactoryCallable implements IgniteCallable<LinkedList> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public LinkedList call() {
-        return new LinkedList();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(LinkedListFactoryCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
deleted file mode 100644
index dcf165b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/UuidToId8Closure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.UUID;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteClosure;
-
-/**
- * UUID to ID8 transformer closure.
- */
-public class UuidToId8Closure implements IgniteClosure<UUID, String> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public String apply(UUID id) {
-        return U.id8(id);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(UuidToId8Closure.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/13dbff06/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java
index 514c070..ca8b192 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.processors.datastreamer;
 
-import java.io.Serializable;
 import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.Callable;
@@ -249,39 +248,4 @@ public class DataStreamerImplSelfTest extends GridCommonAbstractTest {
 
         return cacheCfg;
     }
-
-    /**
-     *
-     */
-    private static class TestObject implements Serializable {
-        /** */
-        private int val;
-
-        /**
-         */
-        private TestObject() {
-            // No-op.
-        }
-
-        /**
-         * @param val Value.
-         */
-        private TestObject(int val) {
-            this.val = val;
-        }
-
-        public Integer val() {
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object obj) {
-            return obj instanceof TestObject && ((TestObject)obj).val == val;
-        }
-    }
 }


[08/11] ignite git commit: ignite-3682: fixes of notes; refactoring

Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
new file mode 100644
index 0000000..d890e32
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Iterator over the elements of given iterators.
+ *
+ * @param <T> Type of the inner iterators.
+ */
+public class FlatIterator<T> extends GridIteratorAdapter<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private Iterator<?> iter;
+
+    /** */
+    private Iterator<T> next;
+
+    /** */
+    private boolean moved;
+
+    /** */
+    private boolean more;
+
+    /**
+     * @param iterable Input iterable of iterators.
+     */
+    public FlatIterator(Iterable<?> iterable) {
+        iter = iterable.iterator();
+        moved = true;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override public boolean hasNextX() {
+        if (!moved)
+            return more;
+
+        moved = false;
+
+        if (next != null && next.hasNext())
+            return more = true;
+
+        while (iter.hasNext()) {
+            if (iter instanceof Iterable)
+                next = (Iterator)((Iterable)iter).iterator().next();
+            else if (iter instanceof Iterator)
+                next = (Iterator)((Iterator)iter).next();
+            else
+                assert false : "Iterable or Iterator are expected";
+
+            if (next.hasNext())
+                return more = true;
+        }
+
+        return more = false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public T nextX() {
+        if (hasNext()) {
+            moved = true;
+
+            return next.next();
+        }
+
+        throw new NoSuchElementException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void removeX() {
+        assert next != null;
+
+        next.remove();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(FlatIterator.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
deleted file mode 100644
index 196df80..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureNoOperation.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridAbsClosure;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Absolute closure that does nothing.
- */
-public class GridAbsClosureNoOperation extends GridAbsClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public void apply() {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridAbsClosureNoOperation.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
deleted file mode 100644
index 33070f5..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosurePrint.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridAbsClosure;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Absolute closure that print message.
- */
-public class GridAbsClosurePrint extends GridAbsClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private String message;
-
-    /**
-     * @param message Message to print.
-     */
-    public GridAbsClosurePrint(String message) {
-        this.message = message;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void apply() {
-        System.out.println(message);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridAbsClosurePrint.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
deleted file mode 100644
index 6fa98f8..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureRunnableWrapper.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridAbsClosure;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Closure that wraps given runnable.
- * Note that wrapping closure always returns {@code null}.
- */
-public class GridAbsClosureRunnableWrapper extends GridAbsClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Runnable r;
-
-    /**
-     * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
-     */
-    public GridAbsClosureRunnableWrapper(Runnable r) {
-        this.r = r;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void apply() {
-        if (r != null)
-            r.run();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridAbsClosureRunnableWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
deleted file mode 100644
index 9902e2b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridAbsClosureWrapper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import org.apache.ignite.internal.util.lang.GridAbsClosure;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteInClosure;
-
-/**
- * Wraps given closure.
- *
- * @param <T> Input type.
- */
-public class GridAbsClosureWrapper<T> extends GridAbsClosure {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgniteInClosure<? super T> closure;
-
-    /** */
-    private final T closureArgument;
-
-    /**
-     * @param closure Closure.
-     * @param closureArgument Closure argument.
-     */
-    public GridAbsClosureWrapper(IgniteInClosure<? super T> closure, T closureArgument) {
-        this.closure = closure;
-        this.closureArgument = closureArgument;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void apply() {
-        closure.apply(closureArgument);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridAbsClosureWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
deleted file mode 100644
index eeb31b3..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterClosurePredicatesWrapper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Iterator from given iterator and optional filtering predicate.
- */
-public class GridIteratorAdapterClosurePredicatesWrapper<T2, T1> extends GridIteratorAdapter<T2> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final IgniteClosure<? super T1, T2> transformer;
-
-    /** */
-    private final boolean readOnly;
-
-    /** */
-    private final IgnitePredicate<? super T1>[] predicates;
-
-    /** */
-    private T1 elem;
-
-    /** */
-    private boolean more;
-
-    /** */
-    private boolean moved;
-
-    /** */
-    private Iterator<? extends T1> iterator;
-
-    /**
-     * @param iterator Input iterator.
-     * @param transformer Transforming closure to convert from T1 to T2.
-     * @param readOnly If {@code true}, then resulting iterator will not allow modifications to the underlying
-     * collection.
-     * @param predicates Optional filtering predicates.
-     */
-    public GridIteratorAdapterClosurePredicatesWrapper(Iterator<? extends T1> iterator, IgniteClosure<? super T1, T2> transformer,
-        boolean readOnly,
-        IgnitePredicate<? super T1>... predicates) {
-        this.transformer = transformer;
-        this.readOnly = readOnly;
-        this.predicates = predicates;
-        this.iterator = iterator;
-        this.moved = true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasNextX() {
-        if (GridFunc.isEmpty(predicates))
-            return iterator.hasNext();
-        else {
-            if (!moved)
-                return more;
-            else {
-                more = false;
-
-                while (iterator.hasNext()) {
-                    elem = iterator.next();
-
-                    boolean isAll = true;
-
-                    for (IgnitePredicate<? super T1> r : predicates)
-                        if (r != null && !r.apply(elem)) {
-                            isAll = false;
-
-                            break;
-                        }
-
-                    if (isAll) {
-                        more = true;
-                        moved = false;
-
-                        return true;
-                    }
-                }
-
-                elem = null; // Give to GC.
-
-                return false;
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public T2 nextX() {
-        if (GridFunc.isEmpty(predicates))
-            return transformer.apply(iterator.next());
-        else {
-            if (hasNext()) {
-                moved = true;
-
-                return transformer.apply(elem);
-            }
-            else
-                throw new NoSuchElementException();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void removeX() {
-        if (readOnly)
-            throw new UnsupportedOperationException("Cannot modify read-only iterator.");
-
-        iterator.remove();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridIteratorAdapterClosurePredicatesWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
deleted file mode 100644
index 22e2033..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorAdapterWrapper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Iterator over the elements of given iterators.
- *
- * @param <T> Type of the inner iterators.
- */
-public class GridIteratorAdapterWrapper<T> extends GridIteratorAdapter<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Iterable<Iterator<T>> iterable;
-
-    /** */
-    private Iterator<? extends Iterator<T>> iterator;
-
-    /** */
-    private Iterator<T> next;
-
-    /** */
-    private boolean moved;
-
-    /** */
-    private boolean more;
-
-    /**
-     * @param iterable Input iterable of iterators.
-     */
-    public GridIteratorAdapterWrapper(Iterable<Iterator<T>> iterable) {
-        this.iterable = iterable;
-        iterator = iterable.iterator();
-        moved = true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasNextX() {
-        if (!moved)
-            return more;
-
-        moved = false;
-
-        if (next != null && next.hasNext())
-            return more = true;
-
-        while (iterator.hasNext()) {
-            next = iterator.next();
-
-            if (next.hasNext())
-                return more = true;
-        }
-
-        return more = false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public T nextX() {
-        if (hasNext()) {
-            moved = true;
-
-            return next.next();
-        }
-
-        throw new NoSuchElementException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void removeX() {
-        assert next != null;
-
-        next.remove();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridIteratorAdapterWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
deleted file mode 100644
index c309232..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridIteratorOverInnerCollectionsAdapter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Wrapper wich iterable over the elements of the inner collections.
- *
- * @param <T> Type of the inner collections.
- */
-public class GridIteratorOverInnerCollectionsAdapter<T> extends GridIteratorAdapter<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Iterable<? extends Iterable<T>> iterable;
-
-    /** */
-    private Iterator<? extends Iterable<T>> iterator;
-
-    /** */
-    private Iterator<T> next;
-
-    /** */
-    private boolean moved;
-
-    /** */
-    private boolean more;
-
-    /**
-     * @param iterable Input collection of collections.
-     */
-    public GridIteratorOverInnerCollectionsAdapter(Iterable<? extends Iterable<T>> iterable) {
-        this.iterable = iterable;
-        iterator = iterable.iterator();
-        moved = true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasNextX() {
-        if (!moved)
-            return more;
-
-        moved = false;
-
-        if (next != null && next.hasNext())
-            return more = true;
-
-        while (iterator.hasNext()) {
-            next = iterator.next().iterator();
-
-            if (next.hasNext())
-                return more = true;
-        }
-
-        return more = false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public T nextX() {
-        if (hasNext()) {
-            moved = true;
-
-            return next.next();
-        }
-
-        throw new NoSuchElementException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void removeX() {
-        assert next != null;
-
-        next.remove();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridIteratorOverInnerCollectionsAdapter.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
deleted file mode 100644
index 771da37..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionPredicateWrapper.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * Light-weight view on given collection with provided predicate.
- *
- * @param <T> Type of the collection.
- */
-public class GridSerializableCollectionPredicateWrapper<T> extends GridSerializableCollection<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Collection<T> collection;
-
-    /** */
-    private final IgnitePredicate<? super T>[] predicates;
-
-    /**
-     * @param collection Input collection that serves as a base for the view.
-     * @param predicates Optional predicates. If predicates are not provided - all elements will be in the view.
-     */
-    public GridSerializableCollectionPredicateWrapper(Collection<T> collection, IgnitePredicate<? super T>... predicates) {
-        this.collection = collection;
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean add(T e) {
-        // Pass through (will fail for readonly).
-        return GridFunc.isAll(e, predicates) && collection.add(e);
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Iterator<T> iterator() {
-        return F.iterator0(collection, false, predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return F.size(collection, predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return F.isEmpty(predicates) ? collection.isEmpty() : !iterator().hasNext();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableCollectionPredicateWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
deleted file mode 100644
index cbabe9b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableCollectionWrapper.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * Wrapper which iterable over the elements of the inner collections.
- *
- * @param <T> Type of the inner collections.
- */
-public class GridSerializableCollectionWrapper<T> extends GridSerializableCollection<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Collection<? extends Collection<T>> collections;
-
-    /**
-     * @param collections Input collection of collections.
-     */
-    public GridSerializableCollectionWrapper(Collection<? extends Collection<T>> collections) {
-        this.collections = collections;
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Iterator<T> iterator() {
-        return GridFunc.flat((Iterable<? extends Iterable<T>>)collections);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return F.size(iterator());
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return !iterator().hasNext();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableCollectionWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
deleted file mode 100644
index a932e37..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableListReadOnlyWithTransformation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.List;
-import org.apache.ignite.internal.util.GridSerializableList;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * Light-weight view on given list with provided transformation.
- *
- * @param <T1> Element type after transformation.
- * @param <T2> Element type.
- */
-public class GridSerializableListReadOnlyWithTransformation<T1, T2> extends GridSerializableList<T1> {
-    /** */
-    private static final long serialVersionUID = 3126625219739967068L;
-
-    /** */
-    private final IgniteClosure<? super T2, T1> closure;
-
-    /** */
-    private final List<? extends T2> list;
-
-    /**
-     * @param closure closure Transformation closure.
-     * @param list Input list that serves as a base for the view.
-     */
-    public GridSerializableListReadOnlyWithTransformation(IgniteClosure<? super T2, T1> closure,
-        List<? extends T2> list) {
-        this.closure = closure;
-        this.list = list;
-    }
-
-    /** {@inheritDoc} */
-    @Override public T1 get(int idx) {
-        return closure.apply(list.get(idx));
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Iterator<T1> iterator() {
-        return F.<T2, T1>iterator(list, closure, true);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return list.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return list.isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableListReadOnlyWithTransformation.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
deleted file mode 100644
index 9803ba8..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.apache.ignite.internal.util.GridSerializableMap;
-import org.apache.ignite.internal.util.GridSerializableSet;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Light-weight view on given map with provided predicate and transformer.
- *
- * @param <K> Type of the key.
- * @param <V> Type of the input map value.
- * @param <V1> Type of the output map value.
- */
-public class GridSerializableMapPredicatesTransformerWrapper<K, V1, V> extends GridSerializableMap<K, V1> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Map<K, V> map;
-
-    /** */
-    private final IgniteClosure<V, V1> transformer;
-
-    /** */
-    private final boolean hasPred;
-
-    /** */
-    private final IgnitePredicate<? super K>[] predicates;
-
-    /** Entry predicate. */
-    private IgnitePredicate<Entry<K, V>> ep;
-
-    /**
-     * @param map Input map that serves as a base for the view.
-     * @param transformer Transformer for map value transformation.
-     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
-     */
-    @SuppressWarnings({"unchecked"})
-    public GridSerializableMapPredicatesTransformerWrapper(Map<K, V> map, IgniteClosure<V, V1> transformer,
-        IgnitePredicate<? super K>... predicates) {
-        this.map = map;
-        this.transformer = transformer;
-        this.hasPred = (predicates != null && predicates.length > 0);
-        this.predicates = predicates;
-        this.ep = new IgnitePredicateEvaluateEntryByKey(predicates);
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
-        return new GridSerializableSet<Entry<K, V1>>() {
-            @NotNull
-            @Override public Iterator<Entry<K, V1>> iterator() {
-                return new Iterator<Entry<K, V1>>() {
-                    private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, ep);
-
-                    @Override public boolean hasNext() {
-                        return it.hasNext();
-                    }
-
-                    @Override public Entry<K, V1> next() {
-                        final Entry<K, V> e = it.next();
-
-                        return new Entry<K, V1>() {
-                            @Override public K getKey() {
-                                return e.getKey();
-                            }
-
-                            @Override public V1 getValue() {
-                                return transformer.apply(e.getValue());
-                            }
-
-                            @Override public V1 setValue(V1 val) {
-                                throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-                            }
-                        };
-                    }
-
-                    @Override public void remove() {
-                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                    }
-                };
-            }
-
-            @Override public int size() {
-                return hasPred ? F.size(map.keySet(), predicates) : map.size();
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean remove(Object o) {
-                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean contains(Object o) {
-                return F.isAll((Entry<K, V>)o, ep) && map.entrySet().contains(o);
-            }
-
-            @Override public boolean isEmpty() {
-                return hasPred ? !iterator().hasNext() : map.isEmpty();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return hasPred ? entrySet().isEmpty() : map.isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Nullable @Override public V1 get(Object key) {
-        if (GridFunc.isAll((K)key, predicates)) {
-            V v = map.get(key);
-
-            if (v != null)
-                return transformer.apply(v);
-        }
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V1 put(K key, V1 val) {
-        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public V1 remove(Object key) {
-        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Override public boolean containsKey(Object key) {
-        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableMapPredicatesTransformerWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
deleted file mode 100644
index 3528ae8..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.apache.ignite.internal.util.GridSerializableMap;
-import org.apache.ignite.internal.util.GridSerializableSet;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Light-weight view on given map with provided predicate.
- *
- * @param <K> Type of the key.
- * @param <V> Type of the value.
- */
-public class GridSerializableMapPredicatesWrapper<K, V> extends GridSerializableMap<K, V> {
-    /** */
-    private static final long serialVersionUID = 5531745605372387948L;
-
-    /** */
-    private final Map<K, V> map;
-
-    /** */
-    private final IgnitePredicate<? super K>[] predicates;
-
-    /** Entry predicate. */
-    private IgnitePredicate<Entry<K, V>> entryPredicate;
-
-    /**
-     * @param map Input map that serves as a base for the view.
-     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
-     */
-    @SuppressWarnings({"unchecked"})
-    public GridSerializableMapPredicatesWrapper(Map<K, V> map, IgnitePredicate<? super K>... predicates) {
-        this.map = map;
-        this.predicates = predicates;
-        this.entryPredicate = new IgnitePredicateEvaluateEntryByKey(predicates);
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Set<Entry<K, V>> entrySet() {
-        return new GridSerializableSet<Entry<K, V>>() {
-            @NotNull
-            @Override public Iterator<Entry<K, V>> iterator() {
-                return GridFunc.iterator0(map.entrySet(), false, entryPredicate);
-            }
-
-            @Override public int size() {
-                return F.size(map.keySet(), predicates);
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean remove(Object o) {
-                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().remove(o);
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean contains(Object o) {
-                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().contains(o);
-            }
-
-            @Override public boolean isEmpty() {
-                return !iterator().hasNext();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return entrySet().isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Nullable @Override public V get(Object key) {
-        return GridFunc.isAll((K)key, predicates) ? map.get(key) : null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V put(K key, V val) {
-        V oldVal = get(key);
-
-        if (GridFunc.isAll(key, predicates))
-            map.put(key, val);
-
-        return oldVal;
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Override public boolean containsKey(Object key) {
-        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableMapPredicatesWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
deleted file mode 100644
index 2782b93..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.apache.ignite.internal.util.GridSerializableMap;
-import org.apache.ignite.internal.util.GridSerializableSet;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteBiClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Light-weight view on given map with provided predicate and transformer.
- *
- * @param <K> Type of the key.
- * @param <V> Type of the input map value.
- * @param <V1> Type of the output map value.
- */
-public class GridSerializableMapReadOnlyClosurePredicateWrapper<K, V, V1> extends GridSerializableMap<K, V1> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Map<K, V> map;
-
-    /** */
-    private final IgniteBiClosure<K, V, V1> transformer;
-
-    /** */
-    private final IgnitePredicate<? super K>[] predicates;
-
-    /** Entry predicate. */
-    private IgnitePredicate<Entry<K, V>> entryPredicate;
-
-    /**
-     * @param map Input map that serves as a base for the view.
-     * @param transformer Transformer for map value transformation.
-     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
-     */
-    @SuppressWarnings({"unchecked"})
-    public GridSerializableMapReadOnlyClosurePredicateWrapper(Map<K, V> map, IgniteBiClosure<K, V, V1> transformer,
-        IgnitePredicate<? super K>... predicates) {
-        this.map = map;
-        this.transformer = transformer;
-        this.predicates = predicates;
-        entryPredicate = new IgnitePredicateEvaluateEntryByKey(predicates);
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
-        return new GridSerializableSet<Entry<K, V1>>() {
-            @NotNull
-            @Override public Iterator<Entry<K, V1>> iterator() {
-                return new Iterator<Entry<K, V1>>() {
-                    private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, entryPredicate);
-
-                    @Override public boolean hasNext() {
-                        return it.hasNext();
-                    }
-
-                    @Override public Entry<K, V1> next() {
-                        final Entry<K, V> e = it.next();
-
-                        return new Entry<K, V1>() {
-                            @Override public K getKey() {
-                                return e.getKey();
-                            }
-
-                            @Override public V1 getValue() {
-                                return transformer.apply(e.getKey(), e.getValue());
-                            }
-
-                            @Override public V1 setValue(V1 val) {
-                                throw new UnsupportedOperationException(
-                                    "Put is not supported for readonly map view.");
-                            }
-                        };
-                    }
-
-                    @Override public void remove() {
-                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-                    }
-                };
-            }
-
-            @Override public int size() {
-                return F.size(map.keySet(), predicates);
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean remove(Object o) {
-                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean contains(Object o) {
-                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().contains(o);
-            }
-
-            @Override public boolean isEmpty() {
-                return !iterator().hasNext();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return entrySet().isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Nullable @Override public V1 get(Object key) {
-        if (GridFunc.isAll((K)key, predicates)) {
-            V v = map.get(key);
-
-            if (v != null)
-                return transformer.apply((K)key, v);
-        }
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V1 put(K key, V1 val) {
-        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public V1 remove(Object key) {
-        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked"})
-    @Override public boolean containsKey(Object key) {
-        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableMapReadOnlyClosurePredicateWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
deleted file mode 100644
index 10c36ef..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Iterator;
-import java.util.Set;
-import org.apache.ignite.internal.util.GridSerializableMap;
-import org.apache.ignite.internal.util.GridSerializableSet;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Light-weight view on given map with provided predicates and mapping.
- *
- * @param <K> Key type.
- * @param <V> Value type.
- */
-public class GridSerializableMapReadOnlyPredicateWrapper<K, V> extends GridSerializableMap<K, V> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Set<K> set;
-
-    /** */
-    private final IgniteClosure<? super K, V> mappingClosure;
-
-    /** */
-    private final IgnitePredicate<? super K>[] predicates;
-
-    /** Entry predicate. */
-    private IgnitePredicate<K> entryPredicate;
-
-    /**
-     * @param set Input collection.
-     * @param mappingClosure Mapping closure, that maps key to value.
-     * @param predicates Optional predicates to filter input collection. If predicates are not provided - all elements
-     * will be in
-     */
-    @SuppressWarnings({"unchecked"})
-    public GridSerializableMapReadOnlyPredicateWrapper(Set<K> set, IgniteClosure<? super K, V> mappingClosure,
-        IgnitePredicate<? super K>... predicates) {
-        this.set = set;
-        this.mappingClosure = mappingClosure;
-        this.predicates = predicates;
-        this.entryPredicate = new IgnitePredicateIsAll(predicates);
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Set<Entry<K, V>> entrySet() {
-        return new GridSerializableSet<Entry<K, V>>() {
-            @NotNull @Override public Iterator<Entry<K, V>> iterator() {
-                return new Iterator<Entry<K, V>>() {
-
-                    private Iterator<K> it = GridFunc.iterator0(set, true, entryPredicate);
-
-                    @Override public boolean hasNext() {
-                        return it.hasNext();
-                    }
-
-                    @Override public Entry<K, V> next() {
-                        final K e = it.next();
-
-                        return new Entry<K, V>() {
-                            @Override public K getKey() {
-                                return e;
-                            }
-
-                            @Override public V getValue() {
-                                return mappingClosure.apply(e);
-                            }
-
-                            @Override public V setValue(V val) {
-                                throw new UnsupportedOperationException(
-                                    "Put is not supported for readonly collection view.");
-                            }
-                        };
-                    }
-
-                    @Override public void remove() {
-                        throw new UnsupportedOperationException(
-                            "Remove is not support for readonly collection view.");
-                    }
-                };
-            }
-
-            @Override public int size() {
-                return F.size(set, predicates);
-            }
-
-            @Override public boolean remove(Object o) {
-                throw new UnsupportedOperationException("Remove is not support for readonly collection view.");
-            }
-
-            @Override public boolean isEmpty() {
-                return !iterator().hasNext();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return entrySet().isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V get(Object key) {
-        if (containsKey(key))
-            return mappingClosure.apply((K)key);
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V put(K key, V val) {
-        throw new UnsupportedOperationException("Put is not supported for readonly collection view.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public V remove(Object key) {
-        throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean containsKey(Object key) {
-        return GridFunc.isAll((K)key, predicates) && set.contains(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableMapReadOnlyPredicateWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
deleted file mode 100644
index cce95a6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * Light-weight view on given collection with provided predicate.
- *
- * @param <T1> Element type after transformation.
- * @param <T2> Element type.
- */
-public class GridSerializableReadOnlyCollectionPredicateWrapper<T1, T2> extends GridSerializableCollection<T1> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private final Collection<? extends T2> collection;
-
-    /** */
-    private final IgniteClosure<? super T2, T1> transformer;
-
-    /** */
-    private final IgnitePredicate<? super T2>[] predicates;
-
-    /**
-     * @param collection Input collection that serves as a base for the view.
-     * @param transformer Transformation closure.
-     * @param predicates Optional predicated. If predicates are not provided - all elements will be in the view.
-     */
-    public GridSerializableReadOnlyCollectionPredicateWrapper(Collection<? extends T2> collection,
-        IgniteClosure<? super T2, T1> transformer, IgnitePredicate<? super T2>... predicates) {
-        this.collection = collection;
-        this.transformer = transformer;
-        this.predicates = predicates;
-    }
-
-    /** {@inheritDoc} */
-    @NotNull @Override public Iterator<T1> iterator() {
-        return F.<T2, T1>iterator(collection, transformer, true, predicates);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return F.isEmpty(predicates) ? collection.size() : F.size(iterator());
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return F.isEmpty(predicates) ? collection.isEmpty() : !iterator().hasNext();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableReadOnlyCollectionPredicateWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
deleted file mode 100644
index 3bec907..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.GridSerializableIterator;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Collection wrapper.
- * A read-only view will be created over the element and given
- * collections and no copying will happen.
- *
- * @param <T> Element type.
- */
-public class GridSerializableReadOnlyCollectionWrapper<T> extends GridSerializableCollection<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Collection. */
-    private final Collection<T> collection;
-
-    /** First element in the collection. */
-    private final T firstElement;
-
-    /**
-     * @param collection Collection to wrap.
-     * @param firstElement First element.
-     */
-    public GridSerializableReadOnlyCollectionWrapper(@NotNull Collection<T> collection, @NotNull T firstElement) {
-        this.collection = collection;
-        this.firstElement = firstElement;
-    }
-
-    /** {@inheritDoc} */
-    @NotNull
-    @Override public Iterator<T> iterator() {
-        return new GridSerializableIterator<T>() {
-            private Iterator<T> it;
-
-            @Override public boolean hasNext() {
-                return it == null || it.hasNext();
-            }
-
-            @Nullable @Override public T next() {
-                if (it == null) {
-                    it = collection.iterator();
-
-                    return firstElement;
-                }
-
-                return it.next();
-            }
-
-            @Override public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return collection.size() + 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object obj) {
-        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection)obj);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableReadOnlyCollectionWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
deleted file mode 100644
index 5747d2c..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.ignite.internal.util.GridSerializableCollection;
-import org.apache.ignite.internal.util.GridSerializableIterator;
-import org.apache.ignite.internal.util.lang.GridFunc;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * Collections wrapper.
- * A read-only view will be created over the element and given
- * collections and no copying will happen.
- *
- * @param <T> Element type.
- */
-public class GridSerializableReadOnlyTwoCollectionsWrapper<T> extends GridSerializableCollection<T> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** First collection. */
-    private final Collection<T> c1;
-
-    /** SecondCollection. */
-    private final Collection<T> c2;
-
-    /**
-     * @param c1 First collection.
-     * @param c2 SecondCollection.
-     */
-    public GridSerializableReadOnlyTwoCollectionsWrapper(Collection<T> c1, Collection<T> c2) {
-        this.c1 = c1;
-        this.c2 = c2;
-    }
-
-    /** {@inheritDoc} */
-    @NotNull
-    @Override public Iterator<T> iterator() {
-        return new GridSerializableIterator<T>() {
-            private Iterator<T> it1 = c1.iterator();
-            private Iterator<T> it2 = c2.iterator();
-
-            @Override public boolean hasNext() {
-                if (it1 != null)
-                    if (!it1.hasNext())
-                        it1 = null;
-                    else
-                        return true;
-
-                return it2.hasNext();
-            }
-
-            @Override public T next() {
-                return it1 != null ? it1.next() : it2.next();
-            }
-
-            @Override public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean contains(Object o) {
-        return c1.contains(o) || c2.contains(o);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        return c1.size() + c2.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object obj) {
-        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection<?>)obj);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridSerializableReadOnlyTwoCollectionsWrapper.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java
new file mode 100644
index 0000000..9f5f927
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * {@link ClusterNode} has equal id predicate.
+ */
+public class HasEqualIdPredicate<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final UUID locNodeId;
+
+    /**
+     * @param locNodeId Id for check.
+     */
+    public HasEqualIdPredicate(UUID locNodeId) {
+        this.locNodeId = locNodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T n) {
+        return n.id().equals(locNodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(HasEqualIdPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java
new file mode 100644
index 0000000..e467749
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * {@link ClusterNode} node has NOT equal id predicate.
+ */
+public class HasNotEqualIdPredicate<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final UUID locNodeId;
+
+    /**
+     * @param locNodeId Id for check.
+     */
+    public HasNotEqualIdPredicate(UUID locNodeId) {
+        this.locNodeId = locNodeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(T n) {
+        return !n.id().equals(locNodeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(HasNotEqualIdPredicate.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IdentityClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IdentityClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IdentityClosure.java
new file mode 100644
index 0000000..a053a3f
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IdentityClosure.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Identity closure.
+ */
+public class IdentityClosure implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = -6338573080046225172L;
+
+    /** {@inheritDoc} */
+    @Override public Object apply(Object o) {
+        return o;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IdentityClosure.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
deleted file mode 100644
index 017397d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Array list factory.
- */
-public class IgniteCallableArrayListFactory implements IgniteCallable<List> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public ArrayList call() {
-        return new ArrayList();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableArrayListFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
deleted file mode 100644
index a935471..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic boolean factory.
- */
-public class IgniteCallableAtomicBooleanFactory implements IgniteCallable<AtomicBoolean> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicBoolean call() {
-        return new AtomicBoolean();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableAtomicBooleanFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
deleted file mode 100644
index 9a8df06..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic integer factory.
- */
-public class IgniteCallableAtomicIntegerFactory implements IgniteCallable<AtomicInteger> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicInteger call() {
-        return new AtomicInteger(0);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableAtomicIntegerFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
deleted file mode 100644
index 7499c29..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicLong;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic long factory.
- */
-public class IgniteCallableAtomicLongFactory implements IgniteCallable<AtomicLong> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicLong call() {
-        return new AtomicLong(0);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableAtomicLongFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a3f845b0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
deleted file mode 100644
index ed0ff58..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.util.lang.gridfunc;
-
-import java.util.concurrent.atomic.AtomicReference;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteCallable;
-
-/**
- * Atomic reference factory.
- */
-public class IgniteCallableAtomicReferenceFactory implements IgniteCallable<AtomicReference> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public AtomicReference call() {
-        return new AtomicReference();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteCallableAtomicReferenceFactory.class, this);
-    }
-}


[05/11] ignite git commit: ignite-3682: fix FlatIterator

Posted by ag...@apache.org.
ignite-3682: fix FlatIterator


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

Branch: refs/heads/master
Commit: b2441db0d75e26946c751cb6a4eaa2a2d2eb1e4a
Parents: a3f845b
Author: daradurvs <da...@gmail.com>
Authored: Fri Mar 31 22:26:23 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Mon Apr 10 19:39:06 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/gridfunc/FlatIterator.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b2441db0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
index d890e32..1b1491e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
@@ -63,10 +63,12 @@ public class FlatIterator<T> extends GridIteratorAdapter<T> {
             return more = true;
 
         while (iter.hasNext()) {
-            if (iter instanceof Iterable)
-                next = (Iterator)((Iterable)iter).iterator().next();
-            else if (iter instanceof Iterator)
-                next = (Iterator)((Iterator)iter).next();
+            Object obj = iter.next();
+
+            if (obj instanceof Iterable)
+                next = ((Iterable)obj).iterator();
+            else if (obj instanceof Iterator)
+                next = (Iterator)obj;
             else
                 assert false : "Iterable or Iterator are expected";
 


[04/11] ignite git commit: ignite-3682: method which are used in scalar-module was returned

Posted by ag...@apache.org.
ignite-3682: method which are used in scalar-module was returned


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

Branch: refs/heads/master
Commit: 7e1d58314e1e99490565ecb02193ddc2bcedfaf3
Parents: b2441db
Author: daradurvs <da...@gmail.com>
Authored: Tue Apr 4 21:06:40 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Mon Apr 10 19:39:06 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 14 +++++-
 .../lang/gridfunc/RunnableWrapperClosure.java   | 51 ++++++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7e1d5831/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 71ff014..c93f077 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
@@ -53,8 +53,8 @@ import org.apache.ignite.internal.util.lang.gridfunc.AtomicBooleanFactoryCallabl
 import org.apache.ignite.internal.util.lang.gridfunc.AtomicIntegerFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.AtomicLongFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.AtomicReferenceFactoryCallable;
-import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetValueClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetKeyClosure;
+import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryGetValueClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.CacheEntryHasPeekPredicate;
 import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetId8Closure;
 import org.apache.ignite.internal.util.lang.gridfunc.ClusterNodeGetIdClosure;
@@ -91,6 +91,7 @@ import org.apache.ignite.internal.util.lang.gridfunc.PredicateMapView;
 import org.apache.ignite.internal.util.lang.gridfunc.PredicateSetView;
 import org.apache.ignite.internal.util.lang.gridfunc.ReadOnlyCollectionView;
 import org.apache.ignite.internal.util.lang.gridfunc.ReadOnlyCollectionView2X;
+import org.apache.ignite.internal.util.lang.gridfunc.RunnableWrapperClosure;
 import org.apache.ignite.internal.util.lang.gridfunc.SetFactoryCallable;
 import org.apache.ignite.internal.util.lang.gridfunc.StringConcatReducer;
 import org.apache.ignite.internal.util.lang.gridfunc.ToStringClosure;
@@ -970,6 +971,17 @@ public class GridFunc {
     }
 
     /**
+     * Converts given runnable to an absolute closure.
+     *
+     * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+     * @return Closure that wraps given runnable. Note that wrapping closure always returns {@code null}.
+     */
+    @Deprecated
+    public static GridAbsClosure as(@Nullable final Runnable r) {
+        return new RunnableWrapperClosure(r);
+    }
+
+    /**
      * Gets size of the given collection with provided optional predicates.
      *
      * @param c Collection to size.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7e1d5831/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/RunnableWrapperClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/RunnableWrapperClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/RunnableWrapperClosure.java
new file mode 100644
index 0000000..8db1864
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/RunnableWrapperClosure.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.lang.GridAbsClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Closure that wraps given runnable.
+ * Note that wrapping closure always returns {@code null}.
+ */
+public class RunnableWrapperClosure extends GridAbsClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Runnable r;
+
+    /**
+     * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+     */
+    public RunnableWrapperClosure(Runnable r) {
+        this.r = r;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void apply() {
+        if (r != null)
+            r.run();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(RunnableWrapperClosure.class, this);
+    }
+}


[02/11] ignite git commit: ignite-3682: all anonymous classes were extracted

Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
new file mode 100644
index 0000000..9803ba8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesTransformerWrapper.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate and transformer.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the input map value.
+ * @param <V1> Type of the output map value.
+ */
+public class GridSerializableMapPredicatesTransformerWrapper<K, V1, V> extends GridSerializableMap<K, V1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgniteClosure<V, V1> transformer;
+
+    /** */
+    private final boolean hasPred;
+
+    /** */
+    private final IgnitePredicate<? super K>[] predicates;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> ep;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param transformer Transformer for map value transformation.
+     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public GridSerializableMapPredicatesTransformerWrapper(Map<K, V> map, IgniteClosure<V, V1> transformer,
+        IgnitePredicate<? super K>... predicates) {
+        this.map = map;
+        this.transformer = transformer;
+        this.hasPred = (predicates != null && predicates.length > 0);
+        this.predicates = predicates;
+        this.ep = new IgnitePredicateEvaluateEntryByKey(predicates);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
+        return new GridSerializableSet<Entry<K, V1>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V1>> iterator() {
+                return new Iterator<Entry<K, V1>>() {
+                    private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, ep);
+
+                    @Override public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override public Entry<K, V1> next() {
+                        final Entry<K, V> e = it.next();
+
+                        return new Entry<K, V1>() {
+                            @Override public K getKey() {
+                                return e.getKey();
+                            }
+
+                            @Override public V1 getValue() {
+                                return transformer.apply(e.getValue());
+                            }
+
+                            @Override public V1 setValue(V1 val) {
+                                throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return hasPred ? F.size(map.keySet(), predicates) : map.size();
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, ep) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return hasPred ? !iterator().hasNext() : map.isEmpty();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return hasPred ? entrySet().isEmpty() : map.isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V1 get(Object key) {
+        if (GridFunc.isAll((K)key, predicates)) {
+            V v = map.get(key);
+
+            if (v != null)
+                return transformer.apply(v);
+        }
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V1 put(K key, V1 val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V1 remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableMapPredicatesTransformerWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
new file mode 100644
index 0000000..3528ae8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapPredicatesWrapper.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the value.
+ */
+public class GridSerializableMapPredicatesWrapper<K, V> extends GridSerializableMap<K, V> {
+    /** */
+    private static final long serialVersionUID = 5531745605372387948L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgnitePredicate<? super K>[] predicates;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> entryPredicate;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public GridSerializableMapPredicatesWrapper(Map<K, V> map, IgnitePredicate<? super K>... predicates) {
+        this.map = map;
+        this.predicates = predicates;
+        this.entryPredicate = new IgnitePredicateEvaluateEntryByKey(predicates);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V>> entrySet() {
+        return new GridSerializableSet<Entry<K, V>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V>> iterator() {
+                return GridFunc.iterator0(map.entrySet(), false, entryPredicate);
+            }
+
+            @Override public int size() {
+                return F.size(map.keySet(), predicates);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().remove(o);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V get(Object key) {
+        return GridFunc.isAll((K)key, predicates) ? map.get(key) : null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V put(K key, V val) {
+        V oldVal = get(key);
+
+        if (GridFunc.isAll(key, predicates))
+            map.put(key, val);
+
+        return oldVal;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableMapPredicatesWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
new file mode 100644
index 0000000..2782b93
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyClosurePredicateWrapper.java
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteBiClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicate and transformer.
+ *
+ * @param <K> Type of the key.
+ * @param <V> Type of the input map value.
+ * @param <V1> Type of the output map value.
+ */
+public class GridSerializableMapReadOnlyClosurePredicateWrapper<K, V, V1> extends GridSerializableMap<K, V1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Map<K, V> map;
+
+    /** */
+    private final IgniteBiClosure<K, V, V1> transformer;
+
+    /** */
+    private final IgnitePredicate<? super K>[] predicates;
+
+    /** Entry predicate. */
+    private IgnitePredicate<Entry<K, V>> entryPredicate;
+
+    /**
+     * @param map Input map that serves as a base for the view.
+     * @param transformer Transformer for map value transformation.
+     * @param predicates Optional predicates. If predicates are not provided - all will be in the view.
+     */
+    @SuppressWarnings({"unchecked"})
+    public GridSerializableMapReadOnlyClosurePredicateWrapper(Map<K, V> map, IgniteBiClosure<K, V, V1> transformer,
+        IgnitePredicate<? super K>... predicates) {
+        this.map = map;
+        this.transformer = transformer;
+        this.predicates = predicates;
+        entryPredicate = new IgnitePredicateEvaluateEntryByKey(predicates);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V1>> entrySet() {
+        return new GridSerializableSet<Entry<K, V1>>() {
+            @NotNull
+            @Override public Iterator<Entry<K, V1>> iterator() {
+                return new Iterator<Entry<K, V1>>() {
+                    private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, entryPredicate);
+
+                    @Override public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override public Entry<K, V1> next() {
+                        final Entry<K, V> e = it.next();
+
+                        return new Entry<K, V1>() {
+                            @Override public K getKey() {
+                                return e.getKey();
+                            }
+
+                            @Override public V1 getValue() {
+                                return transformer.apply(e.getKey(), e.getValue());
+                            }
+
+                            @Override public V1 setValue(V1 val) {
+                                throw new UnsupportedOperationException(
+                                    "Put is not supported for readonly map view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return F.size(map.keySet(), predicates);
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly map view.");
+            }
+
+            @SuppressWarnings({"unchecked"})
+            @Override public boolean contains(Object o) {
+                return F.isAll((Entry<K, V>)o, entryPredicate) && map.entrySet().contains(o);
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public V1 get(Object key) {
+        if (GridFunc.isAll((K)key, predicates)) {
+            V v = map.get(key);
+
+            if (v != null)
+                return transformer.apply((K)key, v);
+        }
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V1 put(K key, V1 val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V1 remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly map view.");
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, predicates) && map.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableMapReadOnlyClosurePredicateWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
new file mode 100644
index 0000000..10c36ef
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableMapReadOnlyPredicateWrapper.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Iterator;
+import java.util.Set;
+import org.apache.ignite.internal.util.GridSerializableMap;
+import org.apache.ignite.internal.util.GridSerializableSet;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Light-weight view on given map with provided predicates and mapping.
+ *
+ * @param <K> Key type.
+ * @param <V> Value type.
+ */
+public class GridSerializableMapReadOnlyPredicateWrapper<K, V> extends GridSerializableMap<K, V> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Set<K> set;
+
+    /** */
+    private final IgniteClosure<? super K, V> mappingClosure;
+
+    /** */
+    private final IgnitePredicate<? super K>[] predicates;
+
+    /** Entry predicate. */
+    private IgnitePredicate<K> entryPredicate;
+
+    /**
+     * @param set Input collection.
+     * @param mappingClosure Mapping closure, that maps key to value.
+     * @param predicates Optional predicates to filter input collection. If predicates are not provided - all elements
+     * will be in
+     */
+    @SuppressWarnings({"unchecked"})
+    public GridSerializableMapReadOnlyPredicateWrapper(Set<K> set, IgniteClosure<? super K, V> mappingClosure,
+        IgnitePredicate<? super K>... predicates) {
+        this.set = set;
+        this.mappingClosure = mappingClosure;
+        this.predicates = predicates;
+        this.entryPredicate = new IgnitePredicateIsAll(predicates);
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Set<Entry<K, V>> entrySet() {
+        return new GridSerializableSet<Entry<K, V>>() {
+            @NotNull @Override public Iterator<Entry<K, V>> iterator() {
+                return new Iterator<Entry<K, V>>() {
+
+                    private Iterator<K> it = GridFunc.iterator0(set, true, entryPredicate);
+
+                    @Override public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override public Entry<K, V> next() {
+                        final K e = it.next();
+
+                        return new Entry<K, V>() {
+                            @Override public K getKey() {
+                                return e;
+                            }
+
+                            @Override public V getValue() {
+                                return mappingClosure.apply(e);
+                            }
+
+                            @Override public V setValue(V val) {
+                                throw new UnsupportedOperationException(
+                                    "Put is not supported for readonly collection view.");
+                            }
+                        };
+                    }
+
+                    @Override public void remove() {
+                        throw new UnsupportedOperationException(
+                            "Remove is not support for readonly collection view.");
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return F.size(set, predicates);
+            }
+
+            @Override public boolean remove(Object o) {
+                throw new UnsupportedOperationException("Remove is not support for readonly collection view.");
+            }
+
+            @Override public boolean isEmpty() {
+                return !iterator().hasNext();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V get(Object key) {
+        if (containsKey(key))
+            return mappingClosure.apply((K)key);
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public V put(K key, V val) {
+        throw new UnsupportedOperationException("Put is not supported for readonly collection view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public V remove(Object key) {
+        throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean containsKey(Object key) {
+        return GridFunc.isAll((K)key, predicates) && set.contains(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableMapReadOnlyPredicateWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
new file mode 100644
index 0000000..cce95a6
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionPredicateWrapper.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Light-weight view on given collection with provided predicate.
+ *
+ * @param <T1> Element type after transformation.
+ * @param <T2> Element type.
+ */
+public class GridSerializableReadOnlyCollectionPredicateWrapper<T1, T2> extends GridSerializableCollection<T1> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final Collection<? extends T2> collection;
+
+    /** */
+    private final IgniteClosure<? super T2, T1> transformer;
+
+    /** */
+    private final IgnitePredicate<? super T2>[] predicates;
+
+    /**
+     * @param collection Input collection that serves as a base for the view.
+     * @param transformer Transformation closure.
+     * @param predicates Optional predicated. If predicates are not provided - all elements will be in the view.
+     */
+    public GridSerializableReadOnlyCollectionPredicateWrapper(Collection<? extends T2> collection,
+        IgniteClosure<? super T2, T1> transformer, IgnitePredicate<? super T2>... predicates) {
+        this.collection = collection;
+        this.transformer = transformer;
+        this.predicates = predicates;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull @Override public Iterator<T1> iterator() {
+        return F.<T2, T1>iterator(collection, transformer, true, predicates);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return F.isEmpty(predicates) ? collection.size() : F.size(iterator());
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return F.isEmpty(predicates) ? collection.isEmpty() : !iterator().hasNext();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableReadOnlyCollectionPredicateWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
new file mode 100644
index 0000000..3bec907
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyCollectionWrapper.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.GridSerializableIterator;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Collection wrapper.
+ * A read-only view will be created over the element and given
+ * collections and no copying will happen.
+ *
+ * @param <T> Element type.
+ */
+public class GridSerializableReadOnlyCollectionWrapper<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Collection. */
+    private final Collection<T> collection;
+
+    /** First element in the collection. */
+    private final T firstElement;
+
+    /**
+     * @param collection Collection to wrap.
+     * @param firstElement First element.
+     */
+    public GridSerializableReadOnlyCollectionWrapper(@NotNull Collection<T> collection, @NotNull T firstElement) {
+        this.collection = collection;
+        this.firstElement = firstElement;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull
+    @Override public Iterator<T> iterator() {
+        return new GridSerializableIterator<T>() {
+            private Iterator<T> it;
+
+            @Override public boolean hasNext() {
+                return it == null || it.hasNext();
+            }
+
+            @Nullable @Override public T next() {
+                if (it == null) {
+                    it = collection.iterator();
+
+                    return firstElement;
+                }
+
+                return it.next();
+            }
+
+            @Override public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return collection.size() + 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object obj) {
+        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection)obj);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableReadOnlyCollectionWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
new file mode 100644
index 0000000..5747d2c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/GridSerializableReadOnlyTwoCollectionsWrapper.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.GridSerializableIterator;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Collections wrapper.
+ * A read-only view will be created over the element and given
+ * collections and no copying will happen.
+ *
+ * @param <T> Element type.
+ */
+public class GridSerializableReadOnlyTwoCollectionsWrapper<T> extends GridSerializableCollection<T> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** First collection. */
+    private final Collection<T> c1;
+
+    /** SecondCollection. */
+    private final Collection<T> c2;
+
+    /**
+     * @param c1 First collection.
+     * @param c2 SecondCollection.
+     */
+    public GridSerializableReadOnlyTwoCollectionsWrapper(Collection<T> c1, Collection<T> c2) {
+        this.c1 = c1;
+        this.c2 = c2;
+    }
+
+    /** {@inheritDoc} */
+    @NotNull
+    @Override public Iterator<T> iterator() {
+        return new GridSerializableIterator<T>() {
+            private Iterator<T> it1 = c1.iterator();
+            private Iterator<T> it2 = c2.iterator();
+
+            @Override public boolean hasNext() {
+                if (it1 != null)
+                    if (!it1.hasNext())
+                        it1 = null;
+                    else
+                        return true;
+
+                return it2.hasNext();
+            }
+
+            @Override public T next() {
+                return it1 != null ? it1.next() : it2.next();
+            }
+
+            @Override public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean contains(Object o) {
+        return c1.contains(o) || c2.contains(o);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        return c1.size() + c2.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object obj) {
+        return obj instanceof Collection && GridFunc.eqNotOrdered(this, (Collection<?>)obj);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridSerializableReadOnlyTwoCollectionsWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
new file mode 100644
index 0000000..017397d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableArrayListFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Array list factory.
+ */
+public class IgniteCallableArrayListFactory implements IgniteCallable<List> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ArrayList call() {
+        return new ArrayList();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableArrayListFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
new file mode 100644
index 0000000..a935471
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicBooleanFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic boolean factory.
+ */
+public class IgniteCallableAtomicBooleanFactory implements IgniteCallable<AtomicBoolean> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicBoolean call() {
+        return new AtomicBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableAtomicBooleanFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
new file mode 100644
index 0000000..9a8df06
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicIntegerFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic integer factory.
+ */
+public class IgniteCallableAtomicIntegerFactory implements IgniteCallable<AtomicInteger> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicInteger call() {
+        return new AtomicInteger(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableAtomicIntegerFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
new file mode 100644
index 0000000..7499c29
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicLongFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic long factory.
+ */
+public class IgniteCallableAtomicLongFactory implements IgniteCallable<AtomicLong> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicLong call() {
+        return new AtomicLong(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableAtomicLongFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
new file mode 100644
index 0000000..ed0ff58
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableAtomicReferenceFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Atomic reference factory.
+ */
+public class IgniteCallableAtomicReferenceFactory implements IgniteCallable<AtomicReference> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public AtomicReference call() {
+        return new AtomicReference();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableAtomicReferenceFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
new file mode 100644
index 0000000..ca50a0b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashMapFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.concurrent.ConcurrentMap;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+import org.jsr166.ConcurrentHashMap8;
+
+/**
+ * Concurrent hash map factory.
+ */
+public class IgniteCallableConcurrentHashMapFactory implements IgniteCallable<ConcurrentMap> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ConcurrentMap call() {
+        return new ConcurrentHashMap8();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableConcurrentHashMapFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
new file mode 100644
index 0000000..0a52e4d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableConcurrentHashSetFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.GridConcurrentHashSet;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Concurrent hash set factory.
+ */
+public class IgniteCallableConcurrentHashSetFactory implements IgniteCallable<GridConcurrentHashSet> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public GridConcurrentHashSet call() {
+        return new GridConcurrentHashSet();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableConcurrentHashSetFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
new file mode 100644
index 0000000..9dcc3b5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableDequeFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+import org.jsr166.ConcurrentLinkedDeque8;
+
+/**
+ * Deque factory.
+ */
+public class IgniteCallableDequeFactory implements IgniteCallable<ConcurrentLinkedDeque8> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public ConcurrentLinkedDeque8 call() {
+        return new ConcurrentLinkedDeque8();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableDequeFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
new file mode 100644
index 0000000..b361354
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashMapFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Hash map factory.
+ */
+public class IgniteCallableHashMapFactory implements IgniteCallable<Map> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Map call() {
+        return new HashMap();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableHashMapFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
new file mode 100644
index 0000000..22d0d10
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableHashSetFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Hash set factory.
+ */
+public class IgniteCallableHashSetFactory implements IgniteCallable<Set> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Set call() {
+        return new HashSet();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableHashSetFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
new file mode 100644
index 0000000..34c4eab
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteCallableLinkedListFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.LinkedList;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteCallable;
+
+/**
+ * Linked list factory.
+ */
+public class IgniteCallableLinkedListFactory implements IgniteCallable<LinkedList> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public LinkedList call() {
+        return new LinkedList();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteCallableLinkedListFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
new file mode 100644
index 0000000..2fef35e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGet.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Cache entry to get-value transformer closure.
+ */
+public class IgniteClosureCacheGet implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Nullable @Override public Object apply(Object o) {
+        return ((Cache.Entry)o).getValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureCacheGet.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
new file mode 100644
index 0000000..e9cb267
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureCacheGetKey.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Map entry to key transformer closure.
+ */
+public class IgniteClosureCacheGetKey implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Object apply(Object o) {
+        return ((Cache.Entry)o).getKey();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureCacheGetKey.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
new file mode 100644
index 0000000..155b075
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Grid node to node ID transformer closure.
+ */
+public class IgniteClosureClusterNodeGetId implements IgniteClosure<ClusterNode, UUID> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public UUID apply(ClusterNode n) {
+        return n.id();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureClusterNodeGetId.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
new file mode 100644
index 0000000..af1641e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureClusterNodeGetId8.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Grid node to node ID8 transformer closure.
+ */
+public class IgniteClosureClusterNodeGetId8 implements IgniteClosure<ClusterNode, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(ClusterNode n) {
+        return U.id8(n.id());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureClusterNodeGetId8.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
new file mode 100644
index 0000000..52d872a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureIdentity.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * Identity closure.
+ */
+public class IgniteClosureIdentity implements IgniteClosure {
+    /** */
+    private static final long serialVersionUID = -6338573080046225172L;
+
+    /** {@inheritDoc} */
+    @Override public Object apply(Object o) {
+        return o;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureIdentity.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
new file mode 100644
index 0000000..a5adfea
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureToString.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.C1;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Closure that return {@code toString()} value for its free variable.
+ *
+ * @param <T> Type of the free variable for the closure.
+ */
+public class IgniteClosureToString<T> implements C1<T, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(@Nullable T t) {
+        return String.valueOf(t); // This is null-safe.
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureToString.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
new file mode 100644
index 0000000..fc5fc04
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteClosureUUIDToId8Transformer.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteClosure;
+
+/**
+ * UUID to ID8 transformer closure.
+ */
+public class IgniteClosureUUIDToId8Transformer implements IgniteClosure<UUID, String> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public String apply(UUID id) {
+        return U.id8(id);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteClosureUUIDToId8Transformer.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
new file mode 100644
index 0000000..fdf1245
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgniteOutClosureWrapper.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteOutClosure;
+
+/**
+ * Wraps given closure.
+ *
+ * @param <T> Input type.
+ * @param <R> Output type.
+ */
+public class IgniteOutClosureWrapper<T, R> implements IgniteOutClosure<R> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final IgniteClosure<? super T, R> closure;
+
+    /** */
+    private final T closureArgument;
+
+    /**
+     * @param closure Closure
+     * @param closureArgument Parameter
+     */
+    public IgniteOutClosureWrapper(IgniteClosure<? super T, R> closure, T closureArgument) {
+        this.closure = closure;
+        this.closureArgument = closureArgument;
+    }
+
+    /** {@inheritDoc} */
+    @Override public R apply() {
+        return closure.apply(closureArgument);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteOutClosureWrapper.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
new file mode 100644
index 0000000..297e749
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysFalse.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which accepts a parameter and always returns {@code false}
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IgnitePredicateAlwaysFalse<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Predicate body.
+     *
+     * @param e Predicate parameter.
+     * @return Always <code>false</code>
+     */
+    @Override public boolean apply(E e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateAlwaysFalse.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
new file mode 100644
index 0000000..ff0f96e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateAlwaysTrue.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Defines a predicate which accepts a parameter and always returns {@code true}
+ *
+ * @param <E> Type of predicate parameter.
+ */
+public class IgnitePredicateAlwaysTrue<E> implements IgnitePredicate<E> {
+    /** */
+    private static final long serialVersionUID = 6101914246981105862L;
+
+    /**
+     * Predicate body.
+     *
+     * @param e Predicate parameter.
+     * @return Always <code>true</code>.
+     */
+    @Override public boolean apply(E e) {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateAlwaysTrue.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
new file mode 100644
index 0000000..b286f50
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateCacheHasPeek.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import javax.cache.Cache;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Cache entry has-peek-value predicate.
+ */
+public class IgnitePredicateCacheHasPeek implements IgnitePredicate {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @SuppressWarnings({"unchecked"})
+    @Override public boolean apply(Object o) {
+        return ((Cache.Entry)o).getValue() != null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateCacheHasPeek.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9165b0d6/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
new file mode 100644
index 0000000..0911e37
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/IgnitePredicateContainNodeId.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.lang.gridfunc;
+
+import java.util.Collection;
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Grid node predicate evaluating on the given node IDs.
+ */
+public class IgnitePredicateContainNodeId<T extends ClusterNode> implements IgnitePredicate<T> {
+    /** */
+    private static final long serialVersionUID = -5664060422647374863L;
+
+    /** */
+    private final Collection<UUID> nodeIds;
+
+    /**
+     * @param nodeIds (Collection)
+     */
+    public IgnitePredicateContainNodeId(Collection<UUID> nodeIds) {
+        this.nodeIds = nodeIds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode e) {
+        return nodeIds.contains(e.id());
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgnitePredicateContainNodeId.class, this);
+    }
+}


[11/11] ignite git commit: Merge branch 'ignite-3682'

Posted by ag...@apache.org.
Merge branch 'ignite-3682'


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

Branch: refs/heads/master
Commit: 252f004169a6aeee41693efbbeb24e47af2b4be0
Parents: a9ffced 13dbff0
Author: agura <ag...@apache.org>
Authored: Wed Apr 12 18:51:17 2017 +0300
Committer: agura <ag...@apache.org>
Committed: Wed Apr 12 18:51:17 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 1223 ++----------------
 .../ignite/internal/util/lang/GridTupleV.java   |    1 -
 .../lang/gridfunc/AlwaysFalsePredicate.java     |   46 +
 .../util/lang/gridfunc/AlwaysTruePredicate.java |   46 +
 .../util/lang/gridfunc/AlwaysTrueReducer.java   |   56 +
 .../gridfunc/AtomicIntegerFactoryCallable.java  |   40 +
 .../gridfunc/CacheEntryGetValueClosure.java     |   42 +
 .../gridfunc/CacheEntryHasPeekPredicate.java    |   41 +
 .../lang/gridfunc/ClusterNodeGetIdClosure.java  |   41 +
 .../ConcurrentDequeFactoryCallable.java         |   40 +
 .../ConcurrentHashSetFactoryCallable.java       |   40 +
 .../gridfunc/ConcurrentMapFactoryCallable.java  |   41 +
 .../lang/gridfunc/ContainsNodeIdsPredicate.java |   52 +
 .../util/lang/gridfunc/ContainsPredicate.java   |   55 +
 .../gridfunc/EntryByKeyEvaluationPredicate.java |   53 +
 .../gridfunc/EqualsClusterNodeIdPredicate.java  |   51 +
 .../util/lang/gridfunc/EqualsUuidPredicate.java |   50 +
 .../lang/gridfunc/FlatCollectionWrapper.java    |   66 +
 .../util/lang/gridfunc/FlatIterator.java        |  104 ++
 .../util/lang/gridfunc/HasEqualIdPredicate.java |   51 +
 .../lang/gridfunc/HasNotEqualIdPredicate.java   |   51 +
 .../util/lang/gridfunc/IdentityClosure.java     |   39 +
 .../util/lang/gridfunc/IntSumReducer.java       |   51 +
 .../util/lang/gridfunc/IsAllPredicate.java      |   52 +
 .../util/lang/gridfunc/IsNotAllPredicate.java   |   52 +
 .../util/lang/gridfunc/IsNotNullPredicate.java  |   44 +
 .../util/lang/gridfunc/LongSumReducer.java      |   51 +
 .../util/lang/gridfunc/MapFactoryCallable.java  |   41 +
 .../util/lang/gridfunc/MultipleIterator.java    |  106 ++
 .../util/lang/gridfunc/NoOpClosure.java         |   39 +
 .../lang/gridfunc/NotContainsPredicate.java     |   54 +
 .../util/lang/gridfunc/NotEqualPredicate.java   |   53 +
 .../lang/gridfunc/PredicateCollectionView.java  |   78 ++
 .../util/lang/gridfunc/PredicateMapView.java    |  121 ++
 .../util/lang/gridfunc/PredicateSetView.java    |  153 +++
 .../lang/gridfunc/ReadOnlyCollectionView.java   |   95 ++
 .../lang/gridfunc/ReadOnlyCollectionView2X.java |  100 ++
 .../lang/gridfunc/RunnableWrapperClosure.java   |   51 +
 .../util/lang/gridfunc/SetFactoryCallable.java  |   41 +
 .../util/lang/gridfunc/StringConcatReducer.java |   79 ++
 .../util/lang/gridfunc/ToStringClosure.java     |   42 +
 .../lang/gridfunc/TransformCollectionView.java  |   79 ++
 .../gridfunc/TransformFilteringIterator.java    |  138 ++
 .../util/lang/gridfunc/TransformMapView.java    |  168 +++
 .../util/lang/gridfunc/TransformMapView2.java   |  165 +++
 .../util/lang/gridfunc/package-info.java        |   22 +
 .../datastreamer/DataStreamerImplSelfTest.java  |   36 -
 .../h2/GridIndexingSpiAbstractSelfTest.java     |    2 -
 48 files changed, 2996 insertions(+), 1146 deletions(-)
----------------------------------------------------------------------