You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/01/11 16:26:54 UTC

[01/50] [abbrv] ignite git commit: 1.5.1-final-SNAPSHOT

Repository: ignite
Updated Branches:
  refs/heads/ignite-2234 b09b4a333 -> 0f36404f7


1.5.1-final-SNAPSHOT


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

Branch: refs/heads/ignite-2234
Commit: 524d72e2bcb4a813cad25ab6d96b2ddc7ff00c83
Parents: ad5bcec
Author: Ignite Teamcity <ig...@apache.org>
Authored: Mon Dec 21 17:04:46 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Mon Dec 21 17:04:46 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/common/configure.ac                      | 2 +-
 modules/platforms/cpp/core-test/configure.ac                   | 2 +-
 modules/platforms/cpp/core/configure.ac                        | 2 +-
 modules/platforms/cpp/examples/configure.ac                    | 2 +-
 modules/platforms/cpp/ignite/configure.ac                      | 2 +-
 .../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 6 +++---
 .../Properties/AssemblyInfo.cs                                 | 6 +++---
 .../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 6 +++---
 .../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs       | 6 +++---
 .../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs  | 6 +++---
 .../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 6 +++---
 .../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs       | 6 +++---
 12 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/configure.ac b/modules/platforms/cpp/common/configure.ac
index 79ac2a9..5c6743a 100644
--- a/modules/platforms/cpp/common/configure.ac
+++ b/modules/platforms/cpp/common/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite JNI bridge for C++], [1.5.1.10000], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.5.1.7761], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/configure.ac b/modules/platforms/cpp/core-test/configure.ac
index cbd47ff..29ddd15 100644
--- a/modules/platforms/cpp/core-test/configure.ac
+++ b/modules/platforms/cpp/core-test/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Test], [1.5.1.10000], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Test], [1.5.1.7761], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/configure.ac b/modules/platforms/cpp/core/configure.ac
index d028aa1..8fe1017 100644
--- a/modules/platforms/cpp/core/configure.ac
+++ b/modules/platforms/cpp/core/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.5.1.10000], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.5.1.7761], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index 79fc0b4..79555bd 100644
--- a/modules/platforms/cpp/examples/configure.ac
+++ b/modules/platforms/cpp/examples/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Ingnite C++ examples],[1.5.1.10000],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
+AC_INIT([Ingnite C++ examples],[1.5.1.7761],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/cpp/ignite/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/configure.ac b/modules/platforms/cpp/ignite/configure.ac
index b5bd5ee..b0d14dc 100644
--- a/modules/platforms/cpp/ignite/configure.ac
+++ b/modules/platforms/cpp/ignite/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Runner], [1.5.1.10000], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Runner], [1.5.1.7761], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index 456967d..c29d05e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("8fae8395-7e91-411a-a78f-44d6d3fed0fc")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index 20be151..0e5dd87 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,6 +45,6 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index eef598e..311fa79 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 73cc115..e7d8ccd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,9 +33,9 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]
 
 [assembly: CLSCompliant(true)]
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 282640a..cd6f9d4 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index 41782d6..5e1b163 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
 
 [assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/524d72e2/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index e85d425..50c1195 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Reflection;
 
 [assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
 
-[assembly: AssemblyVersion("1.5.0.7768")]
-[assembly: AssemblyFileVersion("1.5.0.7768")]
-[assembly: AssemblyInformationalVersion("1.5.0-final-SNAPSHOT")]
+[assembly: AssemblyVersion("1.5.1.7761")]
+[assembly: AssemblyFileVersion("1.5.1.7761")]
+[assembly: AssemblyInformationalVersion("1.5.1-final-SNAPSHOT")]


[28/50] [abbrv] ignite git commit: IGNITE-2258: Fixed type on getter/setter.

Posted by vo...@apache.org.
IGNITE-2258: Fixed type on getter/setter.


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

Branch: refs/heads/ignite-2234
Commit: e298eab9083dd0f604e314753f7887bfe54ef777
Parents: 4a1a80c
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Dec 29 12:52:00 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Dec 29 12:52:00 2015 +0300

----------------------------------------------------------------------
 .../ignite/configuration/FileSystemConfiguration.java     | 10 +++++-----
 .../apache/ignite/internal/processors/igfs/IgfsImpl.java  |  2 +-
 ...leSystemSecondaryFileSystemInitializationSelfTest.java |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e298eab9/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index 3a9e55e..1a9c0fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -195,7 +195,7 @@ public class FileSystemConfiguration {
         fragmentizerThrottlingBlockLen = cfg.getFragmentizerThrottlingBlockLength();
         fragmentizerThrottlingDelay = cfg.getFragmentizerThrottlingDelay();
         secondaryFs = cfg.getSecondaryFileSystem();
-        initDfltPathModes = cfg.isInitializeDefaultPathsModes();
+        initDfltPathModes = cfg.isInitializeDefaultPathModes();
         ipcEndpointCfg = cfg.getIpcEndpointConfiguration();
         ipcEndpointEnabled = cfg.isIpcEndpointEnabled();
         maxSpace = cfg.getMaxSpaceSize();
@@ -526,7 +526,7 @@ public class FileSystemConfiguration {
      * If path doesn't correspond to any specified prefix or mappings are not provided, then
      * {@link #getDefaultMode()} is used.
      * <p>
-     * If {@link #isInitializeDefaultPathsModes()} is set to {@code true}, the following path modes will be created
+     * If {@link #isInitializeDefaultPathModes()} is set to {@code true}, the following path modes will be created
      * by default:
      * <li>{@code /ignite/primary} and all it's sub-folders will always work in {@code PRIMARY} mode.</li>
      * <p>
@@ -815,18 +815,18 @@ public class FileSystemConfiguration {
      *
      * @return {@code True} if default path modes will be initialized.
      */
-    public boolean isInitializeDefaultPathsModes() {
+    public boolean isInitializeDefaultPathModes() {
         return initDfltPathModes;
     }
 
     /**
      * Set whether to initialize default path modes.
      * <p>
-     * See {@link #isInitializeDefaultPathsModes()} for more information.
+     * See {@link #isInitializeDefaultPathModes()} for more information.
      *
      * @param initDfltPathModes Whether to initialize default path modes.
      */
-    public void setInitializeDefaultPathsModes(boolean initDfltPathModes) {
+    public void setInitializeDefaultPathModes(boolean initDfltPathModes) {
         this.initDfltPathModes = initDfltPathModes;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e298eab9/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 8534513..680e660 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -215,7 +215,7 @@ public final class IgfsImpl implements IgfsEx {
         Map<String, IgfsMode> cfgModes = new LinkedHashMap<>();
         Map<String, IgfsMode> dfltModes = new LinkedHashMap<>(4, 1.0f);
 
-        if (cfg.isInitializeDefaultPathsModes()) {
+        if (cfg.isInitializeDefaultPathModes()) {
             dfltModes.put("/ignite/primary", PRIMARY);
 
             if (secondaryFs != null) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e298eab9/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
index 511c4bb..1b48870 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
@@ -70,7 +70,7 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
         igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512 * 1024);
-        igfsCfg.setInitializeDefaultPathsModes(initDfltPathModes);
+        igfsCfg.setInitializeDefaultPathModes(initDfltPathModes);
 
         IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
 


[34/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: cca90c77f56db5d96f99610ca8dc48f6066ac1b3
Parents: 8e6b365 f1f8cda
Author: Anton Vinogradov <av...@apache.org>
Authored: Wed Dec 30 09:57:01 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Wed Dec 30 09:57:01 2015 +0300

----------------------------------------------------------------------
 assembly/release-fabric-base.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[09/50] [abbrv] ignite git commit: ignite-2168 Examples should destroy created caches. This closes #372.

Posted by vo...@apache.org.
ignite-2168 Examples should destroy created caches. This closes #372.


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

Branch: refs/heads/ignite-2234
Commit: 85fd7e0cdb0e85208ba93a0f68d609d38ac2a4d4
Parents: 36261ad
Author: sboikov <sb...@gridgain.com>
Authored: Thu Dec 24 16:26:39 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Dec 24 16:26:39 2015 +0300

----------------------------------------------------------------------
 .../hibernate/HibernateL2CacheExample.java      | 26 ++++--
 .../hibernate/CacheHibernateStoreExample.java   |  5 ++
 .../store/auto/CacheBinaryAutoStoreExample.java |  1 +
 .../examples/datagrid/CacheAffinityExample.java |  5 ++
 .../examples/datagrid/CacheApiExample.java      |  5 ++
 .../examples/datagrid/CacheAsyncApiExample.java |  5 ++
 .../datagrid/CacheContinuousQueryExample.java   |  5 ++
 .../datagrid/CacheDataStreamerExample.java      |  5 ++
 .../datagrid/CacheEntryProcessorExample.java    |  5 ++
 .../examples/datagrid/CacheEventsExample.java   |  5 ++
 .../examples/datagrid/CacheQueryExample.java    |  6 ++
 .../datagrid/CacheTransactionExample.java       |  6 +-
 .../starschema/CacheStarSchemaExample.java      | 10 ++-
 .../store/auto/CacheAutoStoreExample.java       |  5 ++
 .../store/jdbc/CacheJdbcStoreExample.java       |  5 ++
 .../store/spring/CacheSpringStoreExample.java   |  5 ++
 .../streaming/StreamTransformerExample.java     |  4 +
 .../streaming/StreamVisitorExample.java         | 13 ++-
 .../streaming/wordcount/QueryWords.java         | 51 +++++++-----
 .../socket/WordsSocketStreamerServer.java       | 86 ++++++++++----------
 .../java8/datagrid/CacheAffinityExample.java    |  5 ++
 .../java8/datagrid/CacheApiExample.java         |  5 ++
 .../java8/datagrid/CacheAsyncApiExample.java    |  5 ++
 .../datagrid/CacheEntryProcessorExample.java    |  5 ++
 .../streaming/StreamTransformerExample.java     |  9 +-
 .../java8/streaming/StreamVisitorExample.java   |  5 ++
 26 files changed, 215 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
index 2f271c8..4f399fb 100644
--- a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -92,6 +92,13 @@ public class HibernateL2CacheExample {
     private static final List<String> ENTITY_NAMES =
         Arrays.asList(User.class.getName(), Post.class.getName(), User.class.getName() + ".posts");
 
+    /** Caches' names. */
+    private static final String UPDATE_TIMESTAMPS_CACHE_NAME = "org.hibernate.cache.spi.UpdateTimestampsCache";
+    private static final String STANDART_QUERY_CACHE_NAME = "org.hibernate.cache.internal.StandardQueryCache";
+    private static final String USER_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.User";
+    private static final String USER_POSTS_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.User.posts";
+    private static final String POST_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.Post";
+
     /**
      * Executes example.
      *
@@ -107,13 +114,14 @@ public class HibernateL2CacheExample {
             System.out.println();
             System.out.println(">>> Hibernate L2 cache example started.");
 
+            // Auto-close cache at the end of the example.
             try (
                 // Create all required caches.
-                IgniteCache c1 = createCache("org.hibernate.cache.spi.UpdateTimestampsCache", ATOMIC);
-                IgniteCache c2 = createCache("org.hibernate.cache.internal.StandardQueryCache", ATOMIC);
-                IgniteCache c3 = createCache("org.apache.ignite.examples.datagrid.hibernate.User", TRANSACTIONAL);
-                IgniteCache c4 = createCache("org.apache.ignite.examples.datagrid.hibernate.User.posts", TRANSACTIONAL);
-                IgniteCache c5 = createCache("org.apache.ignite.examples.datagrid.hibernate.Post", TRANSACTIONAL)
+                IgniteCache c1 = createCache(UPDATE_TIMESTAMPS_CACHE_NAME, ATOMIC);
+                IgniteCache c2 = createCache(STANDART_QUERY_CACHE_NAME, ATOMIC);
+                IgniteCache c3 = createCache(USER_CACHE_NAME, TRANSACTIONAL);
+                IgniteCache c4 = createCache(USER_POSTS_CACHE_NAME, TRANSACTIONAL);
+                IgniteCache c5 = createCache(POST_CACHE_NAME, TRANSACTIONAL)
             ) {
                 URL hibernateCfg = ExamplesUtils.url(HIBERNATE_CFG);
 
@@ -183,6 +191,14 @@ public class HibernateL2CacheExample {
                 // a miss.
                 printStats(sesFactory);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(UPDATE_TIMESTAMPS_CACHE_NAME);
+                ignite.destroyCache(STANDART_QUERY_CACHE_NAME);
+                ignite.destroyCache(USER_CACHE_NAME);
+                ignite.destroyCache(USER_POSTS_CACHE_NAME);
+                ignite.destroyCache(POST_CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
index db34eaf..54b692f 100644
--- a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
+++ b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
@@ -103,6 +103,7 @@ public class CacheHibernateStoreExample {
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
                 // Make initial cache loading from persistent store. This is a
                 // distributed operation and will call CacheStore.loadCache(...)
@@ -113,6 +114,10 @@ public class CacheHibernateStoreExample {
                 // read/write-through to persistent store.
                 executeTransaction(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
index 75773cb..c80c87b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
@@ -162,6 +162,7 @@ public class CacheBinaryAutoStoreExample {
                 System.out.println(">>> Loaded cache entries: " + cache.size());
             }
             finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
                 ignite.destroyCache(CACHE_NAME);
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java
index f295ea7..2ec0620 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java
@@ -59,6 +59,7 @@ public final class CacheAffinityExample {
             System.out.println();
             System.out.println(">>> Cache affinity example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 for (int i = 0; i < KEY_CNT; i++)
                     cache.put(i, Integer.toString(i));
@@ -69,6 +70,10 @@ public final class CacheAffinityExample {
                 // Co-locates jobs with data using IgniteCluster.mapKeysToNodes(...) method.
                 visitUsingMapKeysToNodes();
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
index 78221d4..a20ef16 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
@@ -50,10 +50,15 @@ public class CacheApiExample {
             System.out.println();
             System.out.println(">>> Cache API example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 // Demonstrate atomic map operations.
                 atomicMapOperations(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAsyncApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAsyncApiExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAsyncApiExample.java
index a38c133..3699361 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAsyncApiExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAsyncApiExample.java
@@ -51,6 +51,7 @@ public class CacheAsyncApiExample {
             System.out.println();
             System.out.println(">>> Cache asynchronous API example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 // Enable asynchronous mode.
                 IgniteCache<Integer, String> asyncCache = cache.withAsync();
@@ -78,6 +79,10 @@ public class CacheAsyncApiExample {
                     }
                 });
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
index 0ce6e89..59759af 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
@@ -54,6 +54,7 @@ public class CacheContinuousQueryExample {
             System.out.println();
             System.out.println(">>> Cache continuous query example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 int keyCnt = 20;
 
@@ -100,6 +101,10 @@ public class CacheContinuousQueryExample {
                     Thread.sleep(2000);
                 }
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataStreamerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataStreamerExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataStreamerExample.java
index 2357c28..d0000c6 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataStreamerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataStreamerExample.java
@@ -60,6 +60,7 @@ public class CacheDataStreamerExample {
             System.out.println();
             System.out.println(">>> Cache data streamer example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 long start = System.currentTimeMillis();
 
@@ -81,6 +82,10 @@ public class CacheDataStreamerExample {
 
                 System.out.println(">>> Loaded " + ENTRY_COUNT + " keys in " + (end - start) + "ms.");
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
index 38d9631..04c4811 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
@@ -71,6 +71,7 @@ public class CacheEntryProcessorExample {
             System.out.println();
             System.out.println(">>> Entry processor example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 // Demonstrates usage of EntryProcessor.invoke(...) method.
                 populateEntriesWithInvoke(cache);
@@ -78,6 +79,10 @@ public class CacheEntryProcessorExample {
                 // Demonstrates usage of EntryProcessor.invokeAll(...) method.
                 incrementEntriesWithInvokeAll(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java
index b2fdc8c..5ee82ec 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java
@@ -56,6 +56,7 @@ public class CacheEventsExample {
             System.out.println();
             System.out.println(">>> Cache events example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 // This optional local callback is called for each event notification
                 // that passed remote predicate listener.
@@ -92,6 +93,10 @@ public class CacheEventsExample {
                 // Wait for a while while callback is notified about remaining puts.
                 Thread.sleep(2000);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
index 98af93c..9200489 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
@@ -89,6 +89,7 @@ public class CacheQueryExample {
             personCacheCfg.setCacheMode(CacheMode.PARTITIONED); // Default.
             personCacheCfg.setIndexedTypes(AffinityKey.class, Person.class);
 
+            // Auto-close cache at the end of the example.
             try (
                 IgniteCache<Long, Organization> orgCache = ignite.getOrCreateCache(orgCacheCfg);
                 IgniteCache<AffinityKey<Long>, Person> personCache = ignite.getOrCreateCache(personCacheCfg)
@@ -118,6 +119,11 @@ public class CacheQueryExample {
                 // Example for SQL-based fields queries that uses joins.
                 sqlFieldsQueryWithJoin();
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(PERSON_CACHE);
+                ignite.destroyCache(ORG_CACHE);
+            }
 
             print("Cache query example finished.");
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java
index eced5f2..337fcbc 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java
@@ -24,7 +24,6 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.examples.ExampleNodeStartup;
 import org.apache.ignite.transactions.Transaction;
 
@@ -59,6 +58,7 @@ public class CacheTransactionExample {
 
             cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, Account> cache = ignite.getOrCreateCache(cfg)) {
                 // Initialize.
                 cache.put(1, new Account(1, 100));
@@ -80,6 +80,10 @@ public class CacheTransactionExample {
 
                 System.out.println(">>> Cache transaction example finished.");
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
index de58fb8..8424f91 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
@@ -78,10 +78,6 @@ public class CacheStarSchemaExample {
             System.out.println();
             System.out.println(">>> Cache star schema example started.");
 
-            // Destroy caches to clean up the data if any left from previous runs.
-            ignite.destroyCache(PARTITIONED_CACHE_NAME);
-            ignite.destroyCache(REPLICATED_CACHE_NAME);
-
             CacheConfiguration<Integer, FactPurchase> factCacheCfg = new CacheConfiguration<>(PARTITIONED_CACHE_NAME);
 
             factCacheCfg.setCacheMode(CacheMode.PARTITIONED);
@@ -97,6 +93,7 @@ public class CacheStarSchemaExample {
                 Integer.class, DimProduct.class
             );
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, FactPurchase> factCache = ignite.getOrCreateCache(factCacheCfg);
                  IgniteCache<Integer, Object> dimCache = ignite.getOrCreateCache(dimCacheCfg)) {
                 populateDimensions(dimCache);
@@ -105,6 +102,11 @@ public class CacheStarSchemaExample {
                 queryStorePurchases();
                 queryProductPurchases();
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(PARTITIONED_CACHE_NAME);
+                ignite.destroyCache(REPLICATED_CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
index a61752d..37a6725 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
@@ -126,6 +126,7 @@ public class CacheAutoStoreExample {
             System.out.println();
             System.out.println(">>> Cache auto store example started...");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheConfiguration())) {
                 try (Transaction tx = ignite.transactions().txStart()) {
                     Person val = cache.get(id);
@@ -169,6 +170,10 @@ public class CacheAutoStoreExample {
 
                 System.out.println(">>> Loaded cache entries: " + cache.size());
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
index e6584dd..6b8c4b2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
@@ -100,6 +100,7 @@ public class CacheJdbcStoreExample {
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
                 // Make initial cache loading from persistent store. This is a
                 // distributed operation and will call CacheStore.loadCache(...)
@@ -110,6 +111,10 @@ public class CacheJdbcStoreExample {
                 // read/write-through to persistent store.
                 executeTransaction(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
index 5380fce..4bb5d1d 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringStoreExample.java
@@ -99,6 +99,7 @@ public class CacheSpringStoreExample {
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg)) {
                 // Make initial cache loading from persistent store. This is a
                 // distributed operation and will call CacheStore.loadCache(...)
@@ -109,6 +110,10 @@ public class CacheSpringStoreExample {
                 // read/write-through to persistent store.
                 executeTransaction(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
index 2ef5e70..6934ac3 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
@@ -97,6 +97,10 @@ public class StreamTransformerExample {
                 // Print top 10 words.
                 ExamplesUtils.printQueryResults(top10);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(cfg.getName());
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
index 819cfea..29781bc 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
@@ -52,6 +52,10 @@ public class StreamVisitorExample {
     /** The list of initial instrument prices. */
     private static final double[] INITIAL_PRICES = {194.9, 893.49, 34.21, 23.24, 57.93, 45.03, 44.41, 28.44, 378.49, 69.50};
 
+    /** Caches' names. */
+    private static final String CACHE_NAME = "instCache";
+    private static final String MARKET_TICKS_CACHE_NAME = "marketTicks";
+
     public static void main(String[] args) throws Exception {
         // Mark this cluster member as client.
         Ignition.setClientMode(true);
@@ -61,7 +65,7 @@ public class StreamVisitorExample {
                 return;
 
             // Financial instrument cache configuration.
-            CacheConfiguration<String, Instrument> instCfg = new CacheConfiguration<>("instCache");
+            CacheConfiguration<String, Instrument> instCfg = new CacheConfiguration<>(CACHE_NAME);
 
             // Index key and value for querying financial instruments.
             // Note that Instrument class has @QuerySqlField annotation for secondary field indexing.
@@ -69,7 +73,7 @@ public class StreamVisitorExample {
 
             // Auto-close caches at the end of the example.
             try (
-                IgniteCache<String, Double> mktCache = ignite.getOrCreateCache("marketTicks"); // Default config.
+                IgniteCache<String, Double> mktCache = ignite.getOrCreateCache(MARKET_TICKS_CACHE_NAME); // Default config.
                 IgniteCache<String, Instrument> instCache = ignite.getOrCreateCache(instCfg)
             ) {
                 try (IgniteDataStreamer<String, Double> mktStmr = ignite.dataStreamer(mktCache.getName())) {
@@ -140,6 +144,11 @@ public class StreamVisitorExample {
                 // Print top 10 words.
                 ExamplesUtils.printQueryResults(top3);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+                ignite.destroyCache(MARKET_TICKS_CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
index 034c0c2..c1ce6e1 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
@@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.affinity.AffinityUuid;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.examples.ExampleNodeStartup;
 import org.apache.ignite.examples.ExamplesUtils;
 
@@ -50,35 +51,41 @@ public class QueryWords {
             if (!ExamplesUtils.hasServerNodes(ignite))
                 return;
 
-            // The cache is configured with sliding window holding 1 second of the streaming data.
-            IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+            CacheConfiguration<AffinityUuid, String> cfg = CacheConfig.wordCache();
 
-            // Select top 10 words.
-            SqlFieldsQuery top10Qry = new SqlFieldsQuery(
-                "select _val, count(_val) as cnt from String group by _val order by cnt desc limit 10",
-                true /*collocated*/
-            );
+            // The cache is configured with sliding window holding 1 second of the streaming data.
+            try (IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(cfg)) {
+                // Select top 10 words.
+                SqlFieldsQuery top10Qry = new SqlFieldsQuery(
+                    "select _val, count(_val) as cnt from String group by _val order by cnt desc limit 10",
+                    true /*collocated*/
+                );
 
-            // Select average, min, and max counts among all the words.
-            SqlFieldsQuery statsQry = new SqlFieldsQuery(
-                "select avg(cnt), min(cnt), max(cnt) from (select count(_val) as cnt from String group by _val)");
+                // Select average, min, and max counts among all the words.
+                SqlFieldsQuery statsQry = new SqlFieldsQuery(
+                    "select avg(cnt), min(cnt), max(cnt) from (select count(_val) as cnt from String group by _val)");
 
-            // Query top 10 popular numbers every 5 seconds.
-            while (true) {
-                // Execute queries.
-                List<List<?>> top10 = stmCache.query(top10Qry).getAll();
-                List<List<?>> stats = stmCache.query(statsQry).getAll();
+                // Query top 10 popular numbers every 5 seconds.
+                while (true) {
+                    // Execute queries.
+                    List<List<?>> top10 = stmCache.query(top10Qry).getAll();
+                    List<List<?>> stats = stmCache.query(statsQry).getAll();
 
-                // Print average count.
-                List<?> row = stats.get(0);
+                    // Print average count.
+                    List<?> row = stats.get(0);
 
-                if (row.get(0) != null)
-                    System.out.printf("Query results [avg=%.2f, min=%d, max=%d]%n", row.get(0), row.get(1), row.get(2));
+                    if (row.get(0) != null)
+                        System.out.printf("Query results [avg=%.2f, min=%d, max=%d]%n", row.get(0), row.get(1), row.get(2));
 
-                // Print top 10 words.
-                ExamplesUtils.printQueryResults(top10);
+                    // Print top 10 words.
+                    ExamplesUtils.printQueryResults(top10);
 
-                Thread.sleep(5000);
+                    Thread.sleep(5000);
+                }
+            }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(cfg.getName());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
index 814d235..35db059 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
@@ -27,6 +27,7 @@ import org.apache.ignite.IgniteDataStreamer;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.affinity.AffinityUuid;
+import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.examples.ExampleNodeStartup;
 import org.apache.ignite.examples.ExamplesUtils;
 import org.apache.ignite.examples.streaming.wordcount.CacheConfig;
@@ -69,63 +70,64 @@ public class WordsSocketStreamerServer {
         // Mark this cluster member as client.
         Ignition.setClientMode(true);
 
-        Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
+        CacheConfiguration<AffinityUuid, String> cfg = CacheConfig.wordCache();
 
-        if (!ExamplesUtils.hasServerNodes(ignite)) {
-            ignite.close();
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
 
-            return;
-        }
-
-        // The cache is configured with sliding window holding 1 second of the streaming data.
-        IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+            if (!ExamplesUtils.hasServerNodes(ignite))
+                return;
 
-        IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
+            // The cache is configured with sliding window holding 1 second of the streaming data.
+            try (IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(cfg)) {
 
-        InetAddress addr = InetAddress.getLocalHost();
+                IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
 
-        // Configure socket streamer
-        SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
+                InetAddress addr = InetAddress.getLocalHost();
 
-        sockStmr.setAddr(addr);
+                // Configure socket streamer
+                SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
 
-        sockStmr.setPort(PORT);
+                sockStmr.setAddr(addr);
 
-        sockStmr.setDelimiter(DELIM);
+                sockStmr.setPort(PORT);
 
-        sockStmr.setIgnite(ignite);
+                sockStmr.setDelimiter(DELIM);
 
-        sockStmr.setStreamer(stmr);
+                sockStmr.setIgnite(ignite);
 
-        // Converter from zero-terminated string to Java strings.
-        sockStmr.setConverter(new SocketMessageConverter<String>() {
-            @Override public String convert(byte[] msg) {
-                try {
-                    return new String(msg, "ASCII");
-                }
-                catch (UnsupportedEncodingException e) {
-                    throw new IgniteException(e);
-                }
-            }
-        });
+                sockStmr.setStreamer(stmr);
 
-        sockStmr.setSingleTupleExtractor(new StreamSingleTupleExtractor<String, AffinityUuid, String>() {
-            @Override public Map.Entry<AffinityUuid, String> extract(String word) {
-                // By using AffinityUuid we ensure that identical
-                // words are processed on the same cluster node.
-                return new IgniteBiTuple<>(new AffinityUuid(word), word);
-            }
-        });
+                // Converter from zero-terminated string to Java strings.
+                sockStmr.setConverter(new SocketMessageConverter<String>() {
+                    @Override public String convert(byte[] msg) {
+                        try {
+                            return new String(msg, "ASCII");
+                        }
+                        catch (UnsupportedEncodingException e) {
+                            throw new IgniteException(e);
+                        }
+                    }
+                });
 
-        try {
-            sockStmr.start();
-        }
-        catch (IgniteException e) {
-            System.err.println("Streaming server didn't start due to an error: ");
+                sockStmr.setSingleTupleExtractor(new StreamSingleTupleExtractor<String, AffinityUuid, String>() {
+                    @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+                        // By using AffinityUuid we ensure that identical
+                        // words are processed on the same cluster node.
+                        return new IgniteBiTuple<>(new AffinityUuid(word), word);
+                    }
+                });
 
-            e.printStackTrace();
+                sockStmr.start();
+            }
+            catch (IgniteException e) {
+                System.err.println("Streaming server didn't start due to an error: ");
 
-            ignite.close();
+                e.printStackTrace();
+            }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(cfg.getName());
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
index 9d9bacc..fbf348f 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
@@ -66,6 +66,7 @@ public final class CacheAffinityExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg)) {
                 for (int i = 0; i < KEY_CNT; i++)
                     cache.put(i, Integer.toString(i));
@@ -76,6 +77,10 @@ public final class CacheAffinityExample {
                 // Co-locates jobs with data using IgniteCluster.mapKeysToNodes(...) method.
                 visitUsingMapKeysToNodes();
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
index cca1812..b78003b 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
@@ -55,10 +55,15 @@ public class CacheApiExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg)) {
                 // Demonstrate atomic map operations.
                 atomicMapOperations(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
index 2ad5640..ac80fb6 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
@@ -57,6 +57,7 @@ public class CacheAsyncApiExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg)) {
                 // Enable asynchronous mode.
                 IgniteCache<Integer, String> asyncCache = cache.withAsync();
@@ -80,6 +81,10 @@ public class CacheAsyncApiExample {
                 asyncCache.<String>future().listen(fut ->
                     System.out.println("Get operation completed [value=" + fut.get() + ']'));
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
index fd07fa5..24633a8 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
@@ -69,6 +69,7 @@ public class CacheEntryProcessorExample {
             System.out.println();
             System.out.println(">>> Entry processor example started.");
 
+            // Auto-close cache at the end of the example.
             try (IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(CACHE_NAME)) {
                 // Demonstrates usage of EntryProcessor.invoke(...) method.
                 populateEntriesWithInvoke(cache);
@@ -76,6 +77,10 @@ public class CacheEntryProcessorExample {
                 // Demonstrates usage of EntryProcessor.invokeAll(...) method.
                 incrementEntriesWithInvokeAll(cache);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamTransformerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamTransformerExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamTransformerExample.java
index 1f0039f..358faff 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamTransformerExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamTransformerExample.java
@@ -46,6 +46,9 @@ public class StreamTransformerExample {
     /** Range within which to generate numbers. */
     private static final int RANGE = 1000;
 
+    /** Cache name. */
+    private static final String CACHE_NAME = "randomNumbers";
+
     public static void main(String[] args) throws Exception {
         // Mark this cluster member as client.
         Ignition.setClientMode(true);
@@ -54,7 +57,7 @@ public class StreamTransformerExample {
             if (!ExamplesUtils.hasServerNodes(ignite))
                 return;
 
-            CacheConfiguration<Integer, Long> cfg = new CacheConfiguration<>("randomNumbers");
+            CacheConfiguration<Integer, Long> cfg = new CacheConfiguration<>(CACHE_NAME);
 
             // Index key and value.
             cfg.setIndexedTypes(Integer.class, Long.class);
@@ -96,6 +99,10 @@ public class StreamTransformerExample {
                 // Print top 10 words.
                 ExamplesUtils.printQueryResults(top10);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(CACHE_NAME);
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/85fd7e0c/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamVisitorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamVisitorExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamVisitorExample.java
index a250d5e..bbb4f76 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamVisitorExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/StreamVisitorExample.java
@@ -121,6 +121,11 @@ public class StreamVisitorExample {
                 // Print top 10 words.
                 ExamplesUtils.printQueryResults(top3);
             }
+            finally {
+                // Distributed cache could be removed from cluster only by #destroyCache() call.
+                ignite.destroyCache(mktDataCfg.getName());
+                ignite.destroyCache(instCfg.getName());
+            }
         }
     }
 


[30/50] [abbrv] ignite git commit: IGNITE-2235: Replaced ConcurrentLinkedDeque8 with ConcurrentLinkedQueue in GridNioServer.

Posted by vo...@apache.org.
IGNITE-2235: Replaced ConcurrentLinkedDeque8 with ConcurrentLinkedQueue in GridNioServer.


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

Branch: refs/heads/ignite-2234
Commit: 2613b9581736d8c10eac0ac3250910e76f9600b5
Parents: e298eab
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Dec 29 15:29:19 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Dec 29 15:29:19 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java     | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2613b958/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 17a0b8f..c366fe3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -41,8 +41,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Queue;
 import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
@@ -65,7 +66,6 @@ import org.apache.ignite.plugin.extensions.communication.Message;
 import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.apache.ignite.thread.IgniteThread;
 import org.jetbrains.annotations.Nullable;
-import org.jsr166.ConcurrentLinkedDeque8;
 import sun.nio.ch.DirectBuffer;
 
 import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.ACK_CLOSURE;
@@ -1105,7 +1105,9 @@ public class GridNioServer<T> {
          */
         private void writeSslSystem(GridSelectorNioSessionImpl ses, WritableByteChannel sockCh)
             throws IOException {
-            ConcurrentLinkedDeque8<ByteBuffer> queue = ses.meta(BUF_SSL_SYSTEM_META_KEY);
+            ConcurrentLinkedQueue<ByteBuffer> queue = ses.meta(BUF_SSL_SYSTEM_META_KEY);
+
+            assert queue != null;
 
             ByteBuffer buf;
 
@@ -1244,7 +1246,7 @@ public class GridNioServer<T> {
      */
     private abstract class AbstractNioClientWorker extends GridWorker {
         /** Queue of change requests on this selector. */
-        private final Queue<NioOperationFuture> changeReqs = new ConcurrentLinkedDeque8<>();
+        private final ConcurrentLinkedQueue<NioOperationFuture> changeReqs = new ConcurrentLinkedQueue<>();
 
         /** Selector to select read events. */
         private Selector selector;
@@ -2105,7 +2107,7 @@ public class GridNioServer<T> {
         /** {@inheritDoc} */
         @Override public void onSessionOpened(GridNioSession ses) throws IgniteCheckedException {
             if (directMode && sslFilter != null)
-                ses.addMeta(BUF_SSL_SYSTEM_META_KEY, new ConcurrentLinkedDeque8<>());
+                ses.addMeta(BUF_SSL_SYSTEM_META_KEY, new ConcurrentLinkedQueue<>());
 
             proceedSessionOpened(ses);
         }
@@ -2126,7 +2128,9 @@ public class GridNioServer<T> {
                 boolean sslSys = sslFilter != null && msg instanceof ByteBuffer;
 
                 if (sslSys) {
-                    ConcurrentLinkedDeque8<ByteBuffer> queue = ses.meta(BUF_SSL_SYSTEM_META_KEY);
+                    ConcurrentLinkedQueue<ByteBuffer> queue = ses.meta(BUF_SSL_SYSTEM_META_KEY);
+
+                    assert queue != null;
 
                     queue.offer((ByteBuffer)msg);
 


[44/50] [abbrv] ignite git commit: Revert "IGNITE-2330: Simplified GridFunc."

Posted by vo...@apache.org.
Revert "IGNITE-2330: Simplified GridFunc."

This reverts commit 80579253febd6389dbb3a84706671cc8083df1f2.


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

Branch: refs/heads/ignite-2234
Commit: ddbe2d596e5aaf0b04a26c584dfe2ca8a664c570
Parents: cd5cd2e
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jan 3 23:49:09 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jan 3 23:49:09 2016 +0400

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |   27 +-
 .../internal/cluster/ClusterGroupAdapter.java   |   10 +-
 .../discovery/GridDiscoveryManager.java         |   19 +-
 .../loadbalancer/GridLoadBalancerManager.java   |    8 +-
 .../processors/cache/GridCacheAdapter.java      |   14 +-
 .../processors/cache/GridCacheContext.java      |    3 +-
 .../cache/GridCacheEvictionManager.java         |    5 +-
 .../processors/cache/GridCacheIoManager.java    |    5 +-
 .../processors/cache/GridCacheIterator.java     |    4 +-
 .../processors/cache/GridCacheKeySet.java       |    2 +-
 .../GridCachePartitionExchangeManager.java      |   12 +-
 .../processors/cache/GridCacheProcessor.java    |    9 +-
 .../processors/cache/GridCacheSwapManager.java  |    7 +-
 .../processors/cache/GridCacheUtils.java        |   92 -
 .../cache/GridCacheValueCollection.java         |    5 +-
 .../processors/cache/IgniteCacheProxy.java      |    4 +-
 .../dht/GridClientPartitionTopology.java        |    3 +-
 .../dht/GridDhtPartitionTopologyImpl.java       |    3 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |    3 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |    3 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |    5 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   21 +-
 .../dht/preloader/GridDhtForceKeysFuture.java   |    8 +-
 .../distributed/near/GridNearCacheAdapter.java  |   11 +-
 .../local/atomic/GridLocalAtomicCache.java      |   17 +-
 .../GridCacheAtomicStampedImpl.java             |    5 +-
 .../internal/processors/igfs/IgfsProcessor.java |    8 +-
 .../dotnet/PlatformDotNetCacheStore.java        |    4 +-
 .../top/GridTopologyCommandHandler.java         |    3 +-
 .../org/apache/ignite/internal/util/F0.java     |  325 +++-
 .../internal/util/GridExecutionStatistics.java  |    4 +-
 .../ignite/internal/util/IgniteUtils.java       |    4 +-
 .../ignite/internal/util/lang/GridFunc.java     | 1764 ++++++++++++++----
 .../ignite/internal/util/lang/GridTuple3.java   |    1 +
 .../ignite/internal/util/lang/GridTuple4.java   |    1 +
 .../ignite/internal/util/lang/GridTuple5.java   |    1 +
 .../ignite/internal/util/lang/GridTuple6.java   |    1 +
 .../ignite/internal/util/lang/GridTupleV.java   |    1 +
 .../java/org/apache/ignite/lang/IgniteUuid.java |    2 +-
 .../memory/MemoryEventStorageSpi.java           |    1 -
 .../cache/GridCacheLuceneQueryIndexTest.java    |    4 +-
 .../distributed/GridCacheEventAbstractTest.java |    2 +-
 .../IpcSharedMemoryCrashDetectionSelfTest.java  |   16 +-
 .../ignite/lang/GridBasicPerformanceTest.java   |   10 +-
 .../ignite/lang/GridFuncPerformanceTest.java    |  102 +
 .../ignite/loadtest/GridLoadTestStatistics.java |    2 +-
 .../query/h2/opt/GridH2TreeIndex.java           |    4 +-
 47 files changed, 1988 insertions(+), 577 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 7fc0313..14b5816 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -589,16 +589,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
     @Override public List<String> getLifecycleBeansFormatted() {
         LifecycleBean[] beans = cfg.getLifecycleBeans();
 
-        if (F.isEmpty(beans))
-            return Collections.emptyList();
-        else {
-            List<String> res = new ArrayList<>(beans.length);
-
-            for (LifecycleBean bean : beans)
-                res.add(String.valueOf(bean));
-
-            return res;
-        }
+        return F.isEmpty(beans) ? Collections.<String>emptyList() :
+            (List<String>)F.transform(beans, F.<LifecycleBean>string());
     }
 
     /**
@@ -2277,19 +2269,16 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         Collection<Object> objs = new ArrayList<>();
 
         if (!F.isEmpty(cfg.getLifecycleBeans()))
-            Collections.addAll(objs, cfg.getLifecycleBeans());
+            F.copy(objs, cfg.getLifecycleBeans());
 
         if (!F.isEmpty(cfg.getSegmentationResolvers()))
-            Collections.addAll(objs, cfg.getSegmentationResolvers());
+            F.copy(objs, cfg.getSegmentationResolvers());
 
-        if (cfg.getConnectorConfiguration() != null) {
-            objs.add(cfg.getConnectorConfiguration().getMessageInterceptor());
-            objs.add(cfg.getConnectorConfiguration().getSslContextFactory());
-        }
+        if (cfg.getConnectorConfiguration() != null)
+            F.copy(objs, cfg.getConnectorConfiguration().getMessageInterceptor(),
+                cfg.getConnectorConfiguration().getSslContextFactory());
 
-        objs.add(cfg.getMarshaller());
-        objs.add(cfg.getGridLogger());
-        objs.add(cfg.getMBeanServer());
+        F.copy(objs, cfg.getMarshaller(), cfg.getGridLogger(), cfg.getMBeanServer());
 
         return objs;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index a153b83..75168a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -51,7 +51,6 @@ import org.apache.ignite.internal.IgniteServicesImpl;
 import org.apache.ignite.internal.IgnitionEx;
 import org.apache.ignite.internal.executor.GridExecutorService;
 import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
-import org.apache.ignite.internal.util.lang.GridNodePredicate;
 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;
@@ -368,7 +367,8 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
         guard();
 
         try {
-            ctx.resource().injectGeneric(p);
+            if (p != null)
+                ctx.resource().injectGeneric(p);
 
             return new ClusterGroupAdapter(ctx, subjId, this.p != null ? F.and(p, this.p) : p);
         }
@@ -703,7 +703,6 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         gridName = U.readString(in);
         subjId = U.readUuid(in);
@@ -920,7 +919,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
 
                 ClusterNode node = isOldest ? U.oldest(super.nodes(), null) : U.youngest(super.nodes(), null);
 
-                IgnitePredicate<ClusterNode> p = new GridNodePredicate(node);
+                IgnitePredicate<ClusterNode> p = F.nodeForNodes(node);
 
                 state = new AgeClusterGroupState(node, p, lastTopVer);
             }
@@ -962,7 +961,8 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
             guard();
 
             try {
-                ctx.resource().injectGeneric(p);
+                if (p != null)
+                    ctx.resource().injectGeneric(p);
 
                 return new ClusterGroupAdapter(ctx, this.subjId, new GroupPredicate(this, p));
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 844fd0f..72a2bef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -30,6 +30,7 @@ import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -78,6 +79,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.jobmetrics.GridJobMetrics;
 import org.apache.ignite.internal.processors.security.SecurityContext;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridBoundedConcurrentOrderedMap;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -1315,26 +1317,13 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
     }
 
     /**
-     * Gets collection of node for given node IDs.
-     *
-     * @param ids Ids to include.
-     * @return Collection with all alive nodes for given IDs.
-     */
-    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids) {
-        return F.isEmpty(ids) ? Collections.<ClusterNode>emptyList() :
-            F.view(
-                F.viewReadOnly(ids, U.id2Node(ctx)),
-                F.notNull());
-    }
-
-    /**
      * Gets collection of node for given node IDs and predicates.
      *
      * @param ids Ids to include.
      * @param p Filter for IDs.
      * @return Collection with all alive nodes for given IDs.
      */
-    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids, IgnitePredicate<UUID> p) {
+    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids, IgnitePredicate<UUID>... p) {
         return F.isEmpty(ids) ? Collections.<ClusterNode>emptyList() :
             F.view(
                 F.viewReadOnly(ids, U.id2Node(ctx), p),
@@ -2576,7 +2565,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
             nearEnabledCaches = Collections.unmodifiableSet(nearEnabledSet);
 
             daemonNodes = Collections.unmodifiableList(new ArrayList<>(
-                F.view(F.concat(false, loc, rmts), F.not(daemonFilter))));
+                F.view(F.concat(false, loc, rmts), F0.not(daemonFilter))));
 
             Map<UUID, ClusterNode> nodeMap = new HashMap<>(allNodes().size() + daemonNodes.size(), 1.0f);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
index efe09b0..631168b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.managers.loadbalancer;
 
 import java.util.Collection;
-import java.util.LinkedList;
 import java.util.List;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -93,12 +92,7 @@ public class GridLoadBalancerManager extends GridManagerAdapter<LoadBalancingSpi
                 if (F.isEmpty(exclNodes))
                     return GridLoadBalancerManager.this.getBalancedNode(ses, top, job);
 
-                List<ClusterNode> nodes = new LinkedList<>();
-
-                for (ClusterNode topNode : top) {
-                    if (!exclNodes.contains(topNode))
-                        nodes.add(topNode);
-                }
+                List<ClusterNode> nodes = F.loseList(top, true, exclNodes);
 
                 if (nodes.isEmpty())
                     return null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index a4cf737..5d4c386 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -106,6 +106,7 @@ import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.GridClosureException;
 import org.apache.ignite.internal.util.lang.GridTriple;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.C2;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.CI2;
@@ -2149,7 +2150,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size() == 1) {
             @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx)
                 throws IgniteCheckedException {
-                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
+                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys,
+                    new C1<K, EntryProcessor<K, V, Object>>() {
+                            @Override public EntryProcessor apply(K k) {
+                            return entryProcessor;
+                        }
+                    });
 
                 IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap, args);
 
@@ -2216,7 +2222,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp(keys) {
             @Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) {
-                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
+                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor<K, V, Object>>() {
+                    @Override public EntryProcessor apply(K k) {
+                        return entryProcessor;
+                    }
+                });
 
                 return tx.invokeAsync(ctx, invokeMap, args);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index ef49567..c10ebf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -85,6 +85,7 @@ import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
 import org.apache.ignite.internal.processors.offheap.GridOffHeapProcessor;
 import org.apache.ignite.internal.processors.plugin.CachePluginManager;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.lang.GridFunc;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -1511,7 +1512,7 @@ public class GridCacheContext<K, V> implements Externalizable {
             Collection<ClusterNode> nearNodes = null;
 
             if (!F.isEmpty(readers)) {
-                nearNodes = discovery().nodes(readers, F.notEqualTo(nearNodeId));
+                nearNodes = discovery().nodes(readers, F0.notEqualTo(nearNodeId));
 
                 if (log.isDebugEnabled())
                     log.debug("Mapping entry to near nodes [nodes=" + U.nodeIds(nearNodes) + ", entry=" + entry + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index f542f4b..845e204 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -63,6 +63,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridBusyLock;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridUnsafe;
@@ -1309,7 +1310,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
                 try {
                     GridCacheVersion ver = e.version();
 
-                    return info.version().equals(ver) && F.isAll(e, info.filter());
+                    return info.version().equals(ver) && F.isAll(info.filter());
                 }
                 catch (GridCacheEntryRemovedException ignored) {
                     return false;
@@ -1340,7 +1341,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
         Collection<ClusterNode> backups;
 
         if (evictSync)
-            backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F.notEqualTo(cctx.localNode()));
+            backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F0.notEqualTo(cctx.localNode()));
         else
             backups = Collections.emptySet();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 4c9cdf2..0aa8b1b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -57,6 +57,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPr
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryRequest;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryResponse;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.GridSpinReadWriteLock;
 import org.apache.ignite.internal.util.typedef.CI1;
@@ -730,7 +731,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 }
 
                 if (added) {
-                    if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
+                    if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
                         if (log.isDebugEnabled())
                             log.debug("Message will not be sent because all nodes left topology [msg=" + msg +
                                 ", nodes=" + U.toShortString(nodes) + ']');
@@ -766,7 +767,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     U.sleep(retryDelay);
                 }
 
-                if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
+                if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
                     if (log.isDebugEnabled())
                         log.debug("Message will not be sent because all nodes left topology [msg=" + msg + ", nodes=" +
                             U.toShortString(nodes) + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
index e4a471c..19da4a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
@@ -19,8 +19,6 @@ package org.apache.ignite.internal.processors.cache;
 
 import java.util.Iterator;
 import javax.cache.Cache;
-
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridSerializableIterator;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteClosure;
@@ -59,7 +57,7 @@ public class GridCacheIterator<K, V, T> implements GridSerializableIterator<T> {
     ) {
         this.cctx = cctx;
 
-        it = F.identityIterator(c, F0.and(filter));
+        it = F.iterator0(c, false, filter);
 
         this.trans = trans;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
index af0c704..6d18b7d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
@@ -66,7 +66,7 @@ public class GridCacheKeySet<K, V> extends GridSerializableSet<K> {
 
     /** {@inheritDoc} */
     @Override public Iterator<K> iterator() {
-        return new GridCacheIterator<>(ctx, map.values(), CU.<K, V>cacheEntry2Key(), filter);
+        return new GridCacheIterator<>(ctx, map.values(), F.<K, V>cacheEntry2Key(), filter);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 4732597..a0f7f93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -80,7 +80,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiInClosure;
-import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.thread.IgniteThread;
@@ -1271,16 +1270,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                     }
 
                     // After workers line up and before preloading starts we initialize all futures.
-                    if (log.isDebugEnabled()) {
-                        IgnitePredicate p = new IgnitePredicate<IgniteInternalFuture<?>>() {
-                            @Override public boolean apply(IgniteInternalFuture<?> f) {
-                                return !f.isDone();
-                            }
-                        };
-
+                    if (log.isDebugEnabled())
                         log.debug("Before waiting for exchange futures [futs" +
-                            F.view(exchFuts.values(), p) + ", worker=" + this + ']');
-                    }
+                            F.view(exchFuts.values(), F.unfinishedFutures()) + ", worker=" + this + ']');
 
                     // Take next exchange future.
                     exchFut = poll(futQ, timeout, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index f6fc9d4..ff02e70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -96,6 +96,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
 import org.apache.ignite.internal.processors.plugin.CachePluginManager;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1159,12 +1160,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 log.debug("Executed onKernalStart() callback for DHT cache: " + dht.name());
         }
 
-        Collection<GridCacheManager> excluded = dhtExcludes(ctx);
-
-        for (GridCacheManager mgr : ctx.managers()) {
-            if (!excluded.contains(mgr))
-                mgr.onKernalStart();
-        }
+        for (GridCacheManager mgr : F.view(ctx.managers(), F0.notContains(dhtExcludes(ctx))))
+            mgr.onKernalStart();
 
         cache.onKernalStart();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 4490f63..37b5e15 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.processors.offheap.GridOffHeapProcessor;
 import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyCloseableIterator;
+import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.GridWeakIterator;
 import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.lang.GridTuple;
@@ -1580,7 +1581,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
      */
     public <K, V> Iterator<Map.Entry<K, V>> lazySwapIterator() throws IgniteCheckedException {
         if (!swapEnabled)
-            return F.emptyIterator();
+            return new GridEmptyIterator<>();
 
         return lazyIterator(cctx.gridSwap().rawIterator(spaceName));
     }
@@ -1671,7 +1672,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
     private <K, V> Iterator<Map.Entry<K, V>> lazyIterator(
         final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it) {
         if (it == null)
-            return F.emptyIterator();
+            return new GridEmptyIterator<>();
 
         checkIteratorQueue();
 
@@ -1742,7 +1743,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
     private Iterator<KeyCacheObject> keyIterator(
         final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it) {
         if (it == null)
-            return F.emptyIterator();
+            return new GridEmptyIterator<>();
 
         checkIteratorQueue();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index b7baf7e..51f6dcd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -43,8 +43,6 @@ import javax.cache.configuration.Factory;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.integration.CacheWriterException;
-import javax.cache.processor.EntryProcessor;
-
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
@@ -286,41 +284,6 @@ public class GridCacheUtils {
         }
     };
 
-    /** */
-    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
-        @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getKey();
-        }
-
-        @Override public String toString() {
-            return "Map entry to key transformer closure.";
-        }
-    };
-
-    /** */
-    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
-        @SuppressWarnings({"unchecked"})
-        @Nullable @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getValue();
-        }
-
-        @Override public String toString() {
-            return "Cache entry to get-value transformer closure.";
-        }
-    };
-
-    /** */
-    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;
-        }
-
-        @Override public String toString() {
-            return "Cache entry has-peek-value predicate.";
-        }
-    };
-
     /**
      * Ensure singleton.
      */
@@ -1900,59 +1863,4 @@ public class GridCacheUtils {
 
         return res;
     }
-
-    /**
-     * Create invoke map for the given key set. All provided values will be set to the passed entry processor.
-     *
-     * @param keys Keys.
-     * @param entryProc Entry processor.
-     * @return Invoke map.
-     */
-    @SuppressWarnings("unchecked")
-    public static <K, V, T> Map<? extends K, EntryProcessor<K, V, Object>> invokeMap(
-        final Set<? extends K> keys, final EntryProcessor<K, V, T> entryProc) {
-        return F.viewAsMap(keys,
-            new C1<K, EntryProcessor<K, V, Object>>() {
-                @Override public EntryProcessor apply(K k) {
-                    return entryProc;
-                }
-            });
-    }
-
-    /**
-     * 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.
-     *
-     * @param <K> Key type.
-     * @param <V> Value type.
-     * @return Closure that returns value for an entry.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> IgniteClosure<Cache.Entry<K, V>, V> cacheEntry2Get() {
-        return (IgniteClosure<Cache.Entry<K, V>, V>)CACHE_ENTRY_VAL_GET;
-    }
-
-    /**
-     * Gets predicate which returns {@code true} if entry has peek value.
-     *
-     * @param <K> Cache key type.
-     * @param <V> Cache value type.
-     * @return Predicate which returns {@code true} if entry has peek value.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheHasPeekValue() {
-        return (IgnitePredicate<Cache.Entry<K, V>>)CACHE_ENTRY_HAS_PEEK_VAL;
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
index 68b54b3..2d1686e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridSerializableCollection;
 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.CU;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.jetbrains.annotations.Nullable;
 
@@ -73,8 +72,8 @@ public class GridCacheValueCollection<K, V> extends GridSerializableCollection<V
         return new GridCacheIterator<K, V, V>(
             ctx,
             map.values(),
-            CU.<K, V>cacheEntry2Get(),
-            ctx.vararg(F0.and(filter, CU.<K, V>cacheHasPeekValue()))
+            F.<K, V>cacheEntry2Get(),
+            ctx.vararg(F0.and(filter, F.<K, V>cacheHasPeekValue()))
         ) {
             {
                 advance();

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index a6e0ea8..27a7587 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -69,6 +69,7 @@ import org.apache.ignite.internal.processors.cache.query.CacheQuery;
 import org.apache.ignite.internal.processors.cache.query.CacheQueryFuture;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
+import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.lang.GridClosureException;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;
@@ -76,7 +77,6 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.CX1;
-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.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -579,7 +579,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
 
             return new QueryCursor<Cache.Entry<K, V>>() {
                 @Override public Iterator<Cache.Entry<K, V>> iterator() {
-                    return cur != null ? cur.iterator() : F.<Cache.Entry<K, V>>emptyIterator();
+                    return cur != null ? cur.iterator() : new GridEmptyIterator<Cache.Entry<K, V>>();
                 }
 
                 @Override public List<Cache.Entry<K, V>> getAll() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
index 9c18ad0..8aef5ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -697,7 +698,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
 
             // Remove obsolete mappings.
             if (cur != null) {
-                for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
+                for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
                     Set<UUID> ids = part2node.get(p);
 
                     if (ids != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index cdf0fc2..a0709c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -1054,7 +1055,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
 
             // Remove obsolete mappings.
             if (cur != null) {
-                for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
+                for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
                     Set<UUID> ids = part2node.get(p);
 
                     if (ids != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 2b40436..ae24ed1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -60,6 +60,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.lang.GridClosureException;
@@ -1381,7 +1382,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
         Collection<ClusterNode> nearNodes = null;
 
         if (!F.isEmpty(readers)) {
-            nearNodes = ctx.discovery().nodes(readers, F.not(F.idForNodeId(nodeId)));
+            nearNodes = ctx.discovery().nodes(readers, F0.not(F.idForNodeId(nodeId)));
 
             if (log.isDebugEnabled())
                 log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) + ", entry=" + cached +

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 1fe3ae2..534a560 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
@@ -640,7 +641,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
             // Otherwise, during rollback we will not know whether locks need
             // to be rolled back.
             // Loose all skipped and previously locked (we cannot reenter locks here).
-            final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F.notIn(skipped)) : keys;
+            final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F0.notIn(skipped)) : keys;
 
             if (log.isDebugEnabled())
                 log.debug("Lock keys: " + passedKeys);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 23fdbf5..d8b2f37 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -61,6 +61,7 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.dr.GridDrType;
 import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
 import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1303,14 +1304,14 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
 
                 if (!F.isEmpty(readers)) {
                     Collection<ClusterNode> nearNodes =
-                        cctx.discovery().nodes(readers, F.not(F.idForNodeId(tx.nearNodeId())));
+                        cctx.discovery().nodes(readers, F0.not(F.idForNodeId(tx.nearNodeId())));
 
                     if (log.isDebugEnabled())
                         log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) +
                             ", entry=" + entry + ']');
 
                     // Exclude DHT nodes.
-                    map(entry, F.view(nearNodes, F.notIn(dhtNodes)), nearMap);
+                    map(entry, F.view(nearNodes, F0.notIn(dhtNodes)), nearMap);
                 }
                 else if (log.isDebugEnabled())
                     log.debug("Entry has no near readers: " + entry);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index e0b108b..393413e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -77,10 +77,12 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSing
 import org.apache.ignite.internal.processors.cache.dr.GridCacheDrExpirationInfo;
 import org.apache.ignite.internal.processors.cache.dr.GridCacheDrInfo;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
+import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionConflictContext;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -410,9 +412,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
-        A.notNull(key, "key", val, "val");
+        A.notNull(key, "key");
 
-        return updateAllAsync0(F.asMap(key, val),
+        return updateAllAsync0(F0.asMap(key, val),
             null,
             null,
             null,
@@ -426,9 +428,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
-        A.notNull(key, "key", val, "val");
+        A.notNull(key, "key");
 
-        return updateAllAsync0(F.asMap(key, val),
+        return updateAllAsync0(F0.asMap(key, val),
             null,
             null,
             null,
@@ -443,7 +445,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     @Override public V tryPutIfAbsent(K key, V val) throws IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
-        return (V)updateAllAsync0(F.asMap(key, val),
+        return (V)updateAllAsync0(F0.asMap(key, val),
             null,
             null,
             null,
@@ -793,13 +795,18 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync(Set<? extends K> keys,
-        EntryProcessor<K, V, T> entryProcessor, Object... args) {
+        final EntryProcessor<K, V, T> entryProcessor,
+        Object... args) {
         A.notNull(keys, "keys", entryProcessor, "entryProcessor");
 
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
+        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
+            @Override public EntryProcessor apply(K k) {
+                return entryProcessor;
+            }
+        });
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
index 6b03131..7970a44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
@@ -43,6 +43,7 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -520,11 +521,8 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
             if (!cctx.rebalanceEnabled()) {
                 Collection<KeyCacheObject> retryKeys = F.view(
                     keys,
-                    F.and(
-                        F.notIn(missedKeys),
-                        F.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key()))
-                    )
-                );
+                    F0.notIn(missedKeys),
+                    F0.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key())));
 
                 if (!retryKeys.isEmpty())
                     map(retryKeys, F.concat(false, node, exc));

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 5c48dc7..5bf18d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -64,7 +64,6 @@ import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
 import org.apache.ignite.internal.util.typedef.internal.A;
-import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteBiPredicate;
 import org.jetbrains.annotations.NotNull;
@@ -417,7 +416,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
 
     /** {@inheritDoc} */
     @Override public Collection<V> values(CacheEntryPredicate... filter) {
-        return new GridCacheValueCollection<>(ctx, entrySet(filter), ctx.vararg(CU.<K, V>cacheHasPeekValue()));
+        return new GridCacheValueCollection<>(ctx, entrySet(filter), ctx.vararg(F.<K, V>cacheHasPeekValue()));
     }
 
     /** {@inheritDoc} */
@@ -559,12 +558,12 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
         /** {@inheritDoc} */
         @NotNull @Override public Iterator<Cache.Entry<K, V>> iterator() {
             return new EntryIterator(nearSet.iterator(),
-                F.identityIterator(dhtSet, new P1<Cache.Entry<K, V>>() {
-                    @Override
-                    public boolean apply(Cache.Entry<K, V> e) {
+                F.iterator0(dhtSet, false, new P1<Cache.Entry<K, V>>() {
+                    @Override public boolean apply(Cache.Entry<K, V> e) {
                         try {
                             return GridNearCacheAdapter.super.localPeek(e.getKey(), NEAR_PEEK_MODE, null) == null;
-                        } catch (IgniteCheckedException ex) {
+                        }
+                        catch (IgniteCheckedException ex) {
                             throw new IgniteException(ex);
                         }
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 3b60f96..6130ead 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -60,6 +60,7 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -188,7 +189,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
     @Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F.asMap(key, val),
+        return updateAllAsync0(F0.asMap(key, val),
             null,
             null,
             true,
@@ -201,7 +202,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
     @Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F.asMap(key, val),
+        return updateAllAsync0(F0.asMap(key, val),
             null,
             null,
             false,
@@ -658,7 +659,11 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
+        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
+            @Override public EntryProcessor apply(K k) {
+                return entryProcessor;
+            }
+        });
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 
@@ -724,7 +729,11 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
+        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
+            @Override public EntryProcessor apply(K k) {
+                return entryProcessor;
+            }
+        });
 
         return updateAllAsync0(null,
             invokeMap,

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index 84c4269..f7a82a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -30,6 +30,7 @@ import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -178,8 +179,8 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(internalCompareAndSet(F.equalTo(expVal), wrapperClosure(newVal),
-                F.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
+            return CU.outTx(internalCompareAndSet(F0.equalTo(expVal), wrapperClosure(newVal),
+                F0.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index b313084..5b8cf86 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -45,6 +45,7 @@ import org.apache.ignite.internal.IgniteNodeAttributes;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.ipc.IpcServerEndpoint;
 import org.apache.ignite.internal.util.typedef.C1;
+import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -127,8 +128,11 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 
         final Map<String, CacheConfiguration> cacheCfgs = new HashMap<>();
 
-        for (CacheConfiguration c : gridCfg.getCacheConfiguration())
-            cacheCfgs.put(c.getName(), c);
+        F.forEach(gridCfg.getCacheConfiguration(), new CI1<CacheConfiguration>() {
+            @Override public void apply(CacheConfiguration c) {
+                cacheCfgs.put(c.getName(), c);
+            }
+        });
 
         Collection<IgfsAttributes> attrVals = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
index 9f0fd3f..7e65c22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
@@ -235,13 +235,13 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
                         @Override public Set<Entry<K, V>> entrySet() {
                             return new AbstractSet<Entry<K, V>>() {
                                 @Override public Iterator<Entry<K, V>> iterator() {
-                                    return F.iteratorReadOnly(entries, new C1<Cache.Entry<? extends K, ? extends V>, Entry<K, V>>() {
+                                    return F.iterator(entries, new C1<Cache.Entry<? extends K, ? extends V>, Entry<K, V>>() {
                                         private static final long serialVersionUID = 0L;
 
                                         @Override public Entry<K, V> apply(Cache.Entry<? extends K, ? extends V> entry) {
                                             return new GridMapEntry<>(entry.getKey(), entry.getValue());
                                         }
-                                    });
+                                    }, true);
                                 }
 
                                 @Override public int size() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 5e12199..297785e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -135,7 +135,8 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter {
                 }
                 else
                     node = F.find(ctx.discovery().allNodes(), null, new P1<ClusterNode>() {
-                        @Override public boolean apply(ClusterNode n) {
+                        @Override
+                        public boolean apply(ClusterNode n) {
                             return containsIp(n.addresses(), ip);
                         }
                     });

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
index b819226..7e9e448 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.internal.util;
 
+import java.util.Collection;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.IgniteCheckedException;
@@ -25,9 +27,11 @@ import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
 import org.apache.ignite.internal.processors.cache.CacheEntrySerializablePredicate;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
+import org.apache.ignite.internal.util.lang.GridFunc;
 import org.apache.ignite.internal.util.lang.GridNodePredicate;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
+import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.jetbrains.annotations.Nullable;
@@ -38,6 +42,79 @@ import org.jetbrains.annotations.Nullable;
  */
 public class F0 {
     /**
+     * Negates given predicates.
+     * <p>
+     * Gets predicate (not peer-deployable) that evaluates to {@code true} if any of given predicates
+     * evaluates to {@code false}. If all predicates evaluate to {@code true} the
+     * result predicate will evaluate to {@code false}.
+     *
+     * @param p Predicate to negate.
+     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+     * @return Negated predicate (not peer-deployable).
+     */
+    public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
+        return F.isAlwaysFalse(p) ? F.<T>alwaysTrue() : F.isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                return !F.isAll(t, p);
+            }
+        };
+    }
+
+    /**
+     * Gets predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
+     * to {@code target} or both are {@code null}.
+     *
+     * @param target Object to compare free variable to.
+     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+     * @return Predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
+     *      to {@code target} or both are {@code null}.
+     */
+    public static <T> IgnitePredicate<T> notEqualTo(@Nullable final T target) {
+        return new P1<T>() {
+            @Override public boolean apply(T t) {
+                return !F.eq(t, target);
+            }
+        };
+    }
+
+    /**
+     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable
+     * is not contained in given collection.
+     *
+     * @param c Collection to check for containment.
+     * @param <T> Type of the free variable for the predicate and type of the
+     *      collection elements.
+     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is not
+     *      contained in given collection.
+     */
+    public static <T> IgnitePredicate<T> notIn(@Nullable final Collection<? extends T> c) {
+        return F.isEmpty(c) ? GridFunc.<T>alwaysTrue() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                assert c != null;
+
+                return !c.contains(t);
+            }
+        };
+    }
+
+    /**
+     * Gets predicate (not perr-deployable) that evaluates to {@code true} if its free variable is equal
+     * to {@code target} or both are {@code null}.
+     *
+     * @param target Object to compare free variable to.
+     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+     * @return Predicate that evaluates to {@code true} if its free variable is equal to
+     *      {@code target} or both are {@code null}.
+     */
+    public static <T> IgnitePredicate<T> equalTo(@Nullable final T target) {
+        return new P1<T>() {
+            @Override public boolean apply(T t) {
+                return F.eq(t, target);
+            }
+        };
+    }
+
+    /**
      * @param p1 Filter1.
      * @param p2 Filter2.
      * @return And filter.
@@ -56,12 +133,16 @@ public class F0 {
         if (e1 && e2)
             return CU.alwaysTrue0();
 
-        if (e1) {
+        if (e1 && !e2) {
+            assert p2 != null;
+
             if (p2.length == 1)
                 return p2[0];
         }
 
-        if (e2) {
+        if (!e1 && e2) {
+            assert p1 != null;
+
             if (p1.length == 1)
                 return p1[0];
         }
@@ -69,12 +150,16 @@ public class F0 {
         return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
             @Override public boolean apply(GridCacheEntryEx e) {
                 if (!e1) {
+                    assert p1 != null;
+
                     for (CacheEntryPredicate p : p1)
                         if (p != null && !p.apply(e))
                             return false;
                 }
 
                 if (!e2) {
+                    assert p2 != null;
+
                     for (CacheEntryPredicate p : p2)
                         if (p != null && !p.apply(e))
                             return false;
@@ -101,11 +186,15 @@ public class F0 {
 
             @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
                 if (!e1) {
+                    assert p1 != null;
+
                     for (CacheEntryPredicate p : p1)
                         p.prepareMarshal(ctx);
                 }
 
                 if (!e2) {
+                    assert p2 != null;
+
                     for (CacheEntryPredicate p : p2)
                         p.prepareMarshal(ctx);
                 }
@@ -114,6 +203,63 @@ public class F0 {
     }
 
     /**
+     * @param p Filter1.
+     * @param ps Filter2.
+     * @return And filter.
+     */
+    public static CacheEntryPredicate and0(
+        @Nullable final CacheEntryPredicate p,
+        @Nullable final CacheEntryPredicate... ps) {
+        if (p == null && F.isEmptyOrNulls(ps))
+            return CU.alwaysTrue0();
+
+        if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
+            return CU.alwaysFalse0();
+
+        if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
+            return CU.alwaysTrue0();
+
+        return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
+            @Override public boolean apply(GridCacheEntryEx e) {
+                assert ps != null;
+
+                if (p != null && !p.apply(e))
+                    return false;
+
+                for (CacheEntryPredicate p : ps) {
+                    if (p != null && !p.apply(e))
+                        return false;
+                }
+
+                return true;
+            }
+
+            @Override public void entryLocked(boolean locked) {
+                assert ps != null;
+
+                if (p != null)
+                    p.entryLocked(locked);
+
+                for (CacheEntryPredicate p : ps) {
+                    if (p != null)
+                        p.entryLocked(locked);
+                }
+            }
+
+            @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
+                assert ps != null;
+
+                if (p != null)
+                    p.prepareMarshal(ctx);
+
+                for (CacheEntryPredicate p : ps)
+                    if (p != null)
+                        p.prepareMarshal(ctx);
+            }
+        });
+    }
+
+    /**
      * Get a predicate (non peer-deployable) that evaluates to {@code true} if each of its component predicates
      * evaluates to {@code true}. The components are evaluated in order they are supplied.
      * Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
@@ -141,12 +287,16 @@ public class F0 {
         if (e1 && e2)
             return F.alwaysTrue();
 
-        if (e1) {
+        if (e1 && !e2) {
+            assert p2 != null;
+
             if (p2.length == 1)
                 return (IgnitePredicate<T>)p2[0];
         }
 
-        if (e2) {
+        if (!e1 && e2) {
+            assert p1 != null;
+
             if (p1.length == 1)
                 return (IgnitePredicate<T>)p1[0];
         }
@@ -155,11 +305,15 @@ public class F0 {
             Set<UUID> ids = new GridLeanSet<>();
 
             if (!e1) {
+                assert p1 != null;
+
                 for (IgnitePredicate<? super T> p : p1)
                     ids.addAll(((GridNodePredicate)p).nodeIds());
             }
 
             if (!e2) {
+                assert p2 != null;
+
                 for (IgnitePredicate<? super T> p : p2)
                     ids.addAll(((GridNodePredicate)p).nodeIds());
             }
@@ -171,12 +325,16 @@ public class F0 {
             return new P1<T>() {
                 @Override public boolean apply(T t) {
                     if (!e1) {
+                        assert p1 != null;
+
                         for (IgnitePredicate<? super T> p : p1)
                             if (p != null && !p.apply(t))
                                 return false;
                     }
 
                     if (!e2) {
+                        assert p2 != null;
+
                         for (IgnitePredicate<? super T> p : p2)
                             if (p != null && !p.apply(t))
                                 return false;
@@ -189,6 +347,148 @@ public class F0 {
     }
 
     /**
+     * Get a predicate (not peer-deployable) that evaluates to {@code true} if each of its component predicates
+     * evaluates to {@code true}. The components are evaluated in order they are supplied.
+     * Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
+     * Passed in predicates are NOT copied. If no predicates are passed in the returned
+     * predicate will always evaluate to {@code false}.
+     *
+     * @param ps Passed in predicate. If none provided - always-{@code false} predicate is
+     *      returned.
+     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+     * @return Predicate that evaluates to {@code true} if each of its component predicates
+     *      evaluates to {@code true}.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> IgnitePredicate<T> and(
+        @Nullable final IgnitePredicate<? super T> p,
+        @Nullable final IgnitePredicate<? super T>... ps
+    ) {
+        if (p == null && F.isEmptyOrNulls(ps))
+            return F.alwaysTrue();
+
+        if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
+            return F.alwaysFalse();
+
+        if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
+            return F.alwaysTrue();
+
+        if (isAllNodePredicates(p) && isAllNodePredicates(ps)) {
+            assert ps != null;
+
+            Set<UUID> ids = new GridLeanSet<>();
+
+            for (IgnitePredicate<? super T> p0 : ps) {
+                Collection<UUID> list = ((GridNodePredicate)p0).nodeIds();
+
+                if (ids.isEmpty())
+                    ids.addAll(list);
+                else
+                    ids.retainAll(list);
+            }
+
+            Collection<UUID> list = ((GridNodePredicate)p).nodeIds();
+
+            if (ids.isEmpty())
+                ids.addAll(list);
+            else
+                ids.retainAll(list);
+
+            // T must be <T extends GridNode>.
+            return (IgnitePredicate<T>)new GridNodePredicate(ids);
+        }
+        else {
+            return new P1<T>() {
+                @Override public boolean apply(T t) {
+                    assert ps != null;
+
+                    if (p != null && !p.apply(t))
+                        return false;
+
+                    for (IgnitePredicate<? super T> p : ps)
+                        if (p != null && !p.apply(t))
+                            return false;
+
+                    return true;
+                }
+            };
+        }
+    }
+
+    /**
+     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
+     * in given collection.
+     *
+     * @param c Collection to check for containment.
+     * @param <T> Type of the free variable for the predicate and type of the
+     *      collection elements.
+     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
+     *      contained in given collection.
+     */
+    public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
+        return F.isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                assert c != null;
+
+                return c.contains(t);
+            }
+        };
+    }
+
+    /**
+     * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
+     * that is contained in the passed in collection.
+     *
+     * @param c Collection used for predicate filter.
+     * @param <T> Element type.
+     * @return Predicate which returns {@code true} if it receives an element
+     *  that is contained in the passed in collection.
+     */
+    public static <T> IgnitePredicate<T> contains(@Nullable final Collection<T> c) {
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysFalse() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                return c.contains(t);
+            }
+        };
+    }
+
+    /**
+     * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
+     * that is not contained in the passed in collection.
+     *
+     * @param c Collection used for predicate filter.
+     * @param <T> Element type.
+     * @return Predicate which returns {@code true} if it receives an element
+     *  that is not contained in the passed in collection.
+     */
+    public static <T> IgnitePredicate<T> notContains(@Nullable final Collection<T> c) {
+        return c == null || c.isEmpty() ? GridFunc.<T>alwaysTrue() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                return !c.contains(t);
+            }
+        };
+    }
+
+    /**
+     * Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
+     *
+     * @param ps Collection of predicates to test.
+     * @return {@code True} if all passed in predicates are instances of {@link GridNodePredicate} class.
+     */
+    public static boolean isAllNodePredicates(@Nullable Iterable<? extends IgnitePredicate<?>> ps) {
+        if (F.isEmpty(ps))
+            return false;
+
+        assert ps != null;
+
+        for (IgnitePredicate<?> p : ps)
+            if (!(p instanceof GridNodePredicate))
+                return false;
+
+        return true;
+    }
+
+    /**
      * Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
      *
      * @param ps Collection of predicates to test.
@@ -198,10 +498,27 @@ public class F0 {
         if (F.isEmpty(ps))
             return false;
 
+        assert ps != null;
+
         for (IgnitePredicate<?> p : ps)
             if (!(p instanceof GridNodePredicate))
                 return false;
 
         return true;
     }
+
+    /**
+     * Creates map with given values, adding a strict not-null check for value.
+     *
+     * @param key Key.
+     * @param val Value.
+     * @param <K> Key's type.
+     * @param <V> Value's type.
+     * @return Created map.
+     */
+    public static <K, V> Map<K, V> asMap(K key, V val) {
+        A.notNull(val, "val");
+
+        return F.asMap(key, val);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
index fc2e3a2..a23fe28 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
@@ -71,13 +71,13 @@ public class GridExecutionStatistics {
 
         long time = startTime.get().get2();
 
-        AtomicInteger cnt = F.addIfAbsent(cntMap, name, new AtomicInteger());
+        AtomicInteger cnt = F.addIfAbsent(cntMap, name, F.newAtomicInt());
 
         assert cnt != null;
 
         cnt.incrementAndGet();
 
-        AtomicLong d = F.addIfAbsent(durationMap, name, new AtomicLong());
+        AtomicLong d = F.addIfAbsent(durationMap, name, F.newAtomicLong());
 
         assert d != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index a92ccab..480859d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8508,7 +8508,7 @@ public abstract class IgniteUtils {
             throw new IgniteCheckedException("Addresses can not be resolved [addr=" + addrs +
                 ", hostNames=" + hostNames + ']');
 
-        return Collections.unmodifiableList(res);
+        return F.viewListReadOnly(res, F.<InetAddress>identity());
     }
 
     /**
@@ -8555,7 +8555,7 @@ public abstract class IgniteUtils {
             res.add(new InetSocketAddress(addr, port));
         }
 
-        return Collections.unmodifiableList(res);
+        return F.viewListReadOnly(res, F.<InetSocketAddress>identity());
     }
 
     /**


[50/50] [abbrv] ignite git commit: Merge branch 'master' into ignite-2234

Posted by vo...@apache.org.
Merge branch 'master' into ignite-2234


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

Branch: refs/heads/ignite-2234
Commit: 0f36404f74fc70d8228a652ae5f1e13aad059f75
Parents: b09b4a3 10012b4
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 11 18:27:23 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 11 18:27:23 2016 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  11 +
 README.md                                       | 194 ++++++
 RELEASE_NOTES.txt                               |   2 +
 assembly/release-fabric-base.xml                |   7 +
 assembly/release-sources.xml                    |  79 +++
 doap_Ignite.rdf                                 |  67 ++
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 .../hibernate/HibernateL2CacheExample.java      |  26 +-
 .../hibernate/CacheHibernateStoreExample.java   |   5 +
 .../store/auto/CacheBinaryAutoStoreExample.java |   1 +
 .../examples/datagrid/CacheAffinityExample.java |   5 +
 .../examples/datagrid/CacheApiExample.java      |   5 +
 .../examples/datagrid/CacheAsyncApiExample.java |   5 +
 .../datagrid/CacheContinuousQueryExample.java   |   5 +
 .../datagrid/CacheDataStreamerExample.java      |   5 +
 .../datagrid/CacheEntryProcessorExample.java    |   5 +
 .../examples/datagrid/CacheEventsExample.java   |   5 +
 .../examples/datagrid/CacheQueryExample.java    |   6 +
 .../datagrid/CacheTransactionExample.java       |   6 +-
 .../starschema/CacheStarSchemaExample.java      |  10 +-
 .../store/auto/CacheAutoStoreExample.java       |   5 +
 .../store/jdbc/CacheJdbcStoreExample.java       |   5 +
 .../store/spring/CacheSpringStoreExample.java   |   5 +
 .../streaming/StreamTransformerExample.java     |   4 +
 .../streaming/StreamVisitorExample.java         |  13 +-
 .../streaming/wordcount/QueryWords.java         |  51 +-
 .../socket/WordsSocketStreamerServer.java       |  86 +--
 .../java8/datagrid/CacheAffinityExample.java    |   5 +
 .../java8/datagrid/CacheApiExample.java         |   5 +
 .../java8/datagrid/CacheAsyncApiExample.java    |   5 +
 .../datagrid/CacheEntryProcessorExample.java    |   5 +
 .../streaming/StreamTransformerExample.java     |   9 +-
 .../java8/streaming/StreamVisitorExample.java   |   5 +
 modules/aop/pom.xml                             |   4 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |   4 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../configuration/FileSystemConfiguration.java  |  54 +-
 .../org/apache/ignite/igfs/IgfsUserContext.java |  16 +-
 .../igfs/secondary/IgfsSecondaryFileSystem.java |  14 -
 .../apache/ignite/internal/IgniteKernal.java    |   7 +-
 .../ignite/internal/IgniteNodeAttributes.java   |   3 +
 .../GridDistributedTxRemoteAdapter.java         |  12 +-
 .../dht/CacheDistributedGetFutureAdapter.java   |  10 +-
 .../distributed/dht/GridDhtTxFinishFuture.java  |  15 +-
 .../cache/distributed/dht/GridDhtTxLocal.java   |  31 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  48 +-
 .../dht/GridPartitionedGetFuture.java           |   2 +-
 .../distributed/near/GridNearGetFuture.java     |   2 +-
 ...arOptimisticSerializableTxPrepareFuture.java |  94 +--
 .../near/GridNearOptimisticTxPrepareFuture.java |  63 +-
 .../GridNearPessimisticTxPrepareFuture.java     |   6 +-
 .../cache/distributed/near/GridNearTxLocal.java |  69 +-
 .../near/GridNearTxPrepareFutureAdapter.java    |   8 +-
 .../cache/local/GridLocalLockFuture.java        |  19 +-
 .../cache/transactions/IgniteTxAdapter.java     |  24 +-
 .../cache/transactions/IgniteTxEntry.java       |  12 +-
 .../transactions/IgniteTxLocalAdapter.java      |  38 +-
 .../version/GridCachePlainVersionedEntry.java   |   2 +-
 .../processors/hadoop/HadoopPayloadAware.java   |  28 +
 .../ignite/internal/processors/igfs/IgfsEx.java |  13 -
 .../internal/processors/igfs/IgfsImpl.java      |  28 +-
 .../internal/processors/igfs/IgfsPaths.java     |  62 +-
 .../igfs/IgfsSecondaryFileSystemImpl.java       |  11 -
 .../platform/PlatformAbstractTarget.java        |  17 +-
 .../processors/platform/PlatformTarget.java     |  22 +
 .../platform/compute/PlatformCompute.java       |  34 +-
 .../platform/utils/PlatformFutureUtils.java     | 119 +++-
 .../platform/utils/PlatformListenable.java      |  47 ++
 .../processors/rest/GridRestProcessor.java      |   4 +
 .../rest/client/message/GridClientNodeBean.java |   4 +-
 .../ignite/internal/util/IgniteUtils.java       |  40 ++
 .../ignite/internal/util/lang/GridFunc.java     |   3 +
 .../ignite/internal/util/nio/GridNioServer.java |  16 +-
 .../visor/node/VisorIgfsConfiguration.java      |  43 --
 .../plugin/security/AuthenticationContext.java  |  33 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../internal/GridUpdateNotifierSelfTest.java    |   2 +-
 .../cache/IgniteCacheStoreCollectionTest.java   | 163 +++++
 ...eAbstractDataStructuresFailoverSelfTest.java | 311 +++------
 .../processors/igfs/IgfsAbstractSelfTest.java   |   8 +-
 .../igfs/IgfsExUniversalFileSystemAdapter.java  |  11 +-
 .../igfs/UniversalFileSystemAdapter.java        |   5 +-
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |  10 +-
 modules/hadoop/pom.xml                          |   2 +-
 .../hadoop/fs/BasicHadoopFileSystemFactory.java | 209 ++++++
 .../fs/CachingHadoopFileSystemFactory.java      |  86 +++
 .../hadoop/fs/HadoopFileSystemFactory.java      |  52 ++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 264 +++----
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    | 149 ++--
 .../hadoop/fs/v2/IgniteHadoopFileSystem.java    | 115 ++--
 .../processors/hadoop/HadoopClassLoader.java    | 689 ++++++++++++++-----
 .../hadoop/SecondaryFileSystemProvider.java     | 139 ----
 .../hadoop/fs/HadoopFileSystemCacheUtils.java   |   8 +-
 .../hadoop/fs/HadoopLazyConcurrentMap.java      |   5 +-
 .../hadoop/v2/HadoopNativeCodeLoader.java       |  74 --
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |  14 +-
 .../igfs/HadoopFIleSystemFactorySelfTest.java   | 326 +++++++++
 ...oopFileSystemUniversalFileSystemAdapter.java |  53 +-
 ...oopSecondaryFileSystemConfigurationTest.java |  27 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |  71 +-
 ...condaryFileSystemInitializationSelfTest.java | 214 ++++++
 .../hadoop/HadoopAbstractWordCountTest.java     |  46 +-
 .../hadoop/HadoopClassLoaderTest.java           | 101 ++-
 .../hadoop/HadoopMapReduceEmbeddedSelfTest.java |   2 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |  15 +-
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |  28 +
 .../processors/hadoop/HadoopSnappyTest.java     | 102 +++
 .../processors/hadoop/HadoopTasksV2Test.java    |   2 +-
 .../hadoop/deps/CircularWIthHadoop.java         |  32 +
 .../hadoop/deps/CircularWithoutHadoop.java      |  27 +
 .../processors/hadoop/deps/WithCast.java        |  41 ++
 .../hadoop/deps/WithClassAnnotation.java        |  28 +
 .../hadoop/deps/WithConstructorInvocation.java  |  31 +
 .../processors/hadoop/deps/WithExtends.java     |  27 +
 .../processors/hadoop/deps/WithField.java       |  29 +
 .../processors/hadoop/deps/WithImplements.java  |  36 +
 .../hadoop/deps/WithIndirectField.java          |  27 +
 .../processors/hadoop/deps/WithInitializer.java |  33 +
 .../processors/hadoop/deps/WithInnerClass.java  |  31 +
 .../hadoop/deps/WithLocalVariable.java          |  38 +
 .../hadoop/deps/WithMethodAnnotation.java       |  32 +
 .../hadoop/deps/WithMethodArgument.java         |  31 +
 .../hadoop/deps/WithMethodCheckedException.java |  31 +
 .../hadoop/deps/WithMethodInvocation.java       |  31 +
 .../hadoop/deps/WithMethodReturnType.java       |  31 +
 .../hadoop/deps/WithMethodRuntimeException.java |  31 +
 .../processors/hadoop/deps/WithOuterClass.java  |  38 +
 .../hadoop/deps/WithParameterAnnotation.java    |  31 +
 .../processors/hadoop/deps/WithStaticField.java |  29 +
 .../hadoop/deps/WithStaticInitializer.java      |  34 +
 .../processors/hadoop/deps/Without.java         |  25 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   1 +
 .../hadoop/examples/HadoopWordCount2.java       |  18 +-
 .../examples/HadoopWordCount2Reducer.java       |   1 +
 .../testsuites/IgniteHadoopTestSuite.java       |  26 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |  10 +-
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |   4 +
 modules/jcl/pom.xml                             |   4 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   4 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 modules/osgi-karaf/pom.xml                      |   6 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |  10 +-
 modules/platforms/cpp/DEVNOTES.txt              |  59 ++
 modules/platforms/cpp/README.txt                |  64 +-
 modules/platforms/cpp/common/configure.ac       |   2 +-
 .../cpp/common/include/ignite/common/exports.h  |   7 +-
 .../cpp/common/include/ignite/common/java.h     |  13 +-
 .../platforms/cpp/common/project/vs/module.def  |   6 +-
 modules/platforms/cpp/common/src/exports.cpp    |  20 +-
 modules/platforms/cpp/common/src/java.cpp       |  70 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 modules/platforms/cpp/project/vs/ignite.sln     |   6 +-
 modules/platforms/cpp/project/vs/ignite.slnrel  |  10 +
 .../platforms/cpp/project/vs/ignite_x86.slnrel  |  10 +
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Compute/ComputeApiTest.cs                   |  20 +
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Apache.Ignite.Core.csproj                   |   2 +
 .../Common/IgniteFutureCancelledException.cs    |  65 ++
 .../Apache.Ignite.Core/Compute/ICompute.cs      | 233 +++++++
 .../Impl/Common/CancelledTask.cs                |  47 ++
 .../Apache.Ignite.Core/Impl/Common/Future.cs    |  74 +-
 .../Apache.Ignite.Core/Impl/Compute/Compute.cs  | 157 ++++-
 .../Impl/Compute/ComputeImpl.cs                 |  15 +-
 .../Apache.Ignite.Core/Impl/ExceptionUtils.cs   |   4 +
 .../Apache.Ignite.Core/Impl/PlatformTarget.cs   |  52 ++
 .../Impl/Unmanaged/IgniteJniNativeMethods.cs    |  16 +-
 .../Impl/Unmanaged/UnmanagedUtils.cs            |  31 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/platforms/dotnet/Apache.Ignite.sln      |   5 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   8 +-
 modules/platforms/dotnet/DEVNOTES.txt           |  18 +
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/rest-http/pom.xml                       |   2 +-
 .../rest/protocols/http/jetty/rest.html         |   2 +-
 modules/scalar-2.10/pom.xml                     |   4 +-
 modules/scalar/pom.xml                          |   4 +-
 modules/schedule/pom.xml                        |   4 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   4 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   4 +-
 modules/yardstick/pom.xml                       |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 parent/pom.xml                                  |   4 +-
 pom.xml                                         |  25 +-
 219 files changed, 5457 insertions(+), 1582 deletions(-)
----------------------------------------------------------------------



[46/50] [abbrv] ignite git commit: IGNITE-2218: Fixed a problem with native Hadoop libraries load. This closes #378.

Posted by vo...@apache.org.
IGNITE-2218: Fixed a problem with native Hadoop libraries load. This closes #378.


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

Branch: refs/heads/ignite-2234
Commit: 7d58d14a80b1c32f88fbb4cf68e5d289c5aee474
Parents: 012ca73
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 4 12:14:58 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 4 12:14:58 2016 +0400

----------------------------------------------------------------------
 .../processors/hadoop/HadoopClassLoader.java    |  71 ++++++++++---
 .../hadoop/v2/HadoopNativeCodeLoader.java       |  74 --------------
 .../hadoop/HadoopAbstractWordCountTest.java     |  46 +++++++--
 .../hadoop/HadoopMapReduceEmbeddedSelfTest.java |   2 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |  15 ++-
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |  28 +++++
 .../processors/hadoop/HadoopSnappyTest.java     | 102 +++++++++++++++++++
 .../processors/hadoop/HadoopTasksV2Test.java    |   2 +-
 .../hadoop/examples/HadoopWordCount1Reduce.java |   1 +
 .../hadoop/examples/HadoopWordCount2.java       |  18 +++-
 .../examples/HadoopWordCount2Reducer.java       |   1 +
 .../testsuites/IgniteHadoopTestSuite.java       |  18 +++-
 12 files changed, 279 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
index 735133f..270b31d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
@@ -30,13 +30,14 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-
+import java.util.Vector;
+import org.apache.hadoop.util.NativeCodeLoader;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.hadoop.v2.HadoopDaemon;
-import org.apache.ignite.internal.processors.hadoop.v2.HadoopNativeCodeLoader;
 import org.apache.ignite.internal.processors.hadoop.v2.HadoopShutdownHookManager;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 import org.objectweb.asm.AnnotationVisitor;
@@ -69,6 +70,9 @@ public class HadoopClassLoader extends URLClassLoader {
     /** Name of the Hadoop daemon class. */
     public static final String HADOOP_DAEMON_CLASS_NAME = "org.apache.hadoop.util.Daemon";
 
+    /** Name of libhadoop library. */
+    private static final String LIBHADOOP = "hadoop.";
+
     /** */
     private static final URLClassLoader APP_CLS_LDR = (URLClassLoader)HadoopClassLoader.class.getClassLoader();
 
@@ -119,6 +123,51 @@ public class HadoopClassLoader extends URLClassLoader {
         assert !(getParent() instanceof HadoopClassLoader);
 
         this.name = name;
+
+        initializeNativeLibraries();
+    }
+
+    /**
+     * Workaround to load native Hadoop libraries. Java doesn't allow native libraries to be loaded from different
+     * classloaders. But we load Hadoop classes many times and one of these classes - {@code NativeCodeLoader} - tries
+     * to load the same native library over and over again.
+     * <p>
+     * To fix the problem, we force native library load in parent class loader and then "link" handle to this native
+     * library to our class loader. As a result, our class loader will think that the library is already loaded and will
+     * be able to link native methods.
+     *
+     * @see <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/invocation.html#library_version">
+     *     JNI specification</a>
+     */
+    private void initializeNativeLibraries() {
+        try {
+            // This must trigger native library load.
+            Class.forName(NativeCodeLoader.class.getName(), true, APP_CLS_LDR);
+
+            final Vector<Object> curVector = U.field(this, "nativeLibraries");
+
+            ClassLoader ldr = APP_CLS_LDR;
+
+            while (ldr != null) {
+                Vector vector = U.field(ldr, "nativeLibraries");
+
+                for (Object lib : vector) {
+                    String libName = U.field(lib, "name");
+
+                    if (libName.contains(LIBHADOOP)) {
+                        curVector.add(lib);
+
+                        return;
+                    }
+                }
+
+                ldr = ldr.getParent();
+            }
+        }
+        catch (Exception e) {
+            U.quietAndWarn(null, "Failed to initialize Hadoop native library " +
+                "(native Hadoop methods might not work properly): " + e);
+        }
     }
 
     /**
@@ -152,8 +201,6 @@ public class HadoopClassLoader extends URLClassLoader {
             if (isHadoop(name)) { // Always load Hadoop classes explicitly, since Hadoop can be available in App classpath.
                 if (name.endsWith(".util.ShutdownHookManager"))  // Dirty hack to get rid of Hadoop shutdown hooks.
                     return loadFromBytes(name, HadoopShutdownHookManager.class.getName());
-                else if (name.endsWith(".util.NativeCodeLoader"))
-                    return loadFromBytes(name, HadoopNativeCodeLoader.class.getName());
                 else if (name.equals(HADOOP_DAEMON_CLASS_NAME))
                     // We replace this in order to be able to forcibly stop some daemon threads
                     // that otherwise never stop (e.g. PeerCache runnables):
@@ -274,7 +321,7 @@ public class HadoopClassLoader extends URLClassLoader {
 
     /**
      * Check whether class has external dependencies on Hadoop.
-     * 
+     *
      * @param clsName Class name.
      * @return {@code True} if class has external dependencies.
      */
@@ -285,15 +332,15 @@ public class HadoopClassLoader extends URLClassLoader {
         ctx.mthdVisitor = new CollectingMethodVisitor(ctx, ctx.annVisitor);
         ctx.fldVisitor = new CollectingFieldVisitor(ctx, ctx.annVisitor);
         ctx.clsVisitor = new CollectingClassVisitor(ctx, ctx.annVisitor, ctx.mthdVisitor, ctx.fldVisitor);
-        
+
         return hasExternalDependencies(clsName, ctx);
     }
-        
+
     /**
      * Check whether class has external dependencies on Hadoop.
-     * 
+     *
      * @param clsName Class name.
-     * @param ctx Context.                
+     * @param ctx Context.
      * @return {@code true} If the class has external dependencies.
      */
     boolean hasExternalDependencies(String clsName, CollectingContext ctx) {
@@ -519,7 +566,7 @@ public class HadoopClassLoader extends URLClassLoader {
 
         /** Field visitor. */
         private FieldVisitor fldVisitor;
-        
+
         /** Class visitor. */
         private ClassVisitor clsVisitor;
 
@@ -627,7 +674,7 @@ public class HadoopClassLoader extends URLClassLoader {
                 onType(t);
             }
         }
-    }    
+    }
 
     /**
      * Annotation visitor.
@@ -638,7 +685,7 @@ public class HadoopClassLoader extends URLClassLoader {
 
         /**
          * Annotation visitor.
-         * 
+         *
          * @param ctx The collector.
          */
         CollectingAnnotationVisitor(CollectingContext ctx) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopNativeCodeLoader.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopNativeCodeLoader.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopNativeCodeLoader.java
deleted file mode 100644
index 4c4840d..0000000
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopNativeCodeLoader.java
+++ /dev/null
@@ -1,74 +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.processors.hadoop.v2;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.classification.InterfaceStability;
-import org.apache.hadoop.conf.Configuration;
-
-/**
- * A fake helper to load the native hadoop code i.e. libhadoop.so.
- */
-@InterfaceAudience.Private
-@InterfaceStability.Unstable
-public class HadoopNativeCodeLoader {
-    /**
-     * Check if native-hadoop code is loaded for this platform.
-     *
-     * @return <code>true</code> if native-hadoop is loaded,
-     *         else <code>false</code>
-     */
-    public static boolean isNativeCodeLoaded() {
-        return false;
-    }
-
-    /**
-     * Returns true only if this build was compiled with support for snappy.
-     */
-    public static boolean buildSupportsSnappy() {
-        return false;
-    }
-
-    /**
-     * @return Library name.
-     */
-    public static String getLibraryName() {
-        throw new IllegalStateException();
-    }
-
-    /**
-     * Return if native hadoop libraries, if present, can be used for this job.
-     * @param conf configuration
-     *
-     * @return <code>true</code> if native hadoop libraries, if present, can be
-     *         used for this job; <code>false</code> otherwise.
-     */
-    public boolean getLoadNativeLibraries(Configuration conf) {
-        return false;
-    }
-
-    /**
-     * Set if native hadoop libraries, if present, can be used for this job.
-     *
-     * @param conf configuration
-     * @param loadNativeLibraries can native hadoop libraries be loaded
-     */
-    public void setLoadNativeLibraries(Configuration conf, boolean loadNativeLibraries) {
-        // No-op.
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractWordCountTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractWordCountTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractWordCountTest.java
index a47eaf6..e45c127 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractWordCountTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractWordCountTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.hadoop;
 
 import com.google.common.base.Joiner;
 import java.io.BufferedReader;
+import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.util.ArrayList;
@@ -26,6 +27,11 @@ import java.util.Collections;
 import java.util.List;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsEx;
 
@@ -118,21 +124,49 @@ public abstract class HadoopAbstractWordCountTest extends HadoopAbstractSelfTest
     }
 
     /**
+     * Read w/o decoding (default).
+     *
+     * @param fileName The file.
+     * @return The file contents, human-readable.
+     * @throws Exception On error.
+     */
+    protected String readAndSortFile(String fileName) throws Exception {
+        return readAndSortFile(fileName, null);
+    }
+
+    /**
      * Reads whole text file into String.
      *
      * @param fileName Name of the file to read.
      * @return Content of the file as String value.
      * @throws Exception If could not read the file.
      */
-    protected String readAndSortFile(String fileName) throws Exception {
-        BufferedReader reader = new BufferedReader(new InputStreamReader(igfs.open(new IgfsPath(fileName))));
+    protected String readAndSortFile(String fileName, Configuration conf) throws Exception {
+        final List<String> list = new ArrayList<>();
+
+        final boolean snappyDecode = conf != null && conf.getBoolean(FileOutputFormat.COMPRESS, false);
+
+        if (snappyDecode) {
+            try (SequenceFile.Reader reader = new SequenceFile.Reader(conf,
+                    SequenceFile.Reader.file(new Path(fileName)))) {
+                Text key = new Text();
 
-        List<String> list = new ArrayList<>();
+                IntWritable val = new IntWritable();
 
-        String line;
+                while (reader.next(key, val))
+                    list.add(key + "\t" + val);
+            }
+        }
+        else {
+            try (InputStream is0 = igfs.open(new IgfsPath(fileName))) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is0));
+
+                String line;
 
-        while ((line = reader.readLine()) != null)
-            list.add(line);
+                while ((line = reader.readLine()) != null)
+                    list.add(line);
+            }
+        }
 
         Collections.sort(list);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceEmbeddedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceEmbeddedSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceEmbeddedSelfTest.java
index c0eff48..25ef382 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceEmbeddedSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceEmbeddedSelfTest.java
@@ -106,7 +106,7 @@ public class HadoopMapReduceEmbeddedSelfTest extends HadoopMapReduceTest {
 
             Job job = Job.getInstance(jobConf);
 
-            HadoopWordCount2.setTasksClasses(job, useNewAPI, useNewAPI, useNewAPI);
+            HadoopWordCount2.setTasksClasses(job, useNewAPI, useNewAPI, useNewAPI, false);
 
             if (useNewAPI) {
                 job.setPartitionerClass(CustomV2Partitioner.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
index d0bd92b..7fd8272 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
@@ -183,7 +183,7 @@ public class HadoopMapReduceTest extends HadoopAbstractWordCountTest {
 
             Job job = Job.getInstance(jobConf);
 
-            HadoopWordCount2.setTasksClasses(job, useNewMapper, useNewCombiner, useNewReducer);
+            HadoopWordCount2.setTasksClasses(job, useNewMapper, useNewCombiner, useNewReducer, compressOutputSnappy());
 
             job.setOutputKeyClass(Text.class);
             job.setOutputValueClass(IntWritable.class);
@@ -207,18 +207,29 @@ public class HadoopMapReduceTest extends HadoopAbstractWordCountTest {
 
             checkOwner(new IgfsPath(outFile));
 
+            String actual = readAndSortFile(outFile, job.getConfiguration());
+
             assertEquals("Use new mapper: " + useNewMapper + ", new combiner: " + useNewCombiner + ", new reducer: " +
                 useNewReducer,
                 "blue\t" + blue + "\n" +
                 "green\t" + green + "\n" +
                 "red\t" + red + "\n" +
                 "yellow\t" + yellow + "\n",
-                readAndSortFile(outFile)
+                actual
             );
         }
     }
 
     /**
+     * Gets if to compress output data with Snappy.
+     *
+     * @return If to compress output data with Snappy.
+     */
+    protected boolean compressOutputSnappy() {
+        return false;
+    }
+
+    /**
      * Simple test job statistics.
      *
      * @param jobId Job id.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyFullMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyFullMapReduceTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyFullMapReduceTest.java
new file mode 100644
index 0000000..22d33a5
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyFullMapReduceTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.hadoop;
+
+/**
+ * Same test as HadoopMapReduceTest, but with enabled Snappy output compression.
+ */
+public class HadoopSnappyFullMapReduceTest extends HadoopMapReduceTest {
+    /** {@inheritDoc} */
+    @Override protected boolean compressOutputSnappy() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyTest.java
new file mode 100644
index 0000000..014ff1e
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopSnappyTest.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.processors.hadoop;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Arrays;
+import java.util.concurrent.ThreadLocalRandom;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.compress.CompressionInputStream;
+import org.apache.hadoop.io.compress.CompressionOutputStream;
+import org.apache.hadoop.io.compress.SnappyCodec;
+import org.apache.hadoop.io.compress.snappy.SnappyCompressor;
+import org.apache.hadoop.util.NativeCodeLoader;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ * Tests isolated Hadoop Snappy codec usage.
+ */
+public class HadoopSnappyTest extends GridCommonAbstractTest {
+    /** Length of data. */
+    private static final int BYTE_SIZE = 1024 * 50;
+
+    /**
+     * Checks Snappy codec usage.
+     *
+     * @throws Exception On error.
+     */
+    public void testSnappy() throws Throwable {
+        // Run Snappy test in default class loader:
+        checkSnappy();
+
+        // Run the same in several more class loaders simulating jobs and tasks:
+        for (int i = 0; i < 2; i++) {
+            ClassLoader hadoopClsLdr = new HadoopClassLoader(null, "cl-" + i);
+
+            Class<?> cls = (Class)Class.forName(HadoopSnappyTest.class.getName(), true, hadoopClsLdr);
+
+            assertEquals(hadoopClsLdr, cls.getClassLoader());
+
+            U.invoke(cls, null, "checkSnappy");
+        }
+    }
+
+    /**
+     * Internal check routine.
+     *
+     * @throws Throwable If failed.
+     */
+    public static void checkSnappy() throws Throwable {
+        try {
+            byte[] expBytes = new byte[BYTE_SIZE];
+            byte[] actualBytes = new byte[BYTE_SIZE];
+
+            for (int i = 0; i < expBytes.length ; i++)
+                expBytes[i] = (byte)ThreadLocalRandom.current().nextInt(16);
+
+            SnappyCodec codec = new SnappyCodec();
+
+            codec.setConf(new Configuration());
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+            try (CompressionOutputStream cos = codec.createOutputStream(baos)) {
+                cos.write(expBytes);
+                cos.flush();
+            }
+
+            try (CompressionInputStream cis = codec.createInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+                int read = cis.read(actualBytes, 0, actualBytes.length);
+
+                assert read == actualBytes.length;
+            }
+
+            assert Arrays.equals(expBytes, actualBytes);
+        }
+        catch (Throwable e) {
+            System.out.println("Snappy check failed:");
+            System.out.println("### NativeCodeLoader.isNativeCodeLoaded:  " + NativeCodeLoader.isNativeCodeLoaded());
+            System.out.println("### SnappyCompressor.isNativeCodeLoaded:  " + SnappyCompressor.isNativeCodeLoaded());
+
+            throw e;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopTasksV2Test.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopTasksV2Test.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopTasksV2Test.java
index 3a964d6..d125deb 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopTasksV2Test.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopTasksV2Test.java
@@ -48,7 +48,7 @@ public class HadoopTasksV2Test extends HadoopTasksAllVersionsTest {
         job.setOutputKeyClass(Text.class);
         job.setOutputValueClass(IntWritable.class);
 
-        HadoopWordCount2.setTasksClasses(job, true, true, true);
+        HadoopWordCount2.setTasksClasses(job, true, true, true, false);
 
         Configuration conf = job.getConfiguration();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount1Reduce.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount1Reduce.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount1Reduce.java
index 120ac19..2335911 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount1Reduce.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount1Reduce.java
@@ -47,6 +47,7 @@ public class HadoopWordCount1Reduce extends MapReduceBase implements Reducer<Tex
         output.collect(key, new IntWritable(sum));
     }
 
+    /** {@inheritDoc} */
     @Override public void configure(JobConf job) {
         super.configure(job);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2.java
index 942a908..4b508ca 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2.java
@@ -20,11 +20,14 @@ package org.apache.ignite.internal.processors.hadoop.examples;
 import java.io.IOException;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.compress.SnappyCodec;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
 import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
 import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
 
 /**
@@ -62,7 +65,7 @@ public class HadoopWordCount2 {
         job.setOutputKeyClass(Text.class);
         job.setOutputValueClass(IntWritable.class);
 
-        setTasksClasses(job, true, true, true);
+        setTasksClasses(job, true, true, true, false);
 
         FileInputFormat.setInputPaths(job, new Path(input));
         FileOutputFormat.setOutputPath(job, new Path(output));
@@ -80,7 +83,8 @@ public class HadoopWordCount2 {
      * @param setCombiner Option to set combiner class.
      * @param setReducer Option to set reducer and output format classes.
      */
-    public static void setTasksClasses(Job job, boolean setMapper, boolean setCombiner, boolean setReducer) {
+    public static void setTasksClasses(Job job, boolean setMapper, boolean setCombiner, boolean setReducer,
+            boolean outputCompression) {
         if (setMapper) {
             job.setMapperClass(HadoopWordCount2Mapper.class);
             job.setInputFormatClass(TextInputFormat.class);
@@ -93,5 +97,15 @@ public class HadoopWordCount2 {
             job.setReducerClass(HadoopWordCount2Reducer.class);
             job.setOutputFormatClass(TextOutputFormat.class);
         }
+
+        if (outputCompression) {
+            job.setOutputFormatClass(SequenceFileOutputFormat.class);
+
+            SequenceFileOutputFormat.setOutputCompressionType(job, SequenceFile.CompressionType.BLOCK);
+
+            SequenceFileOutputFormat.setCompressOutput(job, true);
+
+            job.getConfiguration().set(FileOutputFormat.COMPRESS_CODEC, SnappyCodec.class.getName());
+        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2Reducer.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2Reducer.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2Reducer.java
index b2be53e..63a9d95 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2Reducer.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/examples/HadoopWordCount2Reducer.java
@@ -55,6 +55,7 @@ public class HadoopWordCount2Reducer extends Reducer<Text, IntWritable, Text, In
     /** {@inheritDoc} */
     @Override protected void setup(Context context) throws IOException, InterruptedException {
         super.setup(context);
+
         wasSetUp = true;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d58d14a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 1831085..6c542b5 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -25,6 +25,8 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 import junit.framework.TestSuite;
 import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
@@ -63,6 +65,7 @@ import org.apache.ignite.internal.processors.hadoop.HadoopJobTrackerSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopMapReduceEmbeddedSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopMapReduceTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopSerializationWrapperSelfTest;
+import org.apache.ignite.internal.processors.hadoop.HadoopSnappyTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopSortingTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopSplitWrapperSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopTaskExecutionSelfTest;
@@ -70,6 +73,7 @@ import org.apache.ignite.internal.processors.hadoop.HadoopTasksV1Test;
 import org.apache.ignite.internal.processors.hadoop.HadoopTasksV2Test;
 import org.apache.ignite.internal.processors.hadoop.HadoopV2JobSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopValidationSelfTest;
+import org.apache.ignite.internal.processors.hadoop.HadoopSnappyFullMapReduceTest;
 import org.apache.ignite.internal.processors.hadoop.shuffle.collections.HadoopConcurrentHashMultimapSelftest;
 import org.apache.ignite.internal.processors.hadoop.shuffle.collections.HadoopHashMapSelfTest;
 import org.apache.ignite.internal.processors.hadoop.shuffle.collections.HadoopSkipListSelfTest;
@@ -96,6 +100,9 @@ public class IgniteHadoopTestSuite extends TestSuite {
 
         TestSuite suite = new TestSuite("Ignite Hadoop MR Test Suite");
 
+        suite.addTest(new TestSuite(ldr.loadClass(HadoopSnappyTest.class.getName())));
+        suite.addTest(new TestSuite(ldr.loadClass(HadoopSnappyFullMapReduceTest.class.getName())));
+
         suite.addTest(new TestSuite(ldr.loadClass(HadoopClassLoaderTest.class.getName())));
 
         suite.addTest(new TestSuite(ldr.loadClass(HadoopIgfs20FileSystemLoopbackPrimarySelfTest.class.getName())));
@@ -192,7 +199,7 @@ public class IgniteHadoopTestSuite extends TestSuite {
 
         X.println("Will use Hadoop version: " + ver);
 
-        String downloadPath = "hadoop/common/hadoop-" + ver + "/hadoop-" + ver + ".tar.gz";
+        String downloadPath = "hadoop/core/hadoop-" + ver + "/hadoop-" + ver + ".tar.gz";
 
         download("Hadoop", "HADOOP_HOME", downloadPath, "hadoop-" + ver);
     }
@@ -217,6 +224,7 @@ public class IgniteHadoopTestSuite extends TestSuite {
         }
 
         List<String> urls = F.asList(
+            "http://archive.apache.org/dist/",
             "http://apache-mirror.rbc.ru/pub/apache/",
             "http://www.eu.apache.org/dist/",
             "http://www.us.apache.org/dist/");
@@ -273,6 +281,14 @@ public class IgniteHadoopTestSuite extends TestSuite {
                             if (!dest.mkdirs())
                                 throw new IllegalStateException();
                         }
+                        else if (entry.isSymbolicLink()) {
+                            // Important: in Hadoop installation there are symlinks, we need to create them:
+                            Path theLinkItself = Paths.get(install.getAbsolutePath(), entry.getName());
+
+                            Path linkTarget = Paths.get(entry.getLinkName());
+
+                            Files.createSymbolicLink(theLinkItself, linkTarget);
+                        }
                         else {
                             File parent = dest.getParentFile();
 


[29/50] [abbrv] ignite git commit: Platforms now publish DEVNOTES.txt

Posted by vo...@apache.org.
Platforms now publish DEVNOTES.txt


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

Branch: refs/heads/ignite-2234
Commit: f1f8cda2f3f62231f42a59951bf34c39577c1bec
Parents: f97dc9f
Author: Anton Vinogradov <av...@apache.org>
Authored: Tue Dec 29 13:02:42 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Tue Dec 29 13:02:42 2015 +0300

----------------------------------------------------------------------
 assembly/release-fabric-base.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f1f8cda2/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
index 5be9f8f..9f9d310 100644
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@ -104,6 +104,7 @@
             <outputDirectory>/platforms/cpp</outputDirectory>
             <includes>
                 <include>README.txt</include>
+                <include>DEVNOTES.txt</include>
             </includes>
         </fileSet>
 


[16/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: d62b90591b6ae36b1394daf17a40084e8a292504
Parents: bbac649 23d7e25
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 15:20:38 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 15:20:38 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  8 ++
 assembly/release-sources.xml                    | 79 ++++++++++++++++++++
 modules/clients/pom.xml                         |  2 +-
 .../apache/ignite/internal/IgniteKernal.java    |  7 +-
 .../ignite/internal/IgniteNodeAttributes.java   |  3 +
 .../processors/rest/GridRestProcessor.java      |  4 +
 .../rest/client/message/GridClientNodeBean.java |  4 +-
 .../plugin/security/AuthenticationContext.java  | 33 ++++++--
 modules/platforms/dotnet/Apache.Ignite.sln      |  5 +-
 modules/platforms/dotnet/DEVNOTES.txt           | 18 +++++
 .../rest/protocols/http/jetty/rest.html         |  2 +-
 modules/scalar-2.10/pom.xml                     |  2 +-
 modules/scalar/pom.xml                          |  2 +-
 parent/pom.xml                                  |  2 +-
 pom.xml                                         | 23 +++---
 15 files changed, 168 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d62b9059/modules/clients/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d62b9059/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d62b9059/modules/scalar/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d62b9059/pom.xml
----------------------------------------------------------------------


[17/50] [abbrv] ignite git commit: IGNITE-2305: Fix for README.txt

Posted by vo...@apache.org.
IGNITE-2305: Fix for README.txt

Signed-off-by: Anton Vinogradov <av...@apache.org>


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

Branch: refs/heads/ignite-2234
Commit: 4f2c75177cc6e7c06b30f66ec20397ae59fea6bb
Parents: cdda4b5
Author: isapego <is...@gridgain.com>
Authored: Mon Dec 28 15:42:07 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 15:50:40 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/DEVNOTES.txt | 35 ++++----------------------
 modules/platforms/cpp/README.txt   | 44 ++++++++++++++++++++++++++++++++-
 2 files changed, 48 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4f2c7517/modules/platforms/cpp/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/DEVNOTES.txt b/modules/platforms/cpp/DEVNOTES.txt
index c97d04c..9a09333 100644
--- a/modules/platforms/cpp/DEVNOTES.txt
+++ b/modules/platforms/cpp/DEVNOTES.txt
@@ -38,18 +38,6 @@ Building the library:
 NOTE: "make install" command may require superuser privileges. In this case it must be
 executed as "sudo make install".
 
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Once both libraries are built and installed, required headers are placed in the
-   "/usr/local/include/ignite" directory.
- * Apache Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
-   Add this directory to headers search path: "-I${JAVA_HOME}/include".
- * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
- * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
-   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
-
-
 Building on Windows with Visual Studio (tm)
 ----------------------------------
 
@@ -60,25 +48,12 @@ Common Requirements:
  * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
  * JAVA_HOME environment variable must be set pointing to Java installation directory.
 
-Building the library:
+Building binaries:
 
  * Open and build %IGNITE_HOME%\platforms\cpp\project\vs\ignite.sln (or ignite_86.sln if you are running
    32-bit platform).
 
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Update Include Directories in Project Properties with paths to:
-   * $(IGNITE_HOME)\platforms\cpp\core\include
-   * $(IGNITE_HOME)\platforms\cpp\core\os\win\include
-   * $(IGNITE_HOME)\platforms\cpp\common\include
-   * $(IGNITE_HOME)\platforms\cpp\common\os\win\include
-   * $(JAVA_HOME)\include
-   * $(JAVA_HOME)\include\win32
- * Update Library Directories with path to the built binaries
- * Update Linker\Input\Additional Dependencies in Project Properties with path to
-   * ignite.common.lib
-   * ignite.core.lib
- * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
-   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
-   your project with help of PostBuild events.
\ No newline at end of file
+Building in later versions of Visual Studio:
+ * Open project\vs\ignite.sln or project\vs\ignite_86.sln in Visual Studio
+ * You will be prompted to "Update VC++ Compiler and Libraries", click "Update"
+ * Build the solution.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f2c7517/modules/platforms/cpp/README.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/README.txt b/modules/platforms/cpp/README.txt
index 74dec60..e542c82 100644
--- a/modules/platforms/cpp/README.txt
+++ b/modules/platforms/cpp/README.txt
@@ -18,8 +18,50 @@ Support for the following will be added in next releases:
 
 Full source code is provided. Users should build the library for intended platform.
 
-Output files list:
+Linux info
+==============
+
+Files list:
+
+ * ignite - executable to start standalone Ignite C++ node.
+ * libignite.so - Ignite C++ API library.
+ 
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Once both libraries are built and installed, required headers are placed in the
+   "/usr/local/include/ignite" directory.
+ * Apache Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
+   Add this directory to headers search path: "-I${JAVA_HOME}/include".
+ * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
+ * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
+   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
+ * To start Apache Ignite as a standalone node or Windows service use ignite
+
+ 
+Windows info
+===============
+
+Files list:
 
  * ignite.exe - executable to start standalone Ignite C++ node.
  * ignite.core.dll - Ignite C++ API library.
+ 
+Development:
 
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Update Include Directories in Project Properties with paths to:
+   * $(IGNITE_HOME)\platforms\cpp\core\include
+   * $(IGNITE_HOME)\platforms\cpp\core\os\win\include
+   * $(IGNITE_HOME)\platforms\cpp\common\include
+   * $(IGNITE_HOME)\platforms\cpp\common\os\win\include
+   * $(JAVA_HOME)\include
+   * $(JAVA_HOME)\include\win32
+ * Update Library Directories with path to the built binaries
+ * Update Linker\Input\Additional Dependencies in Project Properties with path to
+   * ignite.common.lib
+   * ignite.core.lib
+ * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
+   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
+   your project with help of PostBuild events.
+ * To start Apache Ignite as a standalone node or Windows service use ignite.exe
\ No newline at end of file


[37/50] [abbrv] ignite git commit: Added test for ignite-2328.

Posted by vo...@apache.org.
Added test for ignite-2328.


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

Branch: refs/heads/ignite-2234
Commit: dffcb834f0f5b8971398e704d520dab9b8901b3a
Parents: 24a78f5
Author: sboikov <sb...@gridgain.com>
Authored: Wed Dec 30 17:22:14 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Dec 30 17:22:14 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheStoreCollectionTest.java   | 163 +++++++++++++++++++
 1 file changed, 163 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dffcb834/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreCollectionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreCollectionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreCollectionTest.java
new file mode 100644
index 0000000..57d57ca
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreCollectionTest.java
@@ -0,0 +1,163 @@
+/*
+ * 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.processors.cache;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+
+/**
+ *
+ */
+public class IgniteCacheStoreCollectionTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration<Object, Object> ccfg1 = new CacheConfiguration<>();
+        ccfg1.setName("cache1");
+        ccfg1.setAtomicityMode(ATOMIC);
+
+        CacheConfiguration<Object, Object> ccfg2 = new CacheConfiguration<>();
+        ccfg2.setName("cache2");
+        ccfg2.setAtomicityMode(TRANSACTIONAL);
+
+        cfg.setCacheConfiguration(ccfg1, ccfg2);
+
+        cfg.setMarshaller(null);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        startGrid(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        super.afterTestsStopped();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStoreMap() throws Exception {
+        IgniteCache<Object, Object> cache1 = ignite(0).cache("cache1");
+        IgniteCache<Object, Object> cache2 = ignite(0).cache("cache2");
+
+        checkStoreMap(cache1);
+        checkStoreMap(cache2);
+    }
+
+    /**
+     * @param cache Cache.
+     */
+    private void checkStoreMap(IgniteCache<Object, Object> cache) {
+        cache.put(1, new MyMap());
+        cache.put(2, new MyMap());
+
+        MyMap map = (MyMap)cache.get(1);
+
+        assertNotNull(map);
+
+        Map<Integer, MyMap> vals = (Map)cache.getAll(F.asSet(1, 2));
+
+        assertEquals(2, vals.size());
+        assertTrue("Unexpected value: " + vals.get(1), vals.get(1) instanceof MyMap);
+        assertTrue("Unexpected value: " + vals.get(2), vals.get(2) instanceof MyMap);
+    }
+
+    /**
+     *
+     */
+    public static class MyMap implements Map {
+        /** {@inheritDoc} */
+        @Override public int size() {
+            return 0;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isEmpty() {
+            return true;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean containsKey(Object key) {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean containsValue(Object val) {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object get(Object key) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object put(Object key, Object val) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object remove(Object key) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void putAll(Map m) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void clear() {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public Set keySet() {
+            return Collections.emptySet();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Collection values() {
+            return Collections.emptySet();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Set<Entry> entrySet() {
+            return Collections.emptySet();
+        }
+    }
+}


[21/50] [abbrv] ignite git commit: IGNITE-2306: CPP: Added standalone node project to published solutions.

Posted by vo...@apache.org.
IGNITE-2306: CPP: Added standalone node project to published solutions.


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

Branch: refs/heads/ignite-2234
Commit: 46b8f01d2a73811c9a3fcfa5c0e0e6c713d9c231
Parents: f023c05
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 28 16:27:01 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 28 16:27:01 2015 +0300

----------------------------------------------------------------------
 assembly/release-fabric-base.xml | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/46b8f01d/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
index 21be995..5be9f8f 100644
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@ -119,6 +119,12 @@
             <outputDirectory>/platforms/cpp/core</outputDirectory>
         </fileSet>
 
+        <!-- Move CPP "ignite" module. -->
+        <fileSet>
+            <directory>modules/platforms/cpp/ignite</directory>
+            <outputDirectory>/platforms/cpp/ignite</outputDirectory>
+        </fileSet>
+
         <!-- Move CPP examples. -->
         <fileSet>
             <directory>modules/platforms/cpp/examples</directory>


[19/50] [abbrv] ignite git commit: IGNITE-2305

Posted by vo...@apache.org.
IGNITE-2305


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

Branch: refs/heads/ignite-2234
Commit: ed8f9fce4fdffc170f9f4a3aae53804eb8248e5e
Parents: 4f2c751
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 15:56:04 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 15:56:04 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ed8f9fce/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index ee982e4..3e19243 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -37,6 +37,9 @@ assembly will also include integration module for Apache Spark.
 
 NOTE: JDK version should be 1.7.0-* or >= 1.8.0-u40.
 
+Ignite C++ Build Instructions
+======================================
+  Instructions can be found at modules/platforms/cpp/DEVNOTES.txt.
 
 Ignite Release Instructions
 ===========================


[39/50] [abbrv] ignite git commit: IGNITE-2330: Simplified GridFunc.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/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 0678657..015be5c 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
@@ -35,16 +35,10 @@ import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.cache.Cache;
-import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
-import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyIterator;
@@ -52,7 +46,6 @@ 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.GridSerializableList;
 import org.apache.ignite.internal.util.GridSerializableMap;
 import org.apache.ignite.internal.util.GridSerializableSet;
 import org.apache.ignite.internal.util.typedef.C1;
@@ -68,7 +61,6 @@ import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteCallable;
 import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.lang.IgniteOutClosure;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteReducer;
 import org.jetbrains.annotations.NotNull;
@@ -152,13 +144,6 @@ public class GridFunc {
     };
 
     /** */
-    public static final IgnitePredicate<Object> IS_NULL = new P1<Object>() {
-        @Override public boolean apply(Object o) {
-            return o == null;
-        }
-    };
-
-    /** */
     public static final IgnitePredicate<Object> IS_NOT_NULL = new P1<Object>() {
         @Override public boolean apply(Object o) {
             return o != null;
@@ -166,28 +151,6 @@ public class GridFunc {
     };
 
     /** */
-    private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallable<List>() {
-        @Override public List call() {
-            return new ArrayList();
-        }
-
-        @Override public String toString() {
-            return "Array list factory.";
-        }
-    };
-
-    /** */
-    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new IgniteCallable<LinkedList>() {
-        @Override public LinkedList call() {
-            return new LinkedList();
-        }
-
-        @Override public String toString() {
-            return "Linked list factory.";
-        }
-    };
-
-    /** */
     private static final IgniteCallable<?> SET_FACTORY = new IgniteCallable<Set>() {
         @Override public Set call() {
             return new HashSet();
@@ -199,61 +162,6 @@ public class GridFunc {
     };
 
     /** */
-    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<AtomicLong> ATOMIC_LONG_FACTORY = new IgniteCallable<AtomicLong>() {
-        @Override public AtomicLong call() {
-            return new AtomicLong(0);
-        }
-
-        @Override public String toString() {
-            return "Atomic long factory.";
-        }
-    };
-
-    /** */
-    private static final IgniteCallable<AtomicBoolean> ATOMIC_BOOL_FACTORY = new IgniteCallable<AtomicBoolean>() {
-        @Override public AtomicBoolean call() {
-            return new AtomicBoolean();
-        }
-
-        @Override public String toString() {
-            return "Atomic boolean factory.";
-        }
-    };
-
-    /** */
-    private static final IgniteCallable<?> ATOMIC_REF_FACTORY = new IgniteCallable<AtomicReference>() {
-        @Override public AtomicReference call() {
-            return new AtomicReference();
-        }
-
-        @Override public String toString() {
-            return "Atomic reference factory.";
-        }
-    };
-
-    /** */
-    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<?> CONCURRENT_MAP_FACTORY = new IgniteCallable<ConcurrentMap>() {
         @Override public ConcurrentMap call() {
             return new ConcurrentHashMap8();
@@ -276,42 +184,6 @@ public class GridFunc {
     };
 
     /** */
-    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
-        @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getKey();
-        }
-
-        @Override public String toString() {
-            return "Map entry to key transformer closure.";
-        }
-    };
-
-
-    /** */
-    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
-        @SuppressWarnings({"unchecked"})
-        @Nullable @Override public Object apply(Object o) {
-            return ((Cache.Entry)o).getValue();
-        }
-
-        @Override public String toString() {
-            return "Cache entry to get-value transformer closure.";
-        }
-    };
-
-    /** */
-    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;
-        }
-
-        @Override public String toString() {
-            return "Cache entry has-peek-value predicate.";
-        }
-    };
-
-    /** */
     private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosure<ClusterNode, UUID>() {
         @Override public UUID apply(ClusterNode n) {
             return n.id();
@@ -344,12 +216,8 @@ public class GridFunc {
         }
     };
 
-    /** */
-    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IgnitePredicate<IgniteInternalFuture<?>>() {
-        @Override public boolean apply(IgniteInternalFuture<?> f) {
-            return !f.isDone();
-        }
-    };
+    /** Empty iterator. */
+    private static final GridEmptyIterator EMPTY_ITER = new GridEmptyIterator();
 
     /**
      * Gets predicate that evaluates to {@code true} only for given local node ID.
@@ -382,23 +250,6 @@ public class GridFunc {
     }
 
     /**
-     * Creates new collection by removing duplicates from the given collection.
-     *
-     * @param c Collection to remove duplicates from.
-     * @param <T> Type of the collection.
-     * @return De-duped collection.
-     */
-    public static <T> Collection<T> dedup(Collection<? extends T> c) {
-        A.notNull(c, "c");
-
-        Collection<T> set = new GridLeanSet<>();
-
-        set.addAll(c);
-
-        return set;
-    }
-
-    /**
      * Calculates sum of all elements.
      * <p>
      * <img src="{@docRoot}/img/sum.png">
@@ -578,8 +429,6 @@ public class GridFunc {
         if (isEmpty(res))
             return Collections.emptyList();
 
-        assert res != null;
-
         Collection<T> c = new ArrayList<>(res.size());
 
         for (ComputeJobResult r : res)
@@ -693,20 +542,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets random value from given array. This operation
-     * does not iterate through array elements and returns immediately.
-     *
-     * @param c Input collection.
-     * @param <T> Type of the collection.
-     * @return Random value from the input collection.
-     */
-    public static <T> T rand(T... c) {
-        A.notNull(c, "c");
-
-        return c[ThreadLocalRandom8.current().nextInt(c.length)];
-    }
-
-    /**
      * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
      * a new collection will be created and the element and passed in collection will be
      * copied into the new one. The returned collection will be modifiable. If {@code copy}
@@ -729,8 +564,6 @@ public class GridFunc {
                 return l;
             }
 
-            assert c != null;
-
             Collection<T> ret = new ArrayList<>(c.size() + 1);
 
             ret.add(t);
@@ -742,8 +575,6 @@ public class GridFunc {
             if (isEmpty(c))
                 return Collections.singletonList(t);
 
-            assert c != null;
-
             return new GridSerializableCollection<T>() {
                 @NotNull
                 @Override public Iterator<T> iterator() {
@@ -800,8 +631,11 @@ public class GridFunc {
             if (isEmpty(c1) && isEmpty(c2))
                 return new ArrayList<>(0);
 
-            if (isEmpty(c1))
+            if (isEmpty(c1)) {
+                assert c2 != null;
+
                 return new ArrayList<>(c2);
+            }
 
             if (isEmpty(c2))
                 return new ArrayList<>(c1);
@@ -874,7 +708,7 @@ public class GridFunc {
      * @param obj One or more elements.
      * @return Concatenated array.
      */
-    public static <T> T[] concat(@Nullable T[] arr, T... obj) {
+    public static <T> T[] concat(@Nullable T[] arr, T[] obj) {
         T[] newArr;
 
         if (arr == null || arr.length == 0)
@@ -889,17 +723,15 @@ public class GridFunc {
     }
 
     /**
-     * Concatenates multiple iterators as single one.
+     * Concatenate two iterators.
      *
-     * @param iters Iterators.
+     * @param iter1 Iterator 1.
+     * @param iter2 Iterator 2.
      * @return Single iterator.
      */
     @SuppressWarnings("unchecked")
-    public static <T> Iterator<T> concat(Iterator<T> ... iters) {
-        if (iters.length == 1)
-            return iters[0];
-
-        return concat(asList(iters).iterator());
+    public static <T> Iterator<T> concat(Iterator<T> iter1, Iterator<T> iter2) {
+        return concat(asList(iter1, iter2).iterator());
     }
 
     /**
@@ -980,11 +812,10 @@ public class GridFunc {
      * @param <T> Type of collections.
      * @return Collection of remaining elements
      */
-    public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp,
-        @Nullable Collection<T0> filter) {
+    public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp, @Nullable Collection<T0> filter) {
         A.notNull(c, "c");
 
-        return lose(c, cp, F0.in(filter));
+        return lose(c, cp, in(filter));
     }
 
     /**
@@ -994,11 +825,11 @@ public class GridFunc {
      * @param c Input collection.
      * @param cp If {@code true} method creates new collection without modifying the input one,
      *      otherwise does <tt>in-place</tt> modifications.
-     * @param p Predicates to filter by. If no predicates provided - no elements are lost.
+     * @param p Predicate.
      * @param <T> Type of collections.
      * @return Collection of remaining elements.
      */
-    public static <T> Collection<T> lose(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
+    public static <T> Collection<T> lose(Collection<T> c, boolean cp, IgnitePredicate<? super T> p) {
         A.notNull(c, "c");
 
         Collection<T> res;
@@ -1006,19 +837,18 @@ public class GridFunc {
         if (!cp) {
             res = c;
 
-            if (isEmpty(p))
-                res.clear();
-            else if (!isAlwaysFalse(p))
-                for (Iterator<T> iter = res.iterator(); iter.hasNext();)
-                    if (isAll(iter.next(), p))
+            if (!isAlwaysFalse(p)) {
+                for (Iterator<T> iter = res.iterator(); iter.hasNext(); )
+                    if (p.apply(iter.next()))
                         iter.remove();
+            }
         }
         else {
             res = new LinkedList<>();
 
-            if (!isEmpty(p) && !isAlwaysTrue(p))
+            if (!isAlwaysTrue(p))
                 for (T t : c)
-                    if (!isAll(t, p))
+                    if (!p.apply(t))
                         res.add(t);
         }
 
@@ -1026,162 +856,6 @@ public class GridFunc {
     }
 
     /**
-     * Loses all entries in input map that are evaluated to {@code true} by all given predicates.
-     *
-     * @param m Map to filter.
-     * @param cp If {@code true} method creates new map not modifying input, otherwise does
-     *      <tt>in-place</tt> modifications.
-     * @param p Optional set of predicates to use for filtration. If none provided - original map
-     *  will (or its copy) be returned.
-     * @param <K> Type of the free variable for the predicate and type of map's keys.
-     * @param <V> Type of the free variable for the predicate and type of map's values.
-     * @return Filtered map.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <K, V> Map<K, V> lose(Map<K, V> m, boolean cp,
-        @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
-        A.notNull(m, "m");
-
-        Map<K, V> res;
-
-        if (!cp) {
-            res = m;
-
-            if (isEmpty(p))
-                res.clear();
-            else if (!isAlwaysFalse(p))
-                for (Iterator<Map.Entry<K, V>> iter = m.entrySet().iterator(); iter.hasNext();)
-                    if (isAll(iter.next(), p))
-                        iter.remove();
-        }
-        else {
-            res = U.newHashMap(m.size());
-
-            if (!isEmpty(p) && !isAlwaysTrue(p))
-                for (Map.Entry<K, V> e : m.entrySet())
-                    if (!F.isAll(e, p))
-                        res.put(e.getKey(), e.getValue());
-        }
-
-        return res;
-    }
-
-    /**
-     * Loses all entries in input map which keys are evaluated to {@code true} by all
-     * given predicates.
-     *
-     * @param m Map to filter.
-     * @param cp If {@code true} method creates new map not modifying input, otherwise does
-     *      <tt>in-place</tt> modifications.
-     * @param p Optional set of predicates to use for filtration. If none provided - original
-     *      map (or its copy) will be returned.
-     * @param <K> Type of the free variable for the predicate and type of map's keys.
-     * @param <V> Type of map's values.
-     * @return Filtered map.
-     */
-    public static <K, V> Map<K, V> loseKeys(
-        Map<K, V> m,
-        boolean cp,
-        @Nullable final IgnitePredicate<? super K>... p
-    ) {
-        return lose(m, cp, new P1<Map.Entry<K, V>>() {
-            @Override public boolean apply(Map.Entry<K, V> e) {
-                return isAll(e.getKey(), p);
-            }
-        });
-    }
-
-    /**
-     * Loses all entries in input map which values are evaluated to {@code true} by all
-     * given predicates.
-     *
-     * @param m Map to filter.
-     * @param cp If {@code true} method creates new map not modifying input, otherwise does
-     *      <tt>in-place</tt> modifications.
-     * @param p Optional set of predicates to use for filtration. If none provided - original
-     *      map (or its copy) will be returned.
-     * @param <K> Type of the free variable for the predicate and type of map's keys.
-     * @param <V> Type of map's values.
-     * @return Filtered map.
-     */
-    public static <K, V> Map<K, V> loseValues(Map<K, V> m, boolean cp,
-        @Nullable final IgnitePredicate<? super V>... p) {
-        return lose(m, cp, new P1<Map.Entry<K, V>>() {
-            @Override public boolean apply(Map.Entry<K, V> e) {
-                return isAll(e.getValue(), p);
-            }
-        });
-    }
-
-    /**
-     * Loses all elements in input list that are contained in {@code filter} collection.
-     *
-     * @param c Input list.
-     * @param cp If {@code true} method creates new list not modifying input,
-     *      otherwise does <tt>in-place</tt> modifications.
-     * @param filter Filter collection. If {@code filter} collection is empty or
-     *      {@code null} - no elements are lost.
-     * @param <T> Type of list.
-     * @return List of remaining elements
-     */
-    public static <T> List<T> loseList(List<T> c, boolean cp, @Nullable Collection<? super T> filter) {
-        A.notNull(c, "c");
-
-        List<T> res;
-
-        if (!cp) {
-            res = c;
-
-            if (filter != null)
-                res.removeAll(filter);
-        }
-        else {
-            res = new LinkedList<>();
-
-            for (T t : c) {
-                if (filter == null || !filter.contains(t))
-                    res.add(t);
-            }
-        }
-
-        return res;
-    }
-
-    /**
-     * Loses all elements in input list for which any of the predicates evaluate to {@code true}.
-     *
-     * @param c Input list.
-     * @param cp If {@code true} method creates new list not modifying input,
-     *      otherwise does <tt>in-place</tt> modifications.
-     * @param p Looses all elements for which any of the predicates evaluate to {@code true}.
-     * @param <T> Type of list.
-     * @return List of remaining elements
-     */
-    public static <T> List<T> filterList(List<T> c, boolean cp, @Nullable IgnitePredicate<T>... p) {
-        A.notNull(c, "c");
-
-        List<T> res;
-
-        if (!cp) {
-            res = c;
-
-            if (p != null)
-                for (Iterator<T> it = c.iterator(); it.hasNext();)
-                    if (isAny(it.next(), p))
-                        it.remove();
-        }
-        else {
-            res = new ArrayList<>(c.size());
-
-            for (T t : c)
-                if (!isAny(t, p))
-                    res.add(t);
-        }
-
-        return res;
-    }
-
-    /**
      * Gets closure which converts node to node ID.
      *
      * @return Closure which converts node to node ID.
@@ -1253,19 +927,6 @@ public class GridFunc {
     }
 
     /**
-     * Creates predicates that evaluates to {@code true} for each node in given collection.
-     * Note that if collection is empty the result predicate will always evaluate to {@code false}.
-     * Implementation simply creates {@link GridNodePredicate} instance.
-     *
-     * @param nodes Collection of nodes. If none provided - result predicate will always
-     *      return {@code false}.
-     * @return Predicates that evaluates to {@code true} for each node in given collection.
-     */
-    public static IgnitePredicate<ClusterNode> nodeForNodes(ClusterNode... nodes) {
-        return new GridNodePredicate(nodes);
-    }
-
-    /**
      * Retains all elements in input collection that are contained in {@code filter}.
      *
      * @param c Input collection.
@@ -1280,7 +941,26 @@ public class GridFunc {
         @Nullable Collection<? extends T0> filter) {
         A.notNull(c, "c");
 
-        return retain(c, cp, F0.in(filter));
+        return retain(c, cp, in(filter));
+    }
+
+    /**
+     * Retains all elements in input collection that are evaluated to {@code true}
+     * by the given predicate.
+     *
+     * @param c Input collection.
+     * @param cp If {@code true} method creates collection not modifying input, otherwise does
+     *      <tt>in-place</tt> modifications.
+     * @param p Predicates to filter by. If no predicates provides - all elements
+     *      will be retained.
+     * @param <T> Type of collections.
+     * @return Collection of retain elements.
+     */
+    public static <T> Collection<T> retain(Collection<T> c, boolean cp, IgnitePredicate<? super T> p) {
+        A.notNull(c, "c");
+        A.notNull(p, "p");
+
+        return lose(c, cp, not(p));
     }
 
     /**
@@ -1295,7 +975,7 @@ public class GridFunc {
      * @param <T> Type of collections.
      * @return Collection of retain elements.
      */
-    public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
+    public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>[] p) {
         A.notNull(c, "c");
 
         return lose(c, cp, not(p));
@@ -1345,36 +1025,19 @@ public class GridFunc {
     }
 
     /**
-     * Curries given closure.
+     * Create list containing two elements.
      *
-     * @param f Closure.
-     * @param e Parameter.
-     * @param <T> Input type.
-     * @param <R> Output type.
-     * @return Curried closure.
+     * @param t1 First element.
+     * @param t2 Second element.
+     * @return List.
      */
-    public static <T, R> IgniteOutClosure<R> curry(final IgniteClosure<? super T, R> f, final T e) {
-        return new IgniteOutClosure<R>() {
-            @Override public R apply() {
-                return f.apply(e);
-            }
-        };
-    }
+    public static <T> List<T> asList(T t1, T t2) {
+        ArrayList<T> res = new ArrayList<>(2);
 
-    /**
-     * Curries given closure.
-     *
-     * @param f Closure.
-     * @param e Parameter.
-     * @param <T> Input type.
-     * @return Curried closure.
-     */
-    public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
-        return new GridAbsClosure() {
-            @Override public void apply() {
-                f.apply(e);
-            }
-        };
+        res.add(t1);
+        res.add(t2);
+
+        return res;
     }
 
     /**
@@ -1390,6 +1053,7 @@ public class GridFunc {
      * @param <T> Array type.
      * @return {@link List} instance for array.
      */
+    @SuppressWarnings("unchecked")
     public static <T> List<T> asList(@Nullable T... vals) {
         return isEmpty(vals) ? Collections.<T>emptyList() : Arrays.asList(vals);
     }
@@ -1400,8 +1064,9 @@ public class GridFunc {
      * @param <T> Type of the iterator.
      * @return Newly created empty iterator.
      */
+    @SuppressWarnings("unchecked")
     public static <T> GridIterator<T> emptyIterator() {
-        return new GridEmptyIterator<>();
+        return EMPTY_ITER;
     }
 
     /**
@@ -1574,6 +1239,29 @@ public class GridFunc {
     }
 
     /**
+     * Gets size of the given collection.
+     *
+     * @param c Collection.
+     * @return Size.
+     */
+    public static <T> int size(@Nullable Collection<? extends T> c) {
+        return c == null || c.isEmpty() ? 0 : c.size();
+    }
+
+    /**
+     * Gets size of the given collection with provided optional predicates.
+     *
+     * @param c Collection to size.
+     * @param p Optional predicates that filters out elements from count.
+     * @param <T> Type of the iterator.
+     * @return Number of elements in the collection for which all given predicates
+     *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
+     */
+    public static <T> int size(@Nullable Collection<? extends T> c, IgnitePredicate<? super T> p) {
+        return c == null || c.isEmpty() ? 0 : isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
+    }
+
+    /**
      * Gets size of the given collection with provided optional predicates.
      *
      * @param c Collection to size.
@@ -1582,12 +1270,34 @@ public class GridFunc {
      * @return Number of elements in the collection for which all given predicates
      *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
      */
-    public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>... p) {
+    public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>[] p) {
         return c == null || c.isEmpty() ? 0 : isEmpty(p) || isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
     }
 
     /**
-     * Gets size of the given iterator with provided optional predicates. Iterator
+     * Gets size of the given iterator. Iterator will be traversed to get the count.
+     *
+     * @param it Iterator to size.
+     * @param <T> Type of the iterator.
+     * @return Number of elements in the iterator.
+     */
+    public static <T> int size(@Nullable Iterator<? extends T> it) {
+        if (it == null)
+            return 0;
+
+        int n = 0;
+
+        while (it.hasNext()) {
+            n++;
+
+            it.next();
+        }
+
+        return n;
+    }
+
+    /**
+     * Gets size of the given iterator with provided optional predicate. Iterator
      * will be traversed to get the count.
      *
      * @param it Iterator to size.
@@ -1596,7 +1306,7 @@ public class GridFunc {
      * @return Number of elements in the iterator for which all given predicates
      *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
      */
-    public static <T> int size(@Nullable Iterator<? extends T> it, @Nullable IgnitePredicate<? super T>... p) {
+    public static <T> int size(@Nullable Iterator<? extends T> it, IgnitePredicate<? super T> p) {
         if (it == null)
             return 0;
 
@@ -1604,7 +1314,7 @@ public class GridFunc {
 
         if (!isAlwaysFalse(p)) {
             while (it.hasNext()) {
-                if (isAll(it.next(), p))
+                if (p.apply(it.next()))
                     n++;
             }
         }
@@ -1613,34 +1323,52 @@ public class GridFunc {
     }
 
     /**
-     * Creates write-through light-weight view on given collection with provided predicates. Resulting
-     * collection will only "have" elements for which all provided predicates, if any, evaluate
-     * to {@code true}. Note that only wrapping collection will be created and no duplication of
-     * data will occur. Also note that if array of given predicates is not empty then method
-     * {@code size()} uses full iteration through the collection.
+     * Gets size of the given iterator with provided optional predicates. Iterator
+     * will be traversed to get the count.
      *
-     * @param c Input collection that serves as a base for the view.
-     * @param p Optional predicates. If predicates are not provided - all elements will be in the view.
-     * @param <T> Type of the collection.
-     * @return Light-weight view on given collection with provided predicate.
-     */
-    @SafeVarargs
-    public static <T> Collection<T> view(@Nullable final Collection<T> c,
-        @Nullable final IgnitePredicate<? super T>... p) {
-        if (isEmpty(c) || isAlwaysFalse(p))
-            return Collections.emptyList();
+     * @param it Iterator to size.
+     * @param p Optional predicates that filters out elements from count.
+     * @param <T> Type of the iterator.
+     * @return Number of elements in the iterator for which all given predicates
+     *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
+     */
+    public static <T> int size(@Nullable Iterator<? extends T> it, @Nullable IgnitePredicate<? super T>[] p) {
+        if (it == null)
+            return 0;
+
+        int n = 0;
 
-        assert c != null;
+        if (!isAlwaysFalse(p)) {
+            while (it.hasNext()) {
+                if (isAll(it.next(), p))
+                    n++;
+            }
+        }
+
+        return n;
+    }
+
+    /**
+     * Creates write-through light-weight view on given collection.
+     *
+     * @param c Input collection that serves as a base for the view.
+     * @param p Optional predicates. If predicates are not provided - all elements will be in the view.
+     * @param <T> Type of the collection.
+     * @return Light-weight view on given collection with provided predicate.
+     */
+    public static <T> Collection<T> view(@Nullable final Collection<T> c, final IgnitePredicate<? super T> p) {
+        if (isEmpty(c) || isAlwaysFalse(p))
+            return Collections.emptyList();
 
-        return isEmpty(p) || isAlwaysTrue(p) ? c : new GridSerializableCollection<T>() {
+        return 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);
+                return p.apply(e) && c.add(e);
             }
 
             @NotNull
             @Override public Iterator<T> iterator() {
-                return F.iterator0(c, false, p);
+                return identityIterator(c, p);
             }
 
             @Override public int size() {
@@ -1648,117 +1376,82 @@ public class GridFunc {
             }
 
             @Override public boolean isEmpty() {
-                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
+                return !iterator().hasNext();
             }
         };
     }
 
     /**
-     * Creates read-only light-weight view on given collection with transformation and provided
-     * predicates. Resulting collection will only "have" {@code transformed} elements for which
-     * all provided predicate, if any, evaluates to {@code true}. Note that only wrapping
-     * collection will be created and no duplication of data will occur. Also note that if array
-     * of given predicates is not empty then method {@code size()} uses full iteration through
-     * the collection.
+     * Creates read-only light-weight view on given collection with transformation.
      *
      * @param c Input collection that serves as a base for the view.
      * @param trans Transformation closure.
-     * @param p Optional predicated. If predicates are not provided - all elements will be in the view.
      * @param <T1> Type of the collection.
      * @return Light-weight view on given collection with provided predicate.
      */
     @SuppressWarnings("RedundantTypeArguments")
-    @SafeVarargs
     public static <T1, T2> Collection<T2> viewReadOnly(@Nullable final Collection<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans, @Nullable final IgnitePredicate<? super T1>... p) {
+        final IgniteClosure<? super T1, T2> trans) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(c) || isAlwaysFalse(p))
+        if (isEmpty(c))
             return Collections.emptyList();
 
-        assert c != null;
-
         return new GridSerializableCollection<T2>() {
             @NotNull
             @Override public Iterator<T2> iterator() {
-                return F.<T1, T2>iterator(c, trans, true, p);
+                return F.<T1, T2>iteratorReadOnly(c, trans);
             }
 
             @Override public int size() {
-                return F.isEmpty(p) ? c.size() : F.size(iterator());
+                return c.size();
             }
 
             @Override public boolean isEmpty() {
-                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
+                return c.isEmpty();
             }
         };
     }
 
     /**
-     * Creates read-only light-weight view on given list with provided transformation.
-     * Resulting list will only "have" {@code transformed} elements. Note that only wrapping
-     * list will be created and no duplication of data will occur.
+     * Creates read-only light-weight view on given collection with transformation and provided
+     * predicates. Resulting collection will only "have" {@code transformed} elements for which
+     * all provided predicate, if any, evaluates to {@code true}. Note that only wrapping
+     * collection will be created and no duplication of data will occur. Also note that if array
+     * of given predicates is not empty then method {@code size()} uses full iteration through
+     * the collection.
      *
-     * @param c Input list that serves as a base for the view.
+     * @param c Input collection that serves as a base for the view.
      * @param trans Transformation closure.
-     * @param <T1> Type of the list.
-     * @return Light-weight view on given list with provided transformation.
+     * @param p Optional predicated. If predicates are not provided - all elements will be in the view.
+     * @param <T1> Type of the collection.
+     * @return Light-weight view on given collection with provided predicate.
      */
     @SuppressWarnings("RedundantTypeArguments")
-    public static <T1, T2> List<T2> viewListReadOnly(@Nullable final List<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans) {
+    public static <T1, T2> Collection<T2> viewReadOnly(@Nullable final Collection<? extends T1> c,
+        final IgniteClosure<? super T1, T2> trans, @Nullable final IgnitePredicate<? super T1> p) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(c))
+        if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        assert c != null;
-
-        return new GridSerializableList<T2>() {
-            /** */
-            private static final long serialVersionUID = 3126625219739967068L;
-
-            @Override public T2 get(int idx) {
-                return trans.apply(c.get(idx));
-            }
-
+        return new GridSerializableCollection<T2>() {
             @NotNull
             @Override public Iterator<T2> iterator() {
-                return F.<T1, T2>iterator(c, trans, true);
+                return F.<T1, T2>iterator(c, trans, true, p);
             }
 
             @Override public int size() {
-                return c.size();
+                return F.size(iterator());
             }
 
             @Override public boolean isEmpty() {
-                return c.isEmpty();
+                return !iterator().hasNext();
             }
         };
     }
 
     /**
-     * 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.
-     */
-    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));
-    }
-
-    /**
      * Creates light-weight view on given map with provided predicates. Resulting map will
      * only "have" keys for which all provided predicates, if any, evaluates to {@code true}.
      * Note that only wrapping map will be created and no duplication of data will occur.
@@ -1766,26 +1459,24 @@ public class GridFunc {
      * uses full iteration through the entry set.
      *
      * @param m Input map that serves as a base for the view.
-     * @param p Optional predicates. If predicates are not provided - all will be in the view.
+     * @param p Predicate.
      * @param <K> Type of the key.
      * @param <V> Type of the value.
      * @return Light-weight view on given map with provided predicate.
      */
     public static <K0, K extends K0, V0, V extends V0> Map<K, V> view(@Nullable final Map<K, V> m,
-        @Nullable final IgnitePredicate<? super K>... p) {
+        final IgnitePredicate<? super K> p) {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        assert m != null;
-
-        return isEmpty(p) || isAlwaysTrue(p) ? m : new GridSerializableMap<K, V>() {
+        return 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);
+                    return p.apply(e.getKey());
                 }
             };
 
@@ -1794,7 +1485,7 @@ public class GridFunc {
                 return new GridSerializableSet<Map.Entry<K, V>>() {
                     @NotNull
                     @Override public Iterator<Entry<K, V>> iterator() {
-                        return iterator0(m.entrySet(), false, ep);
+                        return identityIterator(m.entrySet(), ep);
                     }
 
                     @Override public int size() {
@@ -1803,12 +1494,12 @@ public class GridFunc {
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean remove(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().remove(o);
+                        return ep.apply((Map.Entry<K, V>)o) && 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);
+                        return ep.apply((Map.Entry<K, V>)o) && m.entrySet().contains(o);
                     }
 
                     @Override public boolean isEmpty() {
@@ -1823,13 +1514,13 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Nullable @Override public V get(Object key) {
-                return isAll((K)key, p) ? m.get(key) : null;
+                return p.apply((K)key) ? m.get(key) : null;
             }
 
             @Nullable @Override public V put(K key, V val) {
                 V oldVal = get(key);
 
-                if (isAll(key, p))
+                if (p.apply(key))
                     m.put(key, val);
 
                 return oldVal;
@@ -1837,7 +1528,7 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
+                return p.apply((K)key) && m.containsKey(key);
             }
         };
     }
@@ -1851,38 +1542,26 @@ public class GridFunc {
      *
      * @param m Input map that serves as a base for the view.
      * @param trans Transformer for map value transformation.
-     * @param p Optional predicates. If predicates are not provided - all will be in the view.
      * @param <K> Type of the key.
      * @param <V> Type of the input map value.
      * @param <V1> Type of the output map value.
      * @return Light-weight view on given map with provided predicate and transformer.
      */
     public static <K0, K extends K0, V0, V extends V0, V1> Map<K, V1> viewReadOnly(@Nullable final Map<K, V> m,
-        final IgniteClosure<V, V1> trans, @Nullable final IgnitePredicate<? super K>... p) {
+        final IgniteClosure<V, V1> trans) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(m) || isAlwaysFalse(p))
+        if (isEmpty(m))
             return Collections.emptyMap();
 
-        assert m != null;
-
-        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);
+                            private Iterator<Entry<K, V>> it = identityIteratorReadOnly(m.entrySet());
 
                             @Override public boolean hasNext() {
                                 return it.hasNext();
@@ -1913,7 +1592,7 @@ public class GridFunc {
                     }
 
                     @Override public int size() {
-                        return hasPred ? F.size(m.keySet(), p) : m.size();
+                        return m.size();
                     }
 
                     @SuppressWarnings({"unchecked"})
@@ -1923,27 +1602,25 @@ public class GridFunc {
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
+                        return m.entrySet().contains(o);
                     }
 
                     @Override public boolean isEmpty() {
-                        return hasPred ? !iterator().hasNext() : m.isEmpty();
+                        return m.isEmpty();
                     }
                 };
             }
 
             @Override public boolean isEmpty() {
-                return hasPred ? entrySet().isEmpty() : m.isEmpty();
+                return m.isEmpty();
             }
 
             @SuppressWarnings({"unchecked"})
             @Nullable @Override public V1 get(Object key) {
-                if (isAll((K)key, p)) {
-                    V v = m.get(key);
+                V v = m.get(key);
 
-                    if (v != null)
-                        return trans.apply(v);
-                }
+                if (v != null)
+                    return trans.apply(v);
 
                 return null;
             }
@@ -1958,170 +1635,34 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
+                return m.containsKey(key);
             }
         };
     }
 
     /**
-     * Read-only view on map that supports transformation of values and key filtering. Resulting map will
-     * only "have" keys for which all provided predicates, if any, evaluates to {@code true}.
-     * Note that only wrapping map will be created and no duplication of data will occur.
-     * Also note that if array of given predicates is not empty then method {@code size()}
-     * uses full iteration through the entry set.
-     *
-     * @param m Input map that serves as a base for the view.
-     * @param trans Transformer for map value transformation.
-     * @param p Optional predicates. If predicates are not provided - all will be in the view.
-     * @param <K> Type of the key.
-     * @param <V> Type of the input map value.
-     * @param <V1> Type of the output map value.
-     * @return Light-weight view on given map with provided predicate and transformer.
-     */
-    public static <K0, K extends K0, V0, V extends V0, V1> Map<K, V1> viewReadOnly(@Nullable final Map<K, V> m,
-        final IgniteBiClosure<K, V, V1> trans, @Nullable final IgnitePredicate<? super K>... p) {
-        A.notNull(trans, "trans");
-
-        if (isEmpty(m) || isAlwaysFalse(p))
-            return Collections.emptyMap();
-
-        assert m != null;
-
-        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);
-            }
-        };
-    }
-
-    /**
-     * Read-only map view of a collection. Resulting map is a lightweight view of an input collection,
-     * with filtered elements of an input collection as keys, and closure execution results
-     * as values. The map will only contain keys for which all provided predicates, if any, evaluate
-     * to {@code true}. Note that only wrapping map will be created and no duplication of data will occur.
-     * Also note that if array of given predicates is not empty then method {@code size()}
-     * uses full iteration through the entry set.
+     * Read-only map view of a collection.
      *
      * @param c Input collection.
      * @param mapClo Mapping closure, that maps key to value.
-     * @param p Optional predicates to filter input collection. If predicates are not provided - all
-     *          elements will be in the view.
      * @param <K> Key type.
      * @param <V> Value type.
      * @return Light-weight view on given map with provided predicates and mapping.
      */
     @SuppressWarnings("TypeMayBeWeakened")
     public static <K0, K extends K0, V0, V extends V0> Map<K, V> viewAsMap(@Nullable final Set<K> c,
-        final IgniteClosure<? super K, V> mapClo, @Nullable final IgnitePredicate<? super K>... p) {
+        final IgniteClosure<? super K, V> mapClo) {
         A.notNull(mapClo, "trans");
 
-        if (isEmpty(c) || isAlwaysFalse(p))
+        if (isEmpty(c))
             return Collections.emptyMap();
 
-        assert c != null;
-
         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);
+                            private Iterator<K> it = identityIteratorReadOnly(c);
 
                             @Override public boolean hasNext() {
                                 return it.hasNext();
@@ -2154,7 +1695,7 @@ public class GridFunc {
                     }
 
                     @Override public int size() {
-                        return F.size(c, p);
+                        return c.size();
                     }
 
                     @Override public boolean remove(Object o) {
@@ -2162,15 +1703,16 @@ public class GridFunc {
                     }
 
                     @Override public boolean isEmpty() {
-                        return !iterator().hasNext();
+                        return c.isEmpty();
                     }
                 };
             }
 
             @Override public boolean isEmpty() {
-                return entrySet().isEmpty();
+                return c.isEmpty();
             }
 
+            @SuppressWarnings("unchecked")
             @Nullable @Override public V get(Object key) {
                 if (containsKey(key))
                     return mapClo.apply((K)key);
@@ -2186,8 +1728,9 @@ public class GridFunc {
                 throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
             }
 
+            @SuppressWarnings("SuspiciousMethodCalls")
             @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && c.contains(key);
+                return c.contains(key);
             }
         };
     }
@@ -2290,40 +1833,6 @@ public class GridFunc {
     }
 
     /**
-     * Utility map getter. This method analogous to {@link #addIfAbsent(Map, Object, Callable)}
-     * method but this one doesn't put the default value into the map when key is not found.
-     *
-     * @param map Map to get value from.
-     * @param key Map key (can be {@code null}).
-     * @param c Optional factory closure for the default value to be returned in
-     *      when {@code key} is not found. If closure is not provided - {@code null} will be returned.
-     * @param <K> Map key type.
-     * @param <V> Map value type.
-     * @return Value for the {@code key} or default value produced by {@code c} if key is not
-     *      found (or {@code null} if key is not found and closure is not provided).
-     * @throws GridClosureException Thrown in case when callable throws exception.
-     * @see #newLinkedList()
-     * @see #newList()
-     * @see #newSet()
-     * @see #newMap()
-     * @see #newAtomicLong()
-     * @see #newAtomicInt()
-     * @see #newAtomicRef()
-     * @see #newAtomicBoolean()
-     */
-    @Nullable public static <K, V> V returnIfAbsent(Map<? extends K, ? extends V> map, @Nullable K key,
-        @Nullable Callable<V> c) {
-        A.notNull(map, "map");
-
-        try {
-            return !map.containsKey(key) ? c == null ? null : c.call() : map.get(key);
-        }
-        catch (Exception e) {
-            throw wrap(e);
-        }
-    }
-
-    /**
      * Returns a factory closure that creates new {@link ConcurrentLinkedDeque8} instance.
      * Note that this method does not create a new closure but returns a static one.
      *
@@ -2337,82 +1846,6 @@ public class GridFunc {
     }
 
     /**
-     * Returns a factory closure that creates new {@link List} instance. Note that this
-     * method does not create a new closure but returns a static one.
-     *
-     * @param <T> Type parameters for the created {@link List}.
-     * @return Factory closure that creates new {@link List} instance every
-     *      time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> IgniteCallable<List<T>> newList() {
-        return (IgniteCallable<List<T>>)LIST_FACTORY;
-    }
-
-    /**
-     * Returns a factory closure that creates new {@link AtomicInteger} instance
-     * initialized to {@code zero}. Note that this method does not create a new
-     * closure but returns a static one.
-     *
-     * @return Factory closure that creates new {@link AtomicInteger} instance
-     *      initialized to {@code zero} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    public static IgniteCallable<AtomicInteger> newAtomicInt() {
-        return ATOMIC_INT_FACTORY;
-    }
-
-    /**
-     * Returns a factory closure that creates new {@link AtomicLong} instance
-     * initialized to {@code zero}. Note that this method does not create a new
-     * closure but returns a static one.
-     *
-     * @return Factory closure that creates new {@link AtomicLong} instance
-     *      initialized to {@code zero} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    public static IgniteCallable<AtomicLong> newAtomicLong() {
-        return ATOMIC_LONG_FACTORY;
-    }
-
-    /**
-     * Returns a factory closure that creates new {@link AtomicReference} instance
-     * initialized to {@code null}. Note that this method does not create a new closure
-     * but returns a static one.
-     *
-     * @param <T> Type of the atomic reference.
-     * @return Factory closure that creates new {@link AtomicReference} instance
-     *      initialized to {@code null} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> IgniteCallable<AtomicReference<T>> newAtomicRef() {
-        return (IgniteCallable<AtomicReference<T>>)ATOMIC_REF_FACTORY;
-    }
-
-    /**
-     * Returns a factory closure that creates new {@link AtomicBoolean} instance
-     * initialized to {@code false}. Note that this method does not create a new
-     * closure but returns a static one.
-     *
-     * @return Factory closure that creates new {@link AtomicBoolean} instance
-     *      initialized to {@code false} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    public static IgniteCallable<AtomicBoolean> newAtomicBoolean() {
-        return ATOMIC_BOOL_FACTORY;
-    }
-
-    /**
-     * Returns a factory closure that creates new {@link LinkedList} instance.
-     * Note that this method does not create a new closure but returns a static one.
-     *
-     * @param <T> Type parameters for the created {@link LinkedList}.
-     * @return Factory closure that creates new {@link LinkedList} instance every time its {@link
-     *         org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> IgniteCallable<LinkedList<T>> newLinkedList() {
-        return (IgniteCallable<LinkedList<T>>)LINKED_LIST_FACTORY;
-    }
-
-    /**
      * Returns a factory closure that creates new {@link Set} instance. Note that this
      * method does not create a new closure but returns a static one.
      *
@@ -2426,20 +1859,6 @@ public class GridFunc {
     }
 
     /**
-     * Returns a factory closure that creates new {@link Map} instance. Note
-     * that this method does not create a new closure but returns a static one.
-     *
-     * @param <K> Type of the key for the created {@link Map}.
-     * @param <V> Type of the value for the created {@link Map}.
-     * @return Factory closure that creates new {@link Map} instance every
-     *      time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
-     */
-    @SuppressWarnings("unchecked")
-    public static <K, V> IgniteCallable<Map<K, V>> newMap() {
-        return (IgniteCallable<Map<K, V>>)MAP_FACTORY;
-    }
-
-    /**
      * Returns a factory closure that creates new {@link ConcurrentMap} instance.
      * Note that this method does not create a new closure but returns a static one.
      *
@@ -2466,6 +1885,18 @@ public class GridFunc {
     }
 
     /**
+     * Creates and returns iterator from given collection.
+     *
+     * @param c Input collection.
+     * @param <T> Type of the collection elements.
+     * @return Iterator from given collection and optional filtering predicate.
+     */
+    @SuppressWarnings({"unchecked"})
+    public static <T> GridIterator<T> identityIteratorReadOnly(Iterable<? extends T> c) {
+        return iteratorReadOnly(c, IDENTITY);
+    }
+
+    /**
      * Creates and returns iterator from given collection and optional filtering predicates.
      * Returned iterator will only have elements for which all given predicates evaluates to
      * {@code true} (if provided). Note that this method will not create new collection but
@@ -2473,16 +1904,29 @@ public class GridFunc {
      * evaluate to {@code true} for.
      *
      * @param c Input collection.
-     * @param readOnly If {@code true}, then resulting iterator will not allow modifications
-     *      to the underlying collection.
-     * @param p Optional filtering predicates.
+     * @param p Optional filtering predicate.
      * @param <T> Type of the collection elements.
      * @return Iterator from given collection and optional filtering predicate.
      */
     @SuppressWarnings({"unchecked"})
-    public static <T> GridIterator<T> iterator0(Iterable<? extends T> c, boolean readOnly,
-        IgnitePredicate<? super T>... p) {
-        return F.iterator(c, IDENTITY, readOnly, p);
+    public static <T> GridIterator<T> identityIterator(Iterable<? extends T> c, IgnitePredicate<? super T> p) {
+        return iterator(c, IDENTITY, false, p);
+    }
+
+    /**
+     * Creates and returns transforming iterator from given collection.
+     *
+     * @param c Input collection.
+     * @param trans Transforming closure to convert from T1 to T2.
+     * @param <T1> Type of the collection elements.
+     * @param <T2> Type of returned elements.
+     * @return Iterator from given collection and optional filtering predicate.
+     */
+    public static <T1, T2> GridIterator<T2> iteratorReadOnly(final Iterable<? extends T1> c,
+        final IgniteClosure<? super T1, T2> trans) {
+        A.notNull(c, "c", trans, "trans");
+
+        return iterator(c.iterator(), trans, true);
     }
 
     /**
@@ -2496,15 +1940,14 @@ public class GridFunc {
      * @param trans 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 p Optional filtering predicates.
+     * @param p Filtering predicate.
      * @param <T1> Type of the collection elements.
      * @param <T2> Type of returned elements.
      * @return Iterator from given collection and optional filtering predicate.
      */
     public static <T1, T2> GridIterator<T2> iterator(final Iterable<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans, final boolean readOnly,
-        @Nullable final IgnitePredicate<? super T1>... p) {
-        A.notNull(c, "c", trans, "trans");
+        final IgniteClosure<? super T1, T2> trans, final boolean readOnly, final IgnitePredicate<? super T1> p) {
+        A.notNull(c, "c", trans, "trans", p, "p");
 
         if (isAlwaysFalse(p))
             return F.emptyIterator();
@@ -2523,53 +1966,36 @@ public class GridFunc {
             private Iterator<? extends T1> iter = c.iterator();
 
             @Override public boolean hasNextX() {
-                if (isEmpty(p))
-                    return iter.hasNext();
+                if (!moved)
+                    return more;
                 else {
-                    if (!moved)
-                        return more;
-                    else {
-                        more = false;
-
-                        while (iter.hasNext()) {
-                            elem = iter.next();
+                    more = false;
 
-                            boolean isAll = true;
+                    while (iter.hasNext()) {
+                        elem = iter.next();
 
-                            for (IgnitePredicate<? super T1> r : p)
-                                if (r != null && !r.apply(elem)) {
-                                    isAll = false;
+                        if (p.apply(elem)) {
+                            more = true;
+                            moved = false;
 
-                                    break;
-                                }
-
-                            if (isAll) {
-                                more = true;
-                                moved = false;
-
-                                return true;
-                            }
+                            return true;
                         }
+                    }
 
-                        elem = null; // Give to GC.
+                    elem = null; // Give to GC.
 
-                        return false;
-                    }
+                    return false;
                 }
             }
 
             @Nullable @Override public T2 nextX() {
-                if (isEmpty(p))
-                    return trans.apply(iter.next());
-                else {
-                    if (hasNext()) {
-                        moved = true;
+                if (hasNext()) {
+                    moved = true;
 
-                        return trans.apply(elem);
-                    }
-                    else
-                        throw new NoSuchElementException();
+                    return trans.apply(elem);
                 }
+                else
+                    throw new NoSuchElementException();
             }
 
             @Override public void removeX() {
@@ -2586,80 +2012,22 @@ public class GridFunc {
      * @param trans 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 p Optional filtering predicates.
      * @return Iterator from given iterator and optional filtering predicate.
      */
-    public static <T1, T2> Iterator<T2> iterator(final Iterator<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans,
-        final boolean readOnly,
-        @Nullable final IgnitePredicate<? super T1>... p)
-    {
+    public static <T1, T2> GridIterator<T2> iterator(final Iterator<? extends T1> c,
+        final IgniteClosure<? super T1, T2> trans, final boolean readOnly) {
         A.notNull(c, "c", trans, "trans");
 
-        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;
-                    }
-                }
+                return iter.hasNext();
             }
 
             @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();
-                }
+                return trans.apply(iter.next());
             }
 
             @Override public void removeX() {
@@ -2740,23 +2108,35 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate that evaluates to {@code true} if its free variable is {@code null}.
+     * Gets predicate that evaluates to {@code true} if its free variable is not {@code null}.
      *
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if its free variable is {@code null}.
+     * @return Predicate that evaluates to {@code true} if its free variable is not {@code null}.
      */
-    public static <T> IgnitePredicate<T> isNull() {
-        return (IgnitePredicate<T>) IS_NULL;
+    @SuppressWarnings("unchecked")
+    public static <T> IgnitePredicate<T> notNull() {
+        return (IgnitePredicate<T>)IS_NOT_NULL;
     }
 
     /**
-     * Gets predicate that evaluates to {@code true} if its free variable is not {@code null}.
+     * Negates given predicate.
+     * <p>
+     * Gets predicate that evaluates to {@code true} if any of given predicates
+     * evaluates to {@code false}. If all predicates evaluate to {@code true} the
+     * result predicate will evaluate to {@code false}.
      *
+     * @param p Predicate to negate.
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if its free variable is not {@code null}.
+     * @return Negated predicate.
      */
-    public static <T> IgnitePredicate<T> notNull() {
-        return (IgnitePredicate<T>) IS_NOT_NULL;
+    public static <T> IgnitePredicate<T> not(final IgnitePredicate<? super T> p) {
+        A.notNull(p, "p");
+
+        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                return !p.apply(t);
+            }
+        };
     }
 
     /**
@@ -2770,8 +2150,7 @@ public class GridFunc {
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
      * @return Negated predicate.
      */
-    @SafeVarargs
-    public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
+    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);
@@ -2814,30 +2193,13 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate that evaluates to {@code true} if its free variable is instance of the given class.
-     *
-     * @param cls Class to compare to.
-     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if its free variable is instance
-     *      of the given class.
-     */
-    public static <T> IgnitePredicate<T> instanceOf(final Class<?> cls) {
-        A.notNull(cls, "cls");
-
-        return new P1<T>() {
-            @Override public boolean apply(T t) {
-                return t != null && cls.isAssignableFrom(t.getClass());
-            }
-        };
-    }
-
-    /**
      * Gets first element from given collection or returns {@code null} if the collection is empty.
      *
      * @param c A collection.
      * @param <T> Type of the collection.
      * @return Collections' first element or {@code null} in case if the collection is empty.
      */
+    @SuppressWarnings("unchecked")
     public static <T> T first(@Nullable Iterable<? extends T> c) {
         if (c == null)
             return null;
@@ -2870,12 +2232,11 @@ public class GridFunc {
      * @param <T> Type of the collection.
      * @return Collections' first element or {@code null} in case if the collection is empty.
      */
+    @SuppressWarnings("unchecked")
     @Nullable public static <T> T last(@Nullable Iterable<? extends T> c) {
         if (c == null)
             return null;
 
-        assert c != null;
-
         if (c instanceof RandomAccess && c instanceof List) {
             List<T> l = (List<T>)c;
 
@@ -2960,8 +2321,6 @@ public class GridFunc {
             return F.alwaysTrue();
 
         if (F0.isAllNodePredicates(ps)) {
-            assert ps != null;
-
             Set<UUID> ids = new HashSet<>();
 
             for (IgnitePredicate<? super T> p : ps) {
@@ -2981,8 +2340,6 @@ public class GridFunc {
         else {
             return new P1<T>() {
                 @Override public boolean apply(T t) {
-                    assert ps != null;
-
                     for (IgnitePredicate<? super T> p : ps)
                         if (p != null && !p.apply(t))
                             return false;
@@ -3019,6 +2376,24 @@ public class GridFunc {
     }
 
     /**
+     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
+     * in given collection.
+     *
+     * @param c Collection to check for containment.
+     * @param <T> Type of the free variable for the predicate and type of the
+     *      collection elements.
+     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
+     *      contained in given collection.
+     */
+    public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
+        return isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
+            @Override public boolean apply(T t) {
+                return c.contains(t);
+            }
+        };
+    }
+
+    /**
      * Gets predicate that returns {@code true} if its free variable is not
      * contained in given collection.
      *
@@ -3031,8 +2406,6 @@ public class GridFunc {
     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) {
-                assert c != null;
-
                 return !c.contains(t);
             }
         };
@@ -3045,27 +2418,13 @@ public class GridFunc {
      */
     @SuppressWarnings("unchecked")
     public static <T, C extends Collection<T>> C addAll(C c, Iterable<? extends T> it) {
-        if (it == null)
-            return c;
-
-        if (it instanceof Collection<?>) {
-            c.addAll((Collection<? extends T>)it);
-
-            return c;
-        }
-
-        return addAll(c, it.iterator());
-    }
-
-    /**
-     * @param c Target collection.
-     * @param it Iterator to fetch.
-     * @return Modified target collection.
-     */
-    public static <T, C extends Collection<T>> C addAll(C c, Iterator<? extends T> it) {
         if (it != null) {
-            while (it.hasNext())
-                c.add(it.next());
+            if (it instanceof Collection<?>)
+                c.addAll((Collection<? extends T>)it);
+            else {
+                for (T item : it)
+                    c.add(item);
+            }
         }
 
         return c;
@@ -3142,14 +2501,7 @@ public class GridFunc {
      *      found (or {@code null} if key is not found and closure is not provided). Note that
      *      in case when key is not found the default value will be put into the map.
      * @throws GridClosureException Thrown in case when callable throws exception.
-     * @see #newLinkedList()
-     * @see #newList()
      * @see #newSet()
-     * @see #newMap()
-     * @see #newAtomicLong()
-     * @see #newAtomicInt()
-     * @see #newAtomicRef()
-     * @see #newAtomicBoolean()
      */
     @Nullable public static <K, V> V addIfAbsent(Map<? super K, V> map, @Nullable K key,
         @Nullable Callable<? extends V> c) {
@@ -3227,79 +2579,34 @@ public class GridFunc {
      *
      * @param c Collection to call closure over.
      * @param f Side-effect only closure to call over the collection.
-     * @param p Optional set of predicates. Only if collection element evaluates
-     *      to {@code true} for given predicates the closure will be applied to it.
-     *      If no predicates provided - closure will be applied to all collection
-     *      elements.
      * @param <X> Type of the free variable for the closure and type of the
      *      collection elements.
      */
-    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f,
-        @Nullable IgnitePredicate<? super X>... p) {
-        A.notNull(c, "c", f, "f");
-
-        for (X x : c)
-            if (isAll(x, p))
-                f.apply(x);
-    }
-
-    /**
-     * Calls given {@code side-effect only} closure over the each element of the provided array.
-     *
-     * @param c Array to call closure over.
-     * @param f Side-effect only closure to call over the array.
-     * @param p Optional set of predicates. Only if collection element evaluates
-     *      to {@code true} for given predicates the closure will be applied to it.
-     *      If no predicates provided - closure will be applied to all collection
-     *      elements.
-     * @param <X> Type of the free variable for the closure and type of the array
-     *      elements.
-     */
-    @SuppressWarnings("RedundantTypeArguments")
-    public static <X> void forEach(X[] c, IgniteInClosure<? super X> f, @Nullable IgnitePredicate<? super X>... p) {
-        A.notNull(c, "c", f, "f");
-
-        F.<X>forEach(asList(c), f, p);
-    }
-
-    /**
-     * Adds (copies) to given collection all elements in <tt>'from'</tt> array.
-     *
-     * @param to Collection to copy to.
-     * @param from Array to copy from.
-     * @param <T> Type of the free variable for the predicate and type of the collection elements.
-     * @return Collection to copy to.
-     */
-    public static <T> Collection<T> copy(Collection<T> to, T... from) {
-        A.notNull(to, "to", from, "from");
-
-        copy(to, asList(from));
+    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f) {
+        A.notNull(c, "c", f, "f");
 
-        return to;
+        for (X x : c)
+            f.apply(x);
     }
 
     /**
-     * Adds (copies) to given collection using provided predicates. Element is copied if all
-     * predicates evaluate to {@code true}.
+     * Calls given {@code side-effect only} closure over the each element of the provided
+     * collection.
      *
-     * @param to Collection to copy to.
-     * @param from Collection to copy from.
-     * @param p Optional set of predicates to use for filtration.
-     * @param <T> Type of the free variable for the predicate and type of the collection elements.
-     * @return Collection to copy to.
+     * @param c Collection to call closure over.
+     * @param f Side-effect only closure to call over the collection.
+     * @param p Optional predicate. Only if collection element evaluates
+     *      to {@code true} for given predicate the closure will be applied to it.
+     * @param <X> Type of the free variable for the closure and type of the
+     *      collection elements.
      */
-    public static <T> Collection<T> copy(Collection<T> to, Iterable<? extends T> from,
-        @Nullable IgnitePredicate<? super T>... p) {
-        A.notNull(to, "to", from, "from");
-
-        if (!isAlwaysFalse(p)) {
-            for (T t : from) {
-                if (isAll(t, p))
-                    to.add(t);
-            }
-        }
+    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f,
+        IgnitePredicate<? super X> p) {
+        A.notNull(c, "c", f, "f", p, "f");
 
-        return to;
+        for (X x : c)
+            if (p.apply(x))
+                f.apply(x);
     }
 
     /**
@@ -3336,21 +2643,6 @@ public class GridFunc {
     }
 
     /**
-     * Transforms an array to read only collection using provided closure.
-     *
-     * @param c Initial array to transform.
-     * @param f Closure to use for transformation.
-     * @param <X> Type of the free variable for the closure and type of the array elements.
-     * @param <Y> Type of the closure's return value.
-     * @return Transformed read only collection.
-     */
-    public static <X, Y> Collection<Y> transform(X[] c, IgniteClosure<? super X, Y> f) {
-        A.notNull(c, "c", f, "f");
-
-        return viewReadOnly(asList(c), f);
-    }
-
-    /**
      * Tests if all provided predicates evaluate to {@code true} for given value. Note that
      * evaluation will be short-circuit when first predicate evaluated to {@code false} is found.
      *
@@ -3361,7 +2653,7 @@ public class GridFunc {
      * @return Returns {@code true} if given set of predicates is {@code null}, is empty, or all predicates
      *      evaluate to {@code true} for given value, {@code false} otherwise.
      */
-    public static <T> boolean isAll(@Nullable T t, @Nullable IgnitePredicate<? super T>... p) {
+    public static <T> boolean isAll(@Nullable T t, @Nullable IgnitePredicate<? super T>[] p) {
         if (p != null)
             for (IgnitePredicate<? super T> r : p)
                 if (r != null && !r.apply(t))
@@ -3371,27 +2663,6 @@ public class GridFunc {
     }
 
     /**
-     * Tests if any of provided predicates evaluate to {@code true} for given value. Note
-     * that evaluation will be short-circuit when first predicate evaluated to {@code true}
-     * is found.
-     *
-     * @param t Value to test.
-     * @param p Optional set of predicates to use for evaluation.
-     * @param <T> Type of the value and free variable of the predicates.
-     * @return Returns {@code true} if any of predicates evaluates to {@code true} for given
-     *      value, {@code false} otherwise. Returns {@code false} if given set of predicates
-     *      is {@code null} or empty.
-     */
-    public static <T> boolean isAny(@Nullable T t, @Nullable IgnitePredicate<? super T>... p) {
-        if (p != null)
-            for (IgnitePredicate<? super T> r : p)
-                if (r != null && r.apply(t))
-                    return true;
-
-        return false;
-    }
-
-    /**
      * Creates an absolute (no-arg) closure that does nothing.
      *
      * @return Absolute (no-arg) closure that does nothing.
@@ -3411,14 +2682,12 @@ public class GridFunc {
      * @return First element in given collection for which predicate evaluates to
      *      {@code true} - or {@code null} if such element cannot be found.
      */
-    @SafeVarargs
-    @Nullable public static <V> V find(Iterable<? extends V> c, @Nullable V dfltVal,
-        @Nullable IgnitePredicate<? super V>... p) {
+    @Nullable public static <V> V find(Iterable<? extends V> c, @Nullable V dfltVal, IgnitePredicate<? super V> p) {
         A.notNull(c, "c");
 
-        if (!isEmpty(p) && !isAlwaysFalse(p)) {
+        if (!isAlwaysFalse(p)) {
             for (V v : c) {
-                if (isAny(v, p))
+                if (p.apply(v))
                     return v;
             }
         }
@@ -3427,35 +2696,6 @@ public class GridFunc {
     }
 
     /**
-     * Finds, transforms and returns first element in given collection for which any of
-     * the provided predicates evaluates to {@code true}.
-     *
-     * @param c Input collection.
-     * @param dfltVal Default value to return when no element is found.
-     * @param f Transforming closure.
-     * @param p Optional set of finder predicates.
-     * @param <V> Type of the collection elements.
-     * @return First element in given collection for which predicate evaluates to
-     *      {@code true} - or {@code null} if such element cannot be found.
-     */
-    public static <V, Y> Y find(Iterable<? extends V> c, @Nullable Y dfltVal, IgniteClosure<? super V, Y> f,
-        @Nullable IgnitePredicate<? super V>... p) {
-        A.notNull(c, "c", f, "f");
-
-        if (isAlwaysTrue(p) && c.iterator().hasNext())
-            return f.apply(c.iterator().next());
-
-        if (!isEmpty(p) && !isAlwaysFalse(p)) {
-            for (V v : c) {
-                if (isAny(v, p))
-                    return f.apply(v);
-            }
-        }
-
-        return dfltVal;
-    }
-
-    /**
      * Checks if collection {@code c1} contains any elements from collection {@code c2}.
      *
      * @param c1 Collection to check for containment. If {@code null} - this method returns {@code false}.
@@ -3482,7 +2722,7 @@ public class GridFunc {
      * @return {@code true} if collection {@code c1} contains at least one element from collection
      *      {@code c2}.
      */
-    public static <T> boolean containsAny(@Nullable Collection<? extends T> c1, @Nullable T... c2) {
+    public static <T> boolean containsAny(@Nullable Collection<? extends T> c1, @Nullable T[] c2) {
         if (c1 != null && !c1.isEmpty() && c2 != null && c2.length > 0)
             for (T t : c2)
                 if (c1.contains(t))
@@ -3526,35 +2766,6 @@ public class GridFunc {
     }
 
     /**
-     * Partitions input collection in two: first containing elements for which given
-     * predicate evaluates to {@code true} - and second containing the elements for which
-     * predicate evaluates to {@code false}.
-     *
-     * @param c Input collection.
-     * @param p Partitioning predicate.
-     * @param <V> Type of the collection elements.
-     * @return Tuple of two collections: first containing elements for which given predicate
-     *      evaluates to {@code true} - and second containing the elements for which predicate
-     *      evaluates to {@code false}.
-     */
-    public static <V> IgniteBiTuple<Collection<V>, Collection<V>> partition(Iterable<? extends V> c,
-        IgnitePredicate<? super V> p) {
-        A.notNull(c, "c", p, "p");
-
-        Collection<V> c1 = new LinkedList<>();
-        Collection<V> c2 = new LinkedList<>();
-
-        for (V v : c) {
-            if (p.apply(v))
-                c1.add(v);
-            else
-                c2.add(v);
-        }
-
-        return t(c1, c2);
-    }
-
-    /**
      * Checks for existence of the element in input collection for which all provided predicates
      * evaluate to {@code true}.
      *
@@ -3564,18 +2775,16 @@ public class GridFunc {
      * @return {@code true} if input collection contains element for which all the provided
      *      predicates evaluates to {@code true} - otherwise returns {@code false}.
      */
-    public static <V> boolean exist(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
+    public static <V> boolean exist(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
         A.notNull(c, "c");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
-        else if (isEmpty(p))
-            return true;
         else
             for (V v : c)
-                if (isAll(v, p))
+                if (p.apply(v))
                     return true;
 
         return false;
@@ -3592,16 +2801,16 @@ public class GridFunc {
      * @return Returns {@code true} if all given predicates evaluate to {@code true} for
      *      all elements. Returns {@code false} otherwise.
      */
-    public static <V> boolean forAll(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
+    public static <V> boolean forAll(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
         A.notNull(c, "c");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
-        else if (!isEmpty(p)) {
+        else {
             for (V v : c) {
-                if (!isAll(v, p))
+                if (!p.apply(v))
                     return false;
             }
         }
@@ -3621,17 +2830,18 @@ public class GridFunc {
      *      entries. Returns {@code false} otherwise.
      */
     public static <K1, K extends K1, V1, V extends V1> boolean forAll(Map<K, V> m,
-        @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
+        IgnitePredicate<? super Map.Entry<K, V>> p) {
         A.notNull(m, "m");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
-        else if (!isEmpty(p))
+        else {
             for (Map.Entry<K, V> e : m.entrySet())
-                if (!isAll(e, p))
+                if (!p.apply(e))
                     return false;
+        }
 
         return true;
     }
@@ -3648,20 +2858,16 @@ public class GridFunc {
      * @return Returns {@code true} if all given predicates evaluate to {@code true} for
      *      at least one element. Returns {@code false} otherwise.
      */
-    public static <V> boolean forAny(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
+    public static <V> boolean forAny(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
         A.notNull(c, "c");
 
-        if (!c.iterator().hasNext())
-            return false;
-        else if (isEmpty(p))
-            return true;
-        else if (isAlwaysFalse(p))
+        if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
         else {
             for (V v : c)
-                if (isAll(v, p))
+                if (p.apply(v))
                     return true;
 
             return false;
@@ -3691,22 +2897,17 @@ public class GridFunc {
      *
      * @param c Input collection.
      * @param b Optional first folding pair element.
-     * @param fs Optional set of folding closures.
+     * @param fs Optional folding closure.
      * @param <D> Type of the input collection elements and type of the free variable for the closure.
      * @param <B> Type of the folding value and return type of the closure.
      * @return Value representing folded collection.
      */
     @Nullable public static <D, B> B fold(Iterable<? extends D> c, @Nullable B b,
-        @Nullable IgniteBiClosure<? super D, ? super B, B>... fs) {
+        IgniteBiClosure<? super D, ? super B, B> fs) {
         A.notNull(c, "c");
 
-        if (!isEmpty(fs))
-            for (D e : c) {
-                assert fs != null;
-
-                for (IgniteBiClosure<? super D, ? super B, B> f : fs)
-                    b = f.apply(e, b);
-            }
+        for (D e : c)
+            b = fs.apply(e, b);
 
         return b;
     }
@@ -3832,72 +3033,6 @@ public class GridFunc {
     }
 
     /**
-     * Creates vararg tuple with given values.
-     *
-     * @param objs Values for vararg tuple.
-     * @return Vararg tuple with given values.
-     */
-    public static GridTupleV tv(Object... objs) {
-        assert objs != null;
-
-        return new GridTupl

<TRUNCATED>

[42/50] [abbrv] ignite git commit: Revert "IGNITE-2330: Simplified GridFunc."

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
index e5d247a..b999e2a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
  * 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#t3()
  * @see GridFunc#t(Object, Object, Object)
  */
 public class GridTuple3<V1, V2, V3> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
index d1e69b5..c95a859 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
  * 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#t4()
  * @see GridFunc#t(Object, Object, Object, Object)
  */
 public class GridTuple4<V1, V2, V3, V4> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
index 7d25996..9790f48 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
  * 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#t5()
  * @see GridFunc#t(Object, Object, Object, Object, Object)
  */
 public class GridTuple5<V1, V2, V3, V4, V5> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
index c904587..044944b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
  * 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#t5()
  * @see GridFunc#t(Object, Object, Object, Object, Object)
  */
 public class GridTuple6<V1, V2, V3, V4, V5, V6> implements Iterable<Object>, Externalizable,

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/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 58e18aa..225366a 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,6 +35,7 @@ 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...)
  */
 public class GridTupleV implements Iterable<Object>, Externalizable, Cloneable {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
index 44ca067..5c6bb9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
@@ -186,7 +186,7 @@ public final class IgniteUuid implements Comparable<IgniteUuid>, Iterable<Ignite
 
     /** {@inheritDoc} */
     @Override public GridIterator<IgniteUuid> iterator() {
-        return F.identityIteratorReadOnly(Collections.singleton(this));
+        return F.iterator(Collections.singleton(this), F.<IgniteUuid>identity(), true);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
index 56a627a..c7c635e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
@@ -216,7 +216,6 @@ public class MemoryEventStorageSpi extends IgniteSpiAdapter implements EventStor
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public <T extends Event> Collection<T> localEvents(IgnitePredicate<T> p) {
         A.notNull(p, "p");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
index 1e868b7..59a3eca 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.Callable;
-import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
@@ -336,8 +335,7 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
                             map = new HashMap<>();
                         }
 
-                        map.put(new ObjectKey(String.valueOf(i)),
-                            vals[ThreadLocalRandom.current().nextInt(vals.length)]);
+                        map.put(new ObjectKey(String.valueOf(i)), F.rand(vals));
                     }
 
                     if (!map.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
index 52737e7..cb24e54 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
@@ -757,7 +757,7 @@ public abstract class GridCacheEventAbstractTest extends GridCacheAbstractSelfTe
             if (TEST_INFO)
                 X.println("Cache event: " + evt.shortDisplay());
 
-            AtomicInteger cntr = F.addIfAbsent(cntrs, evt.type(), new AtomicInteger());
+            AtomicInteger cntr = F.addIfAbsent(cntrs, evt.type(), F.newAtomicInt());
 
             assert cntr != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
index 3482fd6..1aae999 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
@@ -517,16 +517,12 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes
          * @param shmemIds Shared memory IDs string.
          */
         public void shmemIds(String shmemIds) {
-            if (shmemIds == null)
-                this.shmemIds = null;
-            else {
-                String[] tokens = shmemIds.split(",");
-
-                this.shmemIds = new ArrayList<>(tokens.length);
-
-                for (String token : tokens)
-                    this.shmemIds.add(Long.valueOf(token).intValue());
-            }
+            this.shmemIds = (shmemIds == null) ? null :
+                F.transform(shmemIds.split(","), new C1<String, Integer>() {
+                    @Override public Integer apply(String s) {
+                        return Long.valueOf(s).intValue();
+                    }
+                });
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
index 353367e..37e7afe 100644
--- a/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
@@ -748,14 +748,8 @@ public class GridBasicPerformanceTest {
         for (int i = 0; i < MAX; i++) {
             if (sort)
                 Arrays.binarySearch(arr, ThreadLocalRandom8.current().nextInt(lim));
-            else {
-                int val = ThreadLocalRandom8.current().nextInt(lim);
-
-                for (long arrItem : arr) {
-                    if (arrItem == val)
-                        break;
-                }
-            }
+            else
+                F.contains(arr, ThreadLocalRandom8.current().nextInt(lim));
         }
 
         long time =  System.currentTimeMillis() - start;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java
new file mode 100644
index 0000000..5afd75f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.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.lang;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.apache.ignite.internal.util.lang.GridIterator;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.testframework.junits.common.GridCommonTest;
+
+/**
+ * GridFunc performance test.
+ */
+@GridCommonTest(group = "Lang")
+public class GridFuncPerformanceTest extends GridCommonAbstractTest {
+    /**
+     *  Creates test.
+     */
+    public GridFuncPerformanceTest() {
+        super(/*start grid*/false);
+    }
+
+    /**
+     *
+     */
+    public void testTransformingIteratorPerformance() {
+        // Warmup.
+        testBody();
+        testBody();
+        testBody();
+
+        long r1 = testBody();
+        long r2 = testBody();
+        long r3 = testBody();
+
+        double r = (r1 + r2 + r3) / 3.f;
+
+        System.out.println("Average result is: " + Math.round(r) + "msec.");
+    }
+
+    /**
+     *
+     * @return Duration of the test.
+     */
+    @SuppressWarnings({"UnusedDeclaration"})
+    private long testBody() {
+        int MAX = 20000000;
+
+        Collection<Integer> l = new ArrayList<>(MAX);
+
+        for (int i = 0; i < MAX / 10; i++)
+            l.add(i);
+
+        IgniteClosure<Integer, Integer> c = new IgniteClosure<Integer, Integer>() {
+            @Override public Integer apply(Integer e) {
+                return e;
+            }
+        };
+
+        IgnitePredicate<Integer> p1 = new IgnitePredicate<Integer>() {
+            @Override public boolean apply(Integer e) {
+                return e % 2 == 0;
+            }
+        };
+        IgnitePredicate<Integer> p2 = new IgnitePredicate<Integer>() {
+            @Override public boolean apply(Integer e) {
+                return e % 2 != 0;
+            }
+        };
+
+        GridIterator<Integer> iter = F.iterator(l, c, true, p1, p2);
+
+        long n = 0;
+
+        long start = System.currentTimeMillis();
+
+        for (Integer i : iter)
+            n += i;
+
+        long duration = System.currentTimeMillis() - start;
+
+        System.out.println("Duration: " + duration + "msec.");
+
+        return duration;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java b/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
index 10b140e..5d517a4 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
@@ -107,7 +107,7 @@ public class GridLoadTestStatistics {
                     AtomicInteger cnt;
 
                     synchronized (nodeCnts) {
-                        cnt = F.addIfAbsent(nodeCnts, id, new AtomicInteger());
+                        cnt = F.addIfAbsent(nodeCnts, id, F.newAtomicInt());
                     }
 
                     assert cnt != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 9582df0..28adeee 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -24,10 +24,10 @@ import java.util.Iterator;
 import java.util.NavigableMap;
 import java.util.concurrent.ConcurrentNavigableMap;
 import java.util.concurrent.ConcurrentSkipListMap;
+import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.offheap.unsafe.GridOffHeapSnapTreeMap;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeGuard;
 import org.apache.ignite.internal.util.snaptree.SnapTreeMap;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.indexing.IndexingQueryFilter;
@@ -319,7 +319,7 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
             comparable(last, 1));
 
         if (range == null)
-            return F.emptyIterator();
+            return new GridEmptyIterator<>();
 
         return filter(range.values().iterator());
     }


[41/50] [abbrv] ignite git commit: IGNITE-2265: Replaced atomics with updaters on hot paths.

Posted by vo...@apache.org.
IGNITE-2265: Replaced atomics with updaters on hot paths.


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

Branch: refs/heads/ignite-2234
Commit: cd5cd2efe08efef42aef4f130474c563391e6fbe
Parents: 8057925
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jan 3 22:58:06 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jan 3 22:58:06 2016 +0400

----------------------------------------------------------------------
 .../GridDistributedTxRemoteAdapter.java         | 12 ++-
 .../dht/CacheDistributedGetFutureAdapter.java   | 10 ++-
 .../distributed/dht/GridDhtTxFinishFuture.java  | 15 +++-
 .../cache/distributed/dht/GridDhtTxLocal.java   | 31 ++++---
 .../distributed/dht/GridDhtTxPrepareFuture.java | 48 ++++++----
 .../dht/GridPartitionedGetFuture.java           |  2 +-
 .../distributed/near/GridNearGetFuture.java     |  2 +-
 ...arOptimisticSerializableTxPrepareFuture.java | 94 +++++++++++---------
 .../near/GridNearOptimisticTxPrepareFuture.java | 63 +++++++------
 .../GridNearPessimisticTxPrepareFuture.java     |  6 +-
 .../cache/distributed/near/GridNearTxLocal.java | 69 ++++++++------
 .../near/GridNearTxPrepareFutureAdapter.java    |  8 +-
 .../cache/local/GridLocalLockFuture.java        | 19 ++--
 .../cache/transactions/IgniteTxAdapter.java     | 24 ++---
 .../cache/transactions/IgniteTxEntry.java       | 12 ++-
 .../transactions/IgniteTxLocalAdapter.java      | 38 ++++----
 .../internal/GridUpdateNotifierSelfTest.java    |  2 +-
 17 files changed, 284 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 1fd0b2e..8e9d4a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -25,7 +25,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -87,6 +88,10 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Commit allowed field updater. */
+    private static final AtomicIntegerFieldUpdater<GridDistributedTxRemoteAdapter> COMMIT_ALLOWED_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(GridDistributedTxRemoteAdapter.class, "commitAllowed");
+
     /** Explicit versions. */
     @GridToStringInclude
     private List<GridCacheVersion> explicitVers;
@@ -96,8 +101,9 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
     private boolean started;
 
     /** {@code True} only if all write entries are locked by this transaction. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringInclude
-    private AtomicBoolean commitAllowed = new AtomicBoolean(false);
+    private volatile int commitAllowed;
 
     /** */
     @GridToStringInclude
@@ -440,7 +446,7 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
             }
 
             // Only one thread gets to commit.
-            if (commitAllowed.compareAndSet(false, true)) {
+            if (COMMIT_ALLOWED_UPD.compareAndSet(this, 0, 1)) {
                 IgniteCheckedException err = null;
 
                 Map<IgniteTxKey, IgniteTxEntry> writeMap = txState.writeMap();

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index cfbc21b..c43cce9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -21,7 +21,8 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -50,6 +51,10 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
     /** Maximum number of attempts to remap key to the same primary node. */
     protected static final int MAX_REMAP_CNT = getInteger(IGNITE_NEAR_GET_MAX_REMAPS, DFLT_MAX_REMAP_CNT);
 
+    /** Remap count updater. */
+    protected static final AtomicIntegerFieldUpdater<CacheDistributedGetFutureAdapter> REMAP_CNT_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(CacheDistributedGetFutureAdapter.class, "remapCnt");
+
     /** Context. */
     protected final GridCacheContext<K, V> cctx;
 
@@ -69,7 +74,8 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
     protected boolean trackable;
 
     /** Remap count. */
-    protected AtomicInteger remapCnt = new AtomicInteger();
+    @SuppressWarnings("UnusedDeclaration")
+    protected volatile int remapCnt;
 
     /** Subject ID. */
     protected UUID subjId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 9a0d778..0e5db05 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -22,6 +22,8 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cluster.ClusterNode;
@@ -57,6 +59,10 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** Error updater. */
+    private static final AtomicReferenceFieldUpdater<GridDhtTxFinishFuture, Throwable> ERR_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridDhtTxFinishFuture.class, Throwable.class, "err");
+
     /** Logger. */
     private static IgniteLogger log;
 
@@ -74,8 +80,9 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
     private boolean commit;
 
     /** Error. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringExclude
-    private AtomicReference<Throwable> err = new AtomicReference<>(null);
+    private volatile Throwable err;
 
     /** DHT mappings. */
     private Map<UUID, GridDistributedTxMapping> dhtMap;
@@ -142,7 +149,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
      * @param e Error.
      */
     public void onError(Throwable e) {
-        if (err.compareAndSet(null, e)) {
+        if (ERR_UPD.compareAndSet(this, null, e)) {
             boolean marked = tx.setRollbackOnly();
 
             if (e instanceof IgniteTxRollbackCheckedException) {
@@ -199,7 +206,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
             if (this.tx.onePhaseCommit() && (this.tx.state() == COMMITTING))
                 this.tx.tmFinish(err == null);
 
-            Throwable e = this.err.get();
+            Throwable e = this.err;
 
             if (e == null && commit)
                 e = this.tx.commitError();
@@ -235,7 +242,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
      * Completeness callback.
      */
     private void onComplete() {
-        onDone(tx, err.get());
+        onDone(tx, err);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
index f344d48..e026b4e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -22,7 +22,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
@@ -83,10 +84,14 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
     /** Near XID. */
     private GridCacheVersion nearXidVer;
 
+    /** Future updater. */
+    private static final AtomicReferenceFieldUpdater<GridDhtTxLocal, GridDhtTxPrepareFuture> PREP_FUT_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridDhtTxLocal.class, GridDhtTxPrepareFuture.class, "prepFut");
+
     /** Future. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringExclude
-    private final AtomicReference<GridDhtTxPrepareFuture> prepFut =
-        new AtomicReference<>();
+    private volatile GridDhtTxPrepareFuture prepFut;
 
     /**
      * Empty constructor required for {@link Externalizable}.
@@ -306,18 +311,18 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
         }
 
         // For pessimistic mode we don't distribute prepare request.
-        GridDhtTxPrepareFuture fut = prepFut.get();
+        GridDhtTxPrepareFuture fut = prepFut;
 
         if (fut == null) {
             // Future must be created before any exception can be thrown.
-            if (!prepFut.compareAndSet(null, fut = new GridDhtTxPrepareFuture(
+            if (!PREP_FUT_UPD.compareAndSet(this, null, fut = new GridDhtTxPrepareFuture(
                 cctx,
                 this,
                 nearMiniId,
                 Collections.<IgniteTxKey, GridCacheVersion>emptyMap(),
                 true,
                 needReturnValue())))
-                return prepFut.get();
+                return prepFut;
         }
         else
             // Prepare was called explicitly.
@@ -383,20 +388,20 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
         boolean last
     ) {
         // In optimistic mode prepare still can be called explicitly from salvageTx.
-        GridDhtTxPrepareFuture fut = prepFut.get();
+        GridDhtTxPrepareFuture fut = prepFut;
 
         if (fut == null) {
             init();
 
             // Future must be created before any exception can be thrown.
-            if (!prepFut.compareAndSet(null, fut = new GridDhtTxPrepareFuture(
+            if (!PREP_FUT_UPD.compareAndSet(this, null, fut = new GridDhtTxPrepareFuture(
                 cctx,
                 this,
                 nearMiniId,
                 verMap,
                 last,
                 needReturnValue()))) {
-                GridDhtTxPrepareFuture f = prepFut.get();
+                GridDhtTxPrepareFuture f = prepFut;
 
                 assert f.nearMiniId().equals(nearMiniId) : "Wrong near mini id on existing future " +
                     "[futMiniId=" + f.nearMiniId() + ", miniId=" + nearMiniId + ", fut=" + f + ']';
@@ -492,7 +497,7 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
 
         cctx.mvcc().addFuture(fut, fut.futureId());
 
-        GridDhtTxPrepareFuture prep = prepFut.get();
+        GridDhtTxPrepareFuture prep = prepFut;
 
         if (prep != null) {
             if (prep.isDone()) {
@@ -571,12 +576,12 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
     @Override protected void clearPrepareFuture(GridDhtTxPrepareFuture fut) {
         assert optimistic();
 
-        prepFut.compareAndSet(fut, null);
+        PREP_FUT_UPD.compareAndSet(this, fut, null);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<IgniteInternalTx> rollbackAsync() {
-        GridDhtTxPrepareFuture prepFut = this.prepFut.get();
+        GridDhtTxPrepareFuture prepFut = this.prepFut;
 
         final GridDhtTxFinishFuture fut = new GridDhtTxFinishFuture<>(cctx, this, /*rollback*/false);
 
@@ -687,7 +692,7 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public IgniteInternalFuture<?> currentPrepareFuture() {
-        return prepFut.get();
+        return prepFut;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 47dafc8..23fdbf5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -26,8 +26,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.processor.EntryProcessor;
@@ -100,6 +101,10 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** Error updater. */
+    private static final AtomicReferenceFieldUpdater<GridDhtTxPrepareFuture, Throwable> ERR_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridDhtTxPrepareFuture.class, Throwable.class, "err");
+
     /** */
     private static final IgniteReducer<IgniteInternalTx, GridNearTxPrepareResponse> REDUCER =
         new IgniteReducer<IgniteInternalTx, GridNearTxPrepareResponse>() {
@@ -113,6 +118,14 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
             }
         };
 
+    /** Replied flag updater. */
+    private static final AtomicIntegerFieldUpdater<GridDhtTxPrepareFuture> REPLIED_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(GridDhtTxPrepareFuture.class, "replied");
+
+    /** Mapped flag updater. */
+    private static final AtomicIntegerFieldUpdater<GridDhtTxPrepareFuture> MAPPED_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(GridDhtTxPrepareFuture.class, "mapped");
+
     /** Logger. */
     private static IgniteLogger log;
 
@@ -133,13 +146,16 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
     private Map<UUID, GridDistributedTxMapping> dhtMap;
 
     /** Error. */
-    private AtomicReference<Throwable> err = new AtomicReference<>(null);
+    @SuppressWarnings("UnusedDeclaration")
+    private volatile Throwable err;
 
     /** Replied flag. */
-    private AtomicBoolean replied = new AtomicBoolean(false);
+    @SuppressWarnings("UnusedDeclaration")
+    private volatile int replied;
 
     /** All replies flag. */
-    private AtomicBoolean mapped = new AtomicBoolean(false);
+    @SuppressWarnings("UnusedDeclaration")
+    private volatile int mapped;
 
     /** Prepare reads. */
     private Iterable<IgniteTxEntry> reads;
@@ -570,9 +586,10 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
      *
      * @return {@code True} if all locks are acquired, {@code false} otherwise.
      */
+    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
     private boolean mapIfLocked() {
         if (checkLocks()) {
-            if (!mapped.compareAndSet(false, true))
+            if (!MAPPED_UPD.compareAndSet(this, 0, 1))
                 return false;
 
             if (forceKeysFut == null || (forceKeysFut.isDone() && forceKeysFut.error() == null))
@@ -606,7 +623,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         assert err != null || (initialized() && !hasPending()) : "On done called for prepare future that has " +
             "pending mini futures: " + this;
 
-        this.err.compareAndSet(null, err);
+        ERR_UPD.compareAndSet(this, null, err);
 
         // Must clear prepare future before response is sent or listeners are notified.
         if (tx.optimistic())
@@ -616,7 +633,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         if (tx.onePhaseCommit() && tx.commitOnPrepare()) {
             assert last;
 
-            Throwable prepErr = this.err.get();
+            Throwable prepErr = this.err;
 
             // Must create prepare response before transaction is committed to grab correct return value.
             final GridNearTxPrepareResponse res = createPrepareResponse(prepErr);
@@ -631,7 +648,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                         new CIX1<IgniteInternalFuture<IgniteInternalTx>>() {
                             @Override public void applyx(IgniteInternalFuture<IgniteInternalTx> fut) {
                                 try {
-                                    if (replied.compareAndSet(false, true))
+                                    if (REPLIED_UPD.compareAndSet(GridDhtTxPrepareFuture.this, 0, 1))
                                         sendPrepareResponse(res);
                                 }
                                 catch (IgniteCheckedException e) {
@@ -669,7 +686,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
             }
             else {
                 try {
-                    if (replied.compareAndSet(false, true))
+                    if (REPLIED_UPD.compareAndSet(this, 0, 1))
                         sendPrepareResponse(res);
                 }
                 catch (IgniteCheckedException e) {
@@ -680,8 +697,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
             return true;
         }
         else {
-            if (replied.compareAndSet(false, true)) {
-                GridNearTxPrepareResponse res = createPrepareResponse(this.err.get());
+            if (REPLIED_UPD.compareAndSet(this, 0, 1)) {
+                GridNearTxPrepareResponse res = createPrepareResponse(this.err);
 
                 try {
                     sendPrepareResponse(res);
@@ -720,7 +737,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
      */
     private void sendPrepareResponse(GridNearTxPrepareResponse res) throws IgniteCheckedException {
         if (!tx.nearNodeId().equals(cctx.localNodeId())) {
-            Throwable err = this.err.get();
+            Throwable err = this.err;
 
             if (err != null && err instanceof IgniteFutureCancelledException)
                 return;
@@ -851,7 +868,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         if (last || tx.isSystemInvalidate())
             tx.state(PREPARED);
 
-        if (super.onDone(res, err.get())) {
+        if (super.onDone(res, err)) {
             // Don't forget to clean up.
             cctx.mvcc().removeMvccFuture(this);
 
@@ -1045,11 +1062,11 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                 }
 
                 if (err0 != null) {
-                    err.compareAndSet(null, err0);
+                    ERR_UPD.compareAndSet(this, null, err0);
 
                     tx.rollbackAsync();
 
-                    final GridNearTxPrepareResponse res = createPrepareResponse(err.get());
+                    final GridNearTxPrepareResponse res = createPrepareResponse(err);
 
                     onDone(res, res.error());
 
@@ -1467,6 +1484,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         /**
          * @param res Result callback.
          */
+        @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
         void onResult(GridDhtTxPrepareResponse res) {
             if (res.error() != null)
                 // Fail the whole compound future.

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index e8aaca0..19df1c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -474,7 +474,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
                 LinkedHashMap<KeyCacheObject, Boolean> keys = mapped.get(node);
 
                 if (keys != null && keys.containsKey(key)) {
-                    if (remapCnt.incrementAndGet() > MAX_REMAP_CNT) {
+                    if (REMAP_CNT_UPD.incrementAndGet(this) > MAX_REMAP_CNT) {
                         onDone(new ClusterTopologyCheckedException("Failed to remap key to a new node after " +
                             MAX_REMAP_CNT + " attempts (key got remapped to the same node) [key=" + key + ", node=" +
                             U.toShortString(node) + ", mappings=" + mapped + ']'));

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index a121af9..c547a88 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -577,7 +577,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                     LinkedHashMap<KeyCacheObject, Boolean> keys = mapped.get(affNode);
 
                     if (keys != null && keys.containsKey(key)) {
-                        if (remapCnt.incrementAndGet() > MAX_REMAP_CNT) {
+                        if (REMAP_CNT_UPD.incrementAndGet(this) > MAX_REMAP_CNT) {
                             onDone(new ClusterTopologyCheckedException("Failed to remap key to a new node after " +
                                 MAX_REMAP_CNT + " attempts (key got remapped to the same node) " +
                                 "[key=" + key + ", node=" + U.toShortString(affNode) + ", mappings=" + mapped + ']'));

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
index 37dc564..2090e04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
@@ -23,7 +23,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterTopologyException;
@@ -118,7 +119,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                                         new IgniteTxOptimisticCheckedException("Failed to prepare transaction, " +
                                             "read/write conflict [key=" + key + ", cache=" + ctx.name() + ']');
 
-                                    err.compareAndSet(null, err0);
+                                    ERR_UPD.compareAndSet(this, null, err0);
                                 }
 
                                 break;
@@ -187,7 +188,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                 tx.removeMapping(m.node().id());
         }
 
-        err.compareAndSet(null, e);
+        ERR_UPD.compareAndSet(this, null, e);
 
         if (keyLockFut != null)
             keyLockFut.onDone(e);
@@ -209,7 +210,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
             return false;
 
         if (err != null) {
-            this.err.compareAndSet(null, err);
+            ERR_UPD.compareAndSet(this, null, err);
 
             if (keyLockFut != null)
                 keyLockFut.onDone(err);
@@ -263,7 +264,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
      * @return {@code True} if future was finished by this call.
      */
     private boolean onComplete() {
-        Throwable err0 = err.get();
+        Throwable err0 = err;
 
         if (err0 == null || tx.needCheckBackup())
             tx.state(PREPARED);
@@ -366,7 +367,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         for (GridDistributedTxMapping m : mappings.values()) {
             assert !m.empty();
 
-            add(new MiniFuture(m));
+            add(new MiniFuture(this, m));
         }
 
         Collection<IgniteInternalFuture<?>> futs = (Collection)futures();
@@ -410,7 +411,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
      * @return {@code True} if skip future during remap.
      */
     private boolean skipFuture(boolean remap, IgniteInternalFuture<?> fut) {
-        return !(isMini(fut)) || (remap && ((MiniFuture)fut).rcvRes.get());
+        return !(isMini(fut)) || (remap && (((MiniFuture)fut).rcvRes == 1));
     }
 
     /**
@@ -630,7 +631,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
     /**
      *
      */
-    private class ClientRemapFuture extends GridCompoundFuture<GridNearTxPrepareResponse, Boolean> {
+    private static class ClientRemapFuture extends GridCompoundFuture<GridNearTxPrepareResponse, Boolean> {
         /** */
         private boolean remap = true;
 
@@ -660,24 +661,34 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
     /**
      *
      */
-    private class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
+    private static class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
         /** */
         private static final long serialVersionUID = 0L;
 
+        /** Receive result flag updater. */
+        private static AtomicIntegerFieldUpdater<MiniFuture> RCV_RES_UPD =
+            AtomicIntegerFieldUpdater.newUpdater(MiniFuture.class, "rcvRes");
+
         /** */
         private final IgniteUuid futId = IgniteUuid.randomUuid();
 
+        /** Parent future. */
+        private final GridNearOptimisticSerializableTxPrepareFuture parent;
+
         /** Keys. */
         @GridToStringInclude
         private GridDistributedTxMapping m;
 
         /** Flag to signal some result being processed. */
-        private AtomicBoolean rcvRes = new AtomicBoolean(false);
+        @SuppressWarnings("UnusedDeclaration")
+        private volatile int rcvRes;
 
         /**
+         * @param parent Parent future.
          * @param m Mapping.
          */
-        MiniFuture(GridDistributedTxMapping m) {
+        MiniFuture(GridNearOptimisticSerializableTxPrepareFuture parent, GridDistributedTxMapping m) {
+            this.parent = parent;
             this.m = m;
         }
 
@@ -706,8 +717,8 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
          * @param e Error.
          */
         void onResult(Throwable e) {
-            if (rcvRes.compareAndSet(false, true)) {
-                onError(m, e);
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
+                parent.onError(m, e);
 
                 if (log.isDebugEnabled())
                     log.debug("Failed to get future result [fut=" + this + ", err=" + e + ']');
@@ -717,7 +728,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
             }
             else
                 U.warn(log, "Received error after another result has been processed [fut=" +
-                    GridNearOptimisticSerializableTxPrepareFuture.this + ", mini=" + this + ']', e);
+                    parent + ", mini=" + this + ']', e);
         }
 
         /**
@@ -727,11 +738,11 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
             if (isDone())
                 return;
 
-            if (rcvRes.compareAndSet(false, true)) {
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
                 if (log.isDebugEnabled())
                     log.debug("Remote node left grid while sending or waiting for reply (will not retry): " + this);
 
-                onError(null, e);
+                parent.onError(null, e);
 
                 onDone(e);
             }
@@ -740,40 +751,40 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         /**
          * @param res Result callback.
          */
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"})
         void onResult(final GridNearTxPrepareResponse res) {
             if (isDone())
                 return;
 
-            if (rcvRes.compareAndSet(false, true)) {
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
                 if (res.error() != null) {
                     // Fail the whole compound future.
-                    onError(m, res.error());
+                    parent.onError(m, res.error());
 
                     onDone(res.error());
                 }
                 else {
                     if (res.clientRemapVersion() != null) {
-                        assert cctx.kernalContext().clientNode();
+                        assert parent.cctx.kernalContext().clientNode();
                         assert m.clientFirst();
 
-                        tx.removeMapping(m.node().id());
+                        parent.tx.removeMapping(m.node().id());
 
                         ClientRemapFuture remapFut0 = null;
 
-                        synchronized (GridNearOptimisticSerializableTxPrepareFuture.this) {
-                            if (remapFut == null) {
-                                remapFut = new ClientRemapFuture();
+                        synchronized (parent) {
+                            if (parent.remapFut == null) {
+                                parent.remapFut = new ClientRemapFuture();
 
-                                remapFut0 = remapFut;
+                                remapFut0 = parent.remapFut;
                             }
                         }
 
                         if (remapFut0 != null) {
-                            Collection<IgniteInternalFuture<?>> futs = (Collection)futures();
+                            Collection<IgniteInternalFuture<?>> futs = (Collection)parent.futures();
 
                             for (IgniteInternalFuture<?> fut : futs) {
-                                if (isMini(fut) && fut != this)
+                                if (parent.isMini(fut) && fut != this)
                                     remapFut0.add((MiniFuture)fut);
                             }
 
@@ -783,22 +794,22 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                                 @Override public void apply(IgniteInternalFuture<Boolean> remapFut0) {
                                     try {
                                         IgniteInternalFuture<?> affFut =
-                                            cctx.exchange().affinityReadyFuture(res.clientRemapVersion());
+                                            parent.cctx.exchange().affinityReadyFuture(res.clientRemapVersion());
 
                                         if (affFut == null)
                                             affFut = new GridFinishedFuture<Object>();
 
-                                        if (remapFut.get()) {
+                                        if (parent.remapFut.get()) {
                                             if (log.isDebugEnabled()) {
                                                 log.debug("Will remap client tx [" +
-                                                    "fut=" + GridNearOptimisticSerializableTxPrepareFuture.this +
+                                                    "fut=" + parent +
                                                     ", topVer=" + res.topologyVersion() + ']');
                                             }
 
-                                            synchronized (GridNearOptimisticSerializableTxPrepareFuture.this) {
-                                                assert remapFut0 == remapFut;
+                                            synchronized (parent) {
+                                                assert remapFut0 == parent.remapFut;
 
-                                                remapFut = null;
+                                                parent.remapFut = null;
                                             }
 
                                             affFut.listen(new CI1<IgniteInternalFuture<?>>() {
@@ -809,7 +820,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                                                         remap(res);
                                                     }
                                                     catch (IgniteCheckedException e) {
-                                                        err.compareAndSet(null, e);
+                                                        ERR_UPD.compareAndSet(parent, null, e);
 
                                                         onDone(e);
                                                     }
@@ -822,7 +833,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
 
                                             err0.retryReadyFuture(affFut);
 
-                                            err.compareAndSet(null, err0);
+                                            ERR_UPD.compareAndSet(parent, null, err0);
 
                                             onDone(err0);
                                         }
@@ -830,10 +841,10 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                                     catch (IgniteCheckedException e) {
                                         if (log.isDebugEnabled()) {
                                             log.debug("Prepare failed, will not remap tx: " +
-                                                GridNearOptimisticSerializableTxPrepareFuture.this);
+                                                parent);
                                         }
 
-                                        err.compareAndSet(null, e);
+                                        ERR_UPD.compareAndSet(parent, null, e);
 
                                         onDone(e);
                                     }
@@ -844,10 +855,10 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                             onDone(res);
                     }
                     else {
-                        onPrepareResponse(m, res);
+                        parent.onPrepareResponse(m, res);
 
                         // Finish this mini future (need result only on client node).
-                        onDone(cctx.kernalContext().clientNode() ? res : null);
+                        onDone(parent.cctx.kernalContext().clientNode() ? res : null);
                     }
                 }
             }
@@ -857,8 +868,9 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
          * @param res Response.
          */
         private void remap(final GridNearTxPrepareResponse res) {
-            prepareOnTopology(true, new Runnable() {
-                @Override public void run() {
+            parent.prepareOnTopology(true, new Runnable() {
+                @Override
+                public void run() {
                     onDone(res);
                 }
             });

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index a9f158a..bae0327 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -24,7 +24,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Queue;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterTopologyException;
@@ -132,7 +133,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
             }
         }
 
-        if (err.compareAndSet(null, e)) {
+        if (ERR_UPD.compareAndSet(this, null, e)) {
             boolean marked = tx.setRollbackOnly();
 
             if (e instanceof IgniteTxRollbackCheckedException) {
@@ -199,7 +200,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
         if (isDone())
             return false;
 
-        this.err.compareAndSet(null, err);
+        ERR_UPD.compareAndSet(this, null, err);
 
         return onComplete();
     }
@@ -218,7 +219,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
      * @return {@code True} if future was finished by this call.
      */
     private boolean onComplete() {
-        Throwable err0 = err.get();
+        Throwable err0 = err;
 
         if (err0 == null || tx.needCheckBackup())
             tx.state(PREPARED);
@@ -448,7 +449,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
                 }
             }
 
-            final MiniFuture fut = new MiniFuture(m, mappings);
+            final MiniFuture fut = new MiniFuture(this, m, mappings);
 
             req.miniId(fut.futureId());
 
@@ -611,10 +612,17 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
     /**
      *
      */
-    private class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
+    private static class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
         /** */
         private static final long serialVersionUID = 0L;
 
+        /** Receive result flag updater. */
+        private static AtomicIntegerFieldUpdater<MiniFuture> RCV_RES_UPD =
+            AtomicIntegerFieldUpdater.newUpdater(MiniFuture.class, "rcvRes");
+
+        /** Parent future. */
+        private final GridNearOptimisticTxPrepareFuture parent;
+
         /** */
         private final IgniteUuid futId = IgniteUuid.randomUuid();
 
@@ -623,19 +631,20 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
         private GridDistributedTxMapping m;
 
         /** Flag to signal some result being processed. */
-        private AtomicBoolean rcvRes = new AtomicBoolean(false);
+        @SuppressWarnings("UnusedDeclaration")
+        private volatile int rcvRes;
 
         /** Mappings to proceed prepare. */
         private Queue<GridDistributedTxMapping> mappings;
 
         /**
+         * @param parent Parent.
          * @param m Mapping.
          * @param mappings Queue of mappings to proceed with.
          */
-        MiniFuture(
-            GridDistributedTxMapping m,
-            Queue<GridDistributedTxMapping> mappings
-        ) {
+        MiniFuture(GridNearOptimisticTxPrepareFuture parent, GridDistributedTxMapping m,
+            Queue<GridDistributedTxMapping> mappings) {
+            this.parent = parent;
             this.m = m;
             this.mappings = mappings;
         }
@@ -665,7 +674,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
          * @param e Error.
          */
         void onResult(Throwable e) {
-            if (rcvRes.compareAndSet(false, true)) {
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
                 if (log.isDebugEnabled())
                     log.debug("Failed to get future result [fut=" + this + ", err=" + e + ']');
 
@@ -674,7 +683,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
             }
             else
                 U.warn(log, "Received error after another result has been processed [fut=" +
-                    GridNearOptimisticTxPrepareFuture.this + ", mini=" + this + ']', e);
+                    parent + ", mini=" + this + ']', e);
         }
 
         /**
@@ -684,13 +693,13 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
             if (isDone())
                 return;
 
-            if (rcvRes.compareAndSet(false, true)) {
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
                 if (log.isDebugEnabled())
                     log.debug("Remote node left grid while sending or waiting for reply (will not retry): " + this);
 
                 // Fail the whole future (make sure not to remap on different primary node
                 // to prevent multiple lock coordinators).
-                onError(e);
+                parent.onError(e);
             }
         }
 
@@ -698,21 +707,23 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
          * @param nodeId Failed node ID.
          * @param res Result callback.
          */
+        @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
         void onResult(UUID nodeId, final GridNearTxPrepareResponse res) {
             if (isDone())
                 return;
 
-            if (rcvRes.compareAndSet(false, true)) {
+            if (RCV_RES_UPD.compareAndSet(this, 0, 1)) {
                 if (res.error() != null) {
                     // Fail the whole compound future.
-                    onError(res.error());
+                    parent.onError(res.error());
                 }
                 else {
                     if (res.clientRemapVersion() != null) {
-                        assert cctx.kernalContext().clientNode();
+                        assert parent.cctx.kernalContext().clientNode();
                         assert m.clientFirst();
 
-                        IgniteInternalFuture<?> affFut = cctx.exchange().affinityReadyFuture(res.clientRemapVersion());
+                        IgniteInternalFuture<?> affFut =
+                            parent.cctx.exchange().affinityReadyFuture(res.clientRemapVersion());
 
                         if (affFut != null && !affFut.isDone()) {
                             affFut.listen(new CI1<IgniteInternalFuture<?>>() {
@@ -730,13 +741,12 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
                         }
                         else
                             remap();
-                    }
-                    else {
-                        onPrepareResponse(m, res);
+                    } else {
+                        parent.onPrepareResponse(m, res);
 
                         // Proceed prepare before finishing mini future.
                         if (mappings != null)
-                            proceedPrepare(mappings);
+                            parent.proceedPrepare(mappings);
 
                         // Finish this mini future.
                         onDone((GridNearTxPrepareResponse)null);
@@ -749,9 +759,10 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
          *
          */
         private void remap() {
-            prepareOnTopology(true, new Runnable() {
-                @Override public void run() {
-                    onDone((GridNearTxPrepareResponse)null);
+            parent.prepareOnTopology(true, new Runnable() {
+                @Override
+                public void run() {
+                    onDone((GridNearTxPrepareResponse) null);
                 }
             });
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index ffe5373..9ee9aea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -279,9 +279,9 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
     /** {@inheritDoc} */
     @Override public boolean onDone(@Nullable IgniteInternalTx res, @Nullable Throwable err) {
         if (err != null)
-            this.err.compareAndSet(null, err);
+            ERR_UPD.compareAndSet(GridNearPessimisticTxPrepareFuture.this, null, err);
 
-        err = this.err.get();
+        err = this.err;
 
         if (err == null || tx.needCheckBackup())
             tx.state(PREPARED);
@@ -384,7 +384,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
             if (log.isDebugEnabled())
                 log.debug("Error on tx prepare [fut=" + this + ", err=" + e + ", tx=" + tx +  ']');
 
-            if (err.compareAndSet(null, e))
+            if (ERR_UPD.compareAndSet(GridNearPessimisticTxPrepareFuture.this, null, e))
                 tx.setRollbackOnly();
 
             onDone(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index ae4972e..aa4e929f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import javax.cache.expiry.ExpiryPolicy;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
@@ -84,20 +85,35 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Prepare future updater. */
+    private static final AtomicReferenceFieldUpdater<GridNearTxLocal, IgniteInternalFuture> PREP_FUT_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridNearTxLocal.class, IgniteInternalFuture.class, "prepFut");
+
+    /** Prepare future updater. */
+    private static final AtomicReferenceFieldUpdater<GridNearTxLocal, GridNearTxFinishFuture> COMMIT_FUT_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridNearTxLocal.class, GridNearTxFinishFuture.class, "commitFut");
+
+    /** Rollback future updater. */
+    private static final AtomicReferenceFieldUpdater<GridNearTxLocal, GridNearTxFinishFuture> ROLLBACK_FUT_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridNearTxLocal.class, GridNearTxFinishFuture.class, "rollbackFut");
+
     /** DHT mappings. */
     private IgniteTxMappings mappings;
 
-    /** Future. */
+    /** Prepare future. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringExclude
-    private final AtomicReference<IgniteInternalFuture<?>> prepFut = new AtomicReference<>();
+    private volatile IgniteInternalFuture<?> prepFut;
 
-    /** */
+    /** Commit future. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringExclude
-    private final AtomicReference<GridNearTxFinishFuture> commitFut = new AtomicReference<>();
+    private volatile GridNearTxFinishFuture commitFut;
 
-    /** */
+    /** Rollback future. */
+    @SuppressWarnings("UnusedDeclaration")
     @GridToStringExclude
-    private final AtomicReference<GridNearTxFinishFuture> rollbackFut = new AtomicReference<>();
+    private volatile GridNearTxFinishFuture rollbackFut;
 
     /** Entries to lock on next step of prepare stage. */
     private Collection<IgniteTxEntry> optimisticLockEntries = Collections.emptyList();
@@ -225,7 +241,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
     /** {@inheritDoc} */
     @Override protected void clearPrepareFuture(GridDhtTxPrepareFuture fut) {
-        prepFut.compareAndSet(fut, null);
+        PREP_FUT_UPD.compareAndSet(this, fut, null);
     }
 
     /** {@inheritDoc} */
@@ -630,7 +646,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
     /** {@inheritDoc} */
     @Override public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner) {
-        GridCacheMvccFuture<IgniteInternalTx> fut = (GridCacheMvccFuture<IgniteInternalTx>)prepFut.get();
+        GridCacheMvccFuture<IgniteInternalTx> fut = (GridCacheMvccFuture<IgniteInternalTx>)prepFut;
 
         return fut != null && fut.onOwnerChanged(entry, owner);
     }
@@ -784,7 +800,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<?> prepareAsync() {
-        GridNearTxPrepareFutureAdapter fut = (GridNearTxPrepareFutureAdapter)prepFut.get();
+        GridNearTxPrepareFutureAdapter fut = (GridNearTxPrepareFutureAdapter)prepFut;
 
         if (fut == null) {
             // Future must be created before any exception can be thrown.
@@ -796,8 +812,8 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
             else
                 fut = new GridNearPessimisticTxPrepareFuture(cctx, this);
 
-            if (!prepFut.compareAndSet(null, fut))
-                return prepFut.get();
+            if (!PREP_FUT_UPD.compareAndSet(this, null, fut))
+                return prepFut;
         }
         else
             // Prepare was called explicitly.
@@ -818,18 +834,19 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
         prepareAsync();
 
-        GridNearTxFinishFuture fut = commitFut.get();
+        GridNearTxFinishFuture fut = commitFut;
 
-        if (fut == null && !commitFut.compareAndSet(null, fut = new GridNearTxFinishFuture<>(cctx, this, true)))
-            return commitFut.get();
+        if (fut == null &&
+            !COMMIT_FUT_UPD.compareAndSet(this, null, fut = new GridNearTxFinishFuture<>(cctx, this, true)))
+            return commitFut;
 
         cctx.mvcc().addFuture(fut, fut.futureId());
 
-        final IgniteInternalFuture<?> prepareFut = prepFut.get();
+        final IgniteInternalFuture<?> prepareFut = prepFut;
 
         prepareFut.listen(new CI1<IgniteInternalFuture<?>>() {
             @Override public void apply(IgniteInternalFuture<?> f) {
-                GridNearTxFinishFuture fut0 = commitFut.get();
+                GridNearTxFinishFuture fut0 = commitFut;
 
                 try {
                     // Make sure that here are no exceptions.
@@ -838,14 +855,14 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
                     fut0.finish();
                 }
                 catch (Error | RuntimeException e) {
-                    commitErr.compareAndSet(null, e);
+                    COMMIT_ERR_UPD.compareAndSet(GridNearTxLocal.this, null, e);
 
                     fut0.onDone(e);
 
                     throw e;
                 }
                 catch (IgniteCheckedException e) {
-                    commitErr.compareAndSet(null, e);
+                    COMMIT_ERR_UPD.compareAndSet(GridNearTxLocal.this, null, e);
 
                     fut0.onDone(e);
                 }
@@ -860,17 +877,17 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
         if (log.isDebugEnabled())
             log.debug("Rolling back near tx: " + this);
 
-        GridNearTxFinishFuture fut = rollbackFut.get();
+        GridNearTxFinishFuture fut = rollbackFut;
 
         if (fut != null)
             return fut;
 
-        if (!rollbackFut.compareAndSet(null, fut = new GridNearTxFinishFuture<>(cctx, this, false)))
-            return rollbackFut.get();
+        if (!ROLLBACK_FUT_UPD.compareAndSet(this, null, fut = new GridNearTxFinishFuture<>(cctx, this, false)))
+            return rollbackFut;
 
         cctx.mvcc().addFuture(fut, fut.futureId());
 
-        IgniteInternalFuture<?> prepFut = this.prepFut.get();
+        IgniteInternalFuture<?> prepFut = this.prepFut;
 
         if (prepFut == null || prepFut.isDone()) {
             try {
@@ -897,7 +914,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
                             log.debug("Got optimistic tx failure [tx=" + this + ", err=" + e + ']');
                     }
 
-                    GridNearTxFinishFuture fut0 = rollbackFut.get();
+                    GridNearTxFinishFuture fut0 = rollbackFut;
 
                     fut0.finish();
                 }
@@ -997,7 +1014,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
         if (pessimistic())
             prepareAsync();
 
-        IgniteInternalFuture<?> prep = prepFut.get();
+        IgniteInternalFuture<?> prep = prepFut;
 
         // Do not create finish future if there are no remote nodes.
         if (F.isEmpty(dhtMap) && F.isEmpty(nearMap)) {
@@ -1070,7 +1087,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
 
         cctx.mvcc().addFuture(fut, fut.futureId());
 
-        IgniteInternalFuture<?> prep = prepFut.get();
+        IgniteInternalFuture<?> prep = prepFut;
 
         if (prep == null || prep.isDone()) {
             try {
@@ -1279,7 +1296,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public IgniteInternalFuture<?> currentPrepareFuture() {
-        return prepFut.get();
+        return prepFut;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
index 52cad91..ce4d2e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import javax.cache.expiry.ExpiryPolicy;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -53,6 +54,10 @@ public abstract class GridNearTxPrepareFutureAdapter extends
     /** Logger reference. */
     protected static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** Error updater. */
+    protected static final AtomicReferenceFieldUpdater<GridNearTxPrepareFutureAdapter, Throwable> ERR_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridNearTxPrepareFutureAdapter.class, Throwable.class, "err");
+
     /** */
     private static final IgniteReducer<GridNearTxPrepareResponse, IgniteInternalTx> REDUCER =
         new IgniteReducer<GridNearTxPrepareResponse, IgniteInternalTx>() {
@@ -81,7 +86,7 @@ public abstract class GridNearTxPrepareFutureAdapter extends
 
     /** Error. */
     @GridToStringExclude
-    protected AtomicReference<Throwable> err = new AtomicReference<>(null);
+    protected volatile Throwable err;
 
     /** Trackable flag. */
     protected boolean trackable = true;
@@ -165,6 +170,7 @@ public abstract class GridNearTxPrepareFutureAdapter extends
      * @param m Mapping.
      * @param res Response.
      */
+    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
     protected final void onPrepareResponse(GridDistributedTxMapping m, GridNearTxPrepareResponse res) {
         if (res == null)
             return;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
index 9f53c18..2e41f2a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
@@ -22,6 +22,8 @@ import java.util.Collection;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
@@ -53,6 +55,10 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** Error updater. */
+    private static final AtomicReferenceFieldUpdater<GridLocalLockFuture, Throwable> ERR_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(GridLocalLockFuture.class, Throwable.class, "err");
+
     /** Logger. */
     private static IgniteLogger log;
 
@@ -79,7 +85,8 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
     private GridCacheVersion lockVer;
 
     /** Error. */
-    private AtomicReference<Throwable> err = new AtomicReference<>(null);
+    @SuppressWarnings("UnusedDeclaration")
+    private volatile Throwable err;
 
     /** Timeout object. */
     @GridToStringExclude
@@ -274,7 +281,7 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
      * @param t Error.
      */
     void onError(Throwable t) {
-        if (err.compareAndSet(null, t))
+        if (ERR_UPD.compareAndSet(this, null, t))
             onFailed();
     }
 
@@ -392,7 +399,7 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
         if (!success)
             undoLocks();
 
-        if (onDone(success, err.get())) {
+        if (onDone(success, err)) {
             if (log.isDebugEnabled())
                 log.debug("Completing future: " + this);
 
@@ -409,8 +416,10 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
      * @throws IgniteCheckedException If execution failed.
      */
     private void checkError() throws IgniteCheckedException {
-        if (err.get() != null)
-            throw U.cast(err.get());
+        Throwable err0 = err;
+
+        if (err0 != null)
+            throw U.cast(err0);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 53f4f56..22e27c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.processor.EntryProcessor;
 import org.apache.ignite.IgniteCheckedException;
@@ -95,14 +96,17 @@ import static org.apache.ignite.transactions.TransactionState.ROLLING_BACK;
 /**
  * Managed transaction adapter.
  */
-public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
-    implements IgniteInternalTx, Externalizable {
+public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter implements IgniteInternalTx, Externalizable {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** Static logger to avoid re-creation. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** Finalizing status updater. */
+    private static final AtomicReferenceFieldUpdater<IgniteTxAdapter, FinalizationStatus> FINALIZING_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(IgniteTxAdapter.class, FinalizationStatus.class, "finalizing");
+
     /** Logger. */
     protected static IgniteLogger log;
 
@@ -191,8 +195,8 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
     /** Commit version. */
     private volatile GridCacheVersion commitVer;
 
-    /** */
-    private AtomicReference<FinalizationStatus> finalizing = new AtomicReference<>(FinalizationStatus.NONE);
+    /** Finalizing status. */
+    private volatile FinalizationStatus finalizing = FinalizationStatus.NONE;
 
     /** Done marker. */
     protected volatile boolean isDone;
@@ -524,23 +528,23 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
 
         switch (status) {
             case USER_FINISH:
-                res = finalizing.compareAndSet(FinalizationStatus.NONE, FinalizationStatus.USER_FINISH);
+                res = FINALIZING_UPD.compareAndSet(this, FinalizationStatus.NONE, FinalizationStatus.USER_FINISH);
 
                 break;
 
             case RECOVERY_WAIT:
-                finalizing.compareAndSet(FinalizationStatus.NONE, FinalizationStatus.RECOVERY_WAIT);
+                FINALIZING_UPD.compareAndSet(this, FinalizationStatus.NONE, FinalizationStatus.RECOVERY_WAIT);
 
-                FinalizationStatus cur = finalizing.get();
+                FinalizationStatus cur = finalizing;
 
                 res = cur == FinalizationStatus.RECOVERY_WAIT || cur == FinalizationStatus.RECOVERY_FINISH;
 
                 break;
 
             case RECOVERY_FINISH:
-                FinalizationStatus old = finalizing.get();
+                FinalizationStatus old = finalizing;
 
-                res = old != FinalizationStatus.USER_FINISH && finalizing.compareAndSet(old, status);
+                res = old != FinalizationStatus.USER_FINISH && FINALIZING_UPD.compareAndSet(this, old, status);
 
                 break;
 
@@ -565,7 +569,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
      * @return Finalization status.
      */
     protected FinalizationStatus finalizationStatus() {
-        return finalizing.get();
+        return finalizing;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 2c6c3df..c42bc7f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.processor.EntryProcessor;
 import org.apache.ignite.IgniteCheckedException;
@@ -73,6 +73,10 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
     /** Dummy version for any existing entry read in SERIALIZABLE transaction. */
     public static final GridCacheVersion SER_READ_NOT_EMPTY_VER = new GridCacheVersion(0, 0, 0, 1);
 
+    /** Prepared flag updater. */
+    private static final AtomicIntegerFieldUpdater<IgniteTxEntry> PREPARED_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(IgniteTxEntry.class, "prepared");
+
     /** Owning transaction. */
     @GridToStringExclude
     @GridDirectTransient
@@ -149,9 +153,9 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
     private GridCacheContext<?, ?> ctx;
 
     /** Prepared flag to prevent multiple candidate add. */
-    @SuppressWarnings({"TransientFieldNotInitialized"})
+    @SuppressWarnings("UnusedDeclaration")
     @GridDirectTransient
-    private AtomicBoolean prepared = new AtomicBoolean();
+    private transient volatile int prepared;
 
     /** Lock flag for collocated cache. */
     @GridDirectTransient
@@ -441,7 +445,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
      * @return True if entry was marked prepared by this call.
      */
     boolean markPrepared() {
-        return prepared.compareAndSet(false, true);
+        return PREPARED_UPD.compareAndSet(this, 0, 1);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 70c79a5..21ff0cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -29,8 +29,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import javax.cache.Cache;
 import javax.cache.CacheException;
 import javax.cache.expiry.Duration;
@@ -115,16 +115,24 @@ import static org.apache.ignite.transactions.TransactionState.UNKNOWN;
 /**
  * Transaction adapter for cache transactions.
  */
-public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
-    implements IgniteTxLocalEx {
+public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements IgniteTxLocalEx {
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Commit error updater. */
+    protected static final AtomicReferenceFieldUpdater<IgniteTxLocalAdapter, Throwable> COMMIT_ERR_UPD =
+        AtomicReferenceFieldUpdater.newUpdater(IgniteTxLocalAdapter.class, Throwable.class, "commitErr");
+
+    /** Done flag updater. */
+    protected static final AtomicIntegerFieldUpdater<IgniteTxLocalAdapter> DONE_FLAG_UPD =
+        AtomicIntegerFieldUpdater.newUpdater(IgniteTxLocalAdapter.class, "doneFlag");
+
     /** Minimal version encountered (either explicit lock or XID of this transaction). */
     protected GridCacheVersion minVer;
 
     /** Flag indicating with TM commit happened. */
-    protected AtomicBoolean doneFlag = new AtomicBoolean(false);
+    @SuppressWarnings("UnusedDeclaration")
+    protected volatile int doneFlag;
 
     /** Committed versions, relative to base. */
     private Collection<GridCacheVersion> committedVers = Collections.emptyList();
@@ -139,7 +147,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     private boolean sndTransformedVals;
 
     /** Commit error. */
-    protected AtomicReference<Throwable> commitErr = new AtomicReference<>();
+    protected volatile Throwable commitErr;
 
     /** Need return value. */
     protected boolean needRetVal;
@@ -248,12 +256,12 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
     /** {@inheritDoc} */
     @Override public Throwable commitError() {
-        return commitErr.get();
+        return commitErr;
     }
 
     /** {@inheritDoc} */
     @Override public void commitError(Throwable e) {
-        commitErr.compareAndSet(null, e);
+        COMMIT_ERR_UPD.compareAndSet(this, null, e);
     }
 
     /** {@inheritDoc} */
@@ -1164,7 +1172,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                             U.error(log, "Heuristic transaction failure.", err);
 
-                            commitErr.compareAndSet(null, err);
+                            COMMIT_ERR_UPD.compareAndSet(this, null, err);
 
                             state(UNKNOWN);
 
@@ -1194,7 +1202,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
         // Do not unlock transaction entries if one-phase commit.
         if (!onePhaseCommit()) {
-            if (doneFlag.compareAndSet(false, true)) {
+            if (DONE_FLAG_UPD.compareAndSet(this, 0, 1)) {
                 // Unlock all locks.
                 cctx.tm().commitTx(this);
 
@@ -1215,7 +1223,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     public void tmFinish(boolean commit) {
         assert onePhaseCommit();
 
-        if (doneFlag.compareAndSet(false, true)) {
+        if (DONE_FLAG_UPD.compareAndSet(this, 0, 1)) {
             // Unlock all locks.
             if (commit)
                 cctx.tm().commitTx(this);
@@ -1272,8 +1280,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         if (state != ROLLING_BACK && state != ROLLED_BACK) {
             setRollbackOnly();
 
-            throw new IgniteCheckedException("Invalid transaction state for rollback [state=" + state + ", tx=" + this + ']',
-                commitErr.get());
+            throw new IgniteCheckedException("Invalid transaction state for rollback [state=" + state +
+                ", tx=" + this + ']', commitErr);
         }
 
         if (near()) {
@@ -1283,7 +1291,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 evictNearEntry(e, false);
         }
 
-        if (doneFlag.compareAndSet(false, true)) {
+        if (DONE_FLAG_UPD.compareAndSet(this, 0, 1)) {
             try {
                 cctx.tm().rollbackTx(this);
 
@@ -1302,7 +1310,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 }
             }
             catch (Error | IgniteCheckedException | RuntimeException e) {
-                U.addLastCause(e, commitErr.get(), log);
+                U.addLastCause(e, commitErr, log);
 
                 throw e;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd5cd2ef/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
index 93fd916..afaa645 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
@@ -37,7 +37,7 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected long getTestTimeout() {
-        return 30 * 1000;
+        return 120 * 1000;
     }
 
     /** {@inheritDoc} */


[47/50] [abbrv] ignite git commit: IGNITE-2206: Hadoop file system creation is now abstracted out using factory interface.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
index 99ca1ec..0d7de86 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
@@ -17,22 +17,6 @@
 
 package org.apache.ignite.hadoop.fs.v2;
 
-import java.io.BufferedOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -43,6 +27,7 @@ import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileChecksum;
 import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FsServerDefaults;
 import org.apache.hadoop.fs.FsStatus;
 import org.apache.hadoop.fs.InvalidPathException;
@@ -51,13 +36,14 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.util.DataChecksum;
 import org.apache.hadoop.util.Progressable;
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
 import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsFile;
 import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.igfs.common.IgfsLogger;
-import org.apache.ignite.internal.processors.hadoop.SecondaryFileSystemProvider;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsEndpoint;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsInputStream;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsOutputStream;
@@ -74,8 +60,26 @@ import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lifecycle.LifecycleAware;
 import org.jetbrains.annotations.Nullable;
 
+import java.io.BufferedOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import static org.apache.ignite.configuration.FileSystemConfiguration.DFLT_IGFS_LOG_BATCH_SIZE;
 import static org.apache.ignite.configuration.FileSystemConfiguration.DFLT_IGFS_LOG_DIR;
 import static org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem.getFsHadoopUser;
@@ -92,8 +96,6 @@ import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_GROUP_NAME;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_PERMISSION;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_PREFER_LOCAL_WRITES;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_USER_NAME;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_CONFIG_PATH;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_URI;
 
 /**
  * {@code IGFS} Hadoop 2.x file system driver over file system API. To use
@@ -168,8 +170,8 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
     /** Mode resolver. */
     private IgfsModeResolver modeRslvr;
 
-    /** Secondary file system instance. */
-    private AbstractFileSystem secondaryFs;
+    /** The secondary file system factory. */
+    private HadoopFileSystemFactory factory;
 
     /** Whether custom sequential reads before prefetch value is provided. */
     private boolean seqReadsBeforePrefetchOverride;
@@ -335,20 +337,27 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
             }
 
             if (initSecondary) {
-                Map<String, String> props = paths.properties();
+                try {
+                    factory = (HadoopFileSystemFactory) paths.getPayload(getClass().getClassLoader());
+                }
+                catch (IgniteCheckedException e) {
+                    throw new IOException("Failed to get secondary file system factory.", e);
+                }
 
-                String secUri = props.get(SECONDARY_FS_URI);
-                String secConfPath = props.get(SECONDARY_FS_CONFIG_PATH);
+                assert factory != null;
+
+                if (factory instanceof LifecycleAware)
+                    ((LifecycleAware) factory).start();
 
                 try {
-                    SecondaryFileSystemProvider secProvider = new SecondaryFileSystemProvider(secUri, secConfPath);
+                    FileSystem secFs = factory.get(user);
 
-                    secondaryFs = secProvider.createAbstractFileSystem(user);
+                    secondaryUri = secFs.getUri();
 
-                    secondaryUri = secProvider.uri();
+                    A.ensure(secondaryUri != null, "Secondary file system uri should not be null.");
                 }
                 catch (IOException e) {
-                    throw new IOException("Failed to connect to the secondary file system: " + secUri, e);
+                    throw new IOException("Failed to connect to the secondary file system: " + secondaryUri, e);
                 }
             }
         }
@@ -368,6 +377,9 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
             if (clientLog.isLogEnabled())
                 clientLog.close();
 
+            if (factory instanceof LifecycleAware)
+                ((LifecycleAware) factory).stop();
+
             // Reset initialized resources.
             rmtClient = null;
         }
@@ -391,13 +403,13 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
 
     /** {@inheritDoc} */
     @Override public boolean setReplication(Path f, short replication) throws IOException {
-        return mode(f) == PROXY && secondaryFs.setReplication(f, replication);
+        return mode(f) == PROXY && secondaryFileSystem().setReplication(f, replication);
     }
 
     /** {@inheritDoc} */
     @Override public void setTimes(Path f, long mtime, long atime) throws IOException {
         if (mode(f) == PROXY)
-            secondaryFs.setTimes(f, mtime, atime);
+            secondaryFileSystem().setTimes(f, mtime, atime);
         else {
             if (mtime == -1 && atime == -1)
                 return;
@@ -421,7 +433,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
             A.notNull(p, "p");
 
             if (mode(p) == PROXY)
-                secondaryFs.setPermission(toSecondary(p), perm);
+                secondaryFileSystem().setPermission(toSecondary(p), perm);
             else {
                 if (rmtClient.update(convert(p), permission(perm)) == null)
                     throw new IOException("Failed to set file permission (file not found?)" +
@@ -443,7 +455,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
 
         try {
             if (mode(p) == PROXY)
-                secondaryFs.setOwner(toSecondary(p), usr, grp);
+                secondaryFileSystem().setOwner(toSecondary(p), usr, grp);
             else if (rmtClient.update(convert(p), F.asMap(PROP_USER_NAME, usr, PROP_GROUP_NAME, grp)) == null)
                 throw new IOException("Failed to set file permission (file not found?)" +
                     " [path=" + p + ", username=" + usr + ", grpName=" + grp + ']');
@@ -464,11 +476,11 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
             IgfsMode mode = modeRslvr.resolveMode(path);
 
             if (mode == PROXY) {
-                FSDataInputStream is = secondaryFs.open(toSecondary(f), bufSize);
+                FSDataInputStream is = secondaryFileSystem().open(toSecondary(f), bufSize);
 
                 if (clientLog.isLogEnabled()) {
                     // At this point we do not know file size, so we perform additional request to remote FS to get it.
-                    FileStatus status = secondaryFs.getFileStatus(toSecondary(f));
+                    FileStatus status = secondaryFileSystem().getFileStatus(toSecondary(f));
 
                     long size = status != null ? status.getLen() : -1;
 
@@ -543,8 +555,8 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
                     path + ", overwrite=" + overwrite + ", bufSize=" + bufSize + ']');
 
             if (mode == PROXY) {
-                FSDataOutputStream os = secondaryFs.createInternal(toSecondary(f), flag, perm, bufSize,
-                    replication, blockSize, progress, checksumOpt, createParent);
+                FSDataOutputStream os = secondaryFileSystem().create(toSecondary(f), perm, flag, bufSize,
+                    replication, blockSize, progress);
 
                 if (clientLog.isLogEnabled()) {
                     long logId = IgfsLogger.nextId();
@@ -641,7 +653,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
                 if (clientLog.isLogEnabled())
                     clientLog.logRename(srcPath, PROXY, dstPath);
 
-                secondaryFs.renameInternal(toSecondary(src), toSecondary(dst));
+                secondaryFileSystem().rename(toSecondary(src), toSecondary(dst));
             }
             else {
                 if (clientLog.isLogEnabled())
@@ -671,7 +683,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
                 if (clientLog.isLogEnabled())
                     clientLog.logDelete(path, PROXY, recursive);
 
-                return secondaryFs.delete(toSecondary(f), recursive);
+                return secondaryFileSystem().delete(toSecondary(f), recursive);
             }
 
             boolean res = rmtClient.delete(path, recursive);
@@ -689,14 +701,14 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
     /** {@inheritDoc} */
     @Override public void setVerifyChecksum(boolean verifyChecksum) throws IOException {
         // Checksum has effect for secondary FS only.
-        if (secondaryFs != null)
-            secondaryFs.setVerifyChecksum(verifyChecksum);
+        if (factory != null)
+            secondaryFileSystem().setVerifyChecksum(verifyChecksum);
     }
 
     /** {@inheritDoc} */
     @Override public FileChecksum getFileChecksum(Path f) throws IOException {
         if (mode(f) == PROXY)
-            return secondaryFs.getFileChecksum(f);
+            return secondaryFileSystem().getFileChecksum(f);
 
         return null;
     }
@@ -712,7 +724,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
             IgfsMode mode = modeRslvr.resolveMode(path);
 
             if (mode == PROXY) {
-                FileStatus[] arr = secondaryFs.listStatus(toSecondary(f));
+                FileStatus[] arr = secondaryFileSystem().listStatus(toSecondary(f));
 
                 if (arr == null)
                     throw new FileNotFoundException("File " + f + " does not exist.");
@@ -775,7 +787,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
                 if (clientLog.isLogEnabled())
                     clientLog.logMakeDirectory(path, PROXY);
 
-                secondaryFs.mkdir(toSecondary(f), perm, createParent);
+                secondaryFileSystem().mkdirs(toSecondary(f), perm);
             }
             else {
                 rmtClient.mkdirs(path, permission(perm));
@@ -797,7 +809,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
 
         try {
             if (mode(f) == PROXY)
-                return toPrimary(secondaryFs.getFileStatus(toSecondary(f)));
+                return toPrimary(secondaryFileSystem().getFileStatus(toSecondary(f)));
             else {
                 IgfsFile info = rmtClient.info(convert(f));
 
@@ -822,7 +834,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
 
         try {
             if (modeRslvr.resolveMode(igfsPath) == PROXY)
-                return secondaryFs.getFileBlockLocations(path, start, len);
+                return secondaryFileSystem().getFileBlockLocations(path, start, len);
             else {
                 long now = System.currentTimeMillis();
 
@@ -873,7 +885,7 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
      * @return Secondary file system path.
      */
     private Path toSecondary(Path path) {
-        assert secondaryFs != null;
+        assert factory != null;
         assert secondaryUri != null;
 
         return convertPath(path, secondaryUri);
@@ -1045,4 +1057,15 @@ public class IgniteHadoopFileSystem extends AbstractFileSystem implements Closea
     public String user() {
         return user;
     }
+
+    /**
+     * Gets cached or creates a {@link FileSystem}.
+     *
+     * @return The secondary file system.
+     */
+    private FileSystem secondaryFileSystem() throws IOException{
+        assert factory != null;
+
+        return factory.get(user);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
deleted file mode 100644
index d5be074..0000000
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
+++ /dev/null
@@ -1,139 +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.processors.hadoop;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.PrivilegedExceptionAction;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.AbstractFileSystem;
-import org.apache.hadoop.fs.CommonConfigurationKeys;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.ignite.internal.processors.hadoop.fs.HadoopFileSystemsUtils;
-import org.apache.ignite.internal.processors.igfs.IgfsUtils;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Encapsulates logic of secondary filesystem creation.
- */
-public class SecondaryFileSystemProvider {
-    /** Configuration of the secondary filesystem, never null. */
-    private final Configuration cfg = HadoopUtils.safeCreateConfiguration();
-
-    /** The secondary filesystem URI, never null. */
-    private final URI uri;
-
-    /**
-     * Creates new provider with given config parameters. The configuration URL is optional. The filesystem URI must be
-     * specified either explicitly or in the configuration provided.
-     *
-     * @param secUri the secondary Fs URI (optional). If not given explicitly, it must be specified as "fs.defaultFS"
-     * property in the provided configuration.
-     * @param secConfPath the secondary Fs path (file path on the local file system, optional).
-     * See {@link IgniteUtils#resolveIgniteUrl(String)} on how the path resolved.
-     * @throws IOException
-     */
-    public SecondaryFileSystemProvider(final @Nullable String secUri,
-        final @Nullable String secConfPath) throws IOException {
-        if (secConfPath != null) {
-            URL url = U.resolveIgniteUrl(secConfPath);
-
-            if (url == null) {
-                // If secConfPath is given, it should be resolvable:
-                throw new IllegalArgumentException("Failed to resolve secondary file system configuration path " +
-                    "(ensure that it exists locally and you have read access to it): " + secConfPath);
-            }
-
-            cfg.addResource(url);
-        }
-
-        // if secondary fs URI is not given explicitly, try to get it from the configuration:
-        if (secUri == null)
-            uri = FileSystem.getDefaultUri(cfg);
-        else {
-            try {
-                uri = new URI(secUri);
-            }
-            catch (URISyntaxException use) {
-                throw new IOException("Failed to resolve secondary file system URI: " + secUri);
-            }
-        }
-
-        // Disable caching:
-        String prop = HadoopFileSystemsUtils.disableFsCachePropertyName(uri.getScheme());
-
-        cfg.setBoolean(prop, true);
-    }
-
-    /**
-     * @return {@link org.apache.hadoop.fs.FileSystem}  instance for this secondary Fs.
-     * @throws IOException
-     */
-    public FileSystem createFileSystem(String userName) throws IOException {
-        userName = IgfsUtils.fixUserName(userName);
-
-        final FileSystem fileSys;
-
-        try {
-           fileSys = FileSystem.get(uri, cfg, userName);
-        }
-        catch (InterruptedException e) {
-           Thread.currentThread().interrupt();
-
-           throw new IOException("Failed to create file system due to interrupt.", e);
-        }
-
-        return fileSys;
-    }
-
-    /**
-     * @return {@link org.apache.hadoop.fs.AbstractFileSystem} instance for this secondary Fs.
-     * @throws IOException in case of error.
-     */
-    public AbstractFileSystem createAbstractFileSystem(String userName) throws IOException {
-        userName = IgfsUtils.fixUserName(userName);
-
-        String ticketCachePath = cfg.get(CommonConfigurationKeys.KERBEROS_TICKET_CACHE_PATH);
-
-        UserGroupInformation ugi = UserGroupInformation.getBestUGI(ticketCachePath, userName);
-
-        try {
-            return ugi.doAs(new PrivilegedExceptionAction<AbstractFileSystem>() {
-                @Override public AbstractFileSystem run() throws IOException {
-                    return AbstractFileSystem.get(uri, cfg);
-                }
-            });
-        } catch (InterruptedException ie) {
-            Thread.currentThread().interrupt();
-
-            throw new IOException("Failed to create file system due to interrupt.", ie);
-        }
-    }
-
-    /**
-     * @return the secondary fs URI, never null.
-     */
-    public URI uri() {
-        return uri;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopFileSystemCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopFileSystemCacheUtils.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopFileSystemCacheUtils.java
index 48ade79..1ecbee5 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopFileSystemCacheUtils.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopFileSystemCacheUtils.java
@@ -39,7 +39,7 @@ public class HadoopFileSystemCacheUtils {
     public static HadoopLazyConcurrentMap<FsCacheKey, FileSystem> createHadoopLazyConcurrentMap() {
         return new HadoopLazyConcurrentMap<>(
             new HadoopLazyConcurrentMap.ValueFactory<FsCacheKey, FileSystem>() {
-                @Override public FileSystem createValue(FsCacheKey key) {
+                @Override public FileSystem createValue(FsCacheKey key) throws IOException {
                     try {
                         assert key != null;
 
@@ -57,8 +57,10 @@ public class HadoopFileSystemCacheUtils {
 
                         return FileSystem.get(uri, cfg, key.user());
                     }
-                    catch (IOException | InterruptedException ioe) {
-                        throw new IgniteException(ioe);
+                    catch (InterruptedException e) {
+                        Thread.currentThread().interrupt();
+
+                        throw new IOException("Failed to create file system due to interrupt.", e);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopLazyConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopLazyConcurrentMap.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopLazyConcurrentMap.java
index 89eaf73..681cddb 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopLazyConcurrentMap.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/fs/HadoopLazyConcurrentMap.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.hadoop.fs;
 
 import java.io.Closeable;
+import java.io.IOException;
 import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.locks.ReadWriteLock;
@@ -204,8 +205,8 @@ public class HadoopLazyConcurrentMap<K, V extends Closeable> {
          *
          * @param key the key to create value for
          * @return the value.
-         * @throws IgniteException on failure.
+         * @throws IOException On failure.
          */
-        public V createValue(K key);
+        public V createValue(K key) throws IOException;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
index ea65464..10b1bcd 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.igfs;
 
 import java.io.IOException;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
 import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
 import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
 import org.apache.ignite.internal.processors.igfs.IgfsDualAbstractSelfTest;
@@ -74,12 +74,16 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
 
         prepareConfiguration();
 
-        IgniteHadoopIgfsSecondaryFileSystem second =
-            new IgniteHadoopIgfsSecondaryFileSystem(secondaryUri, secondaryConfFullPath);
+        CachingHadoopFileSystemFactory factory = new CachingHadoopFileSystemFactory();
 
-        FileSystem fileSystem = second.fileSystem();
+        factory.setUri(secondaryUri);
+        factory.setConfigPaths(secondaryConfFullPath);
 
-        igfsSecondary = new HadoopFileSystemUniversalFileSystemAdapter(fileSystem);
+        IgniteHadoopIgfsSecondaryFileSystem second = new IgniteHadoopIgfsSecondaryFileSystem();
+
+        second.setFileSystemFactory(factory);
+
+        igfsSecondary = new HadoopFileSystemUniversalFileSystemAdapter(factory);
 
         return second;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFIleSystemFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFIleSystemFactorySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFIleSystemFactorySelfTest.java
new file mode 100644
index 0000000..1d02f0f
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFIleSystemFactorySelfTest.java
@@ -0,0 +1,326 @@
+/*
+ * 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.igfs;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
+import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
+import org.apache.ignite.internal.processors.igfs.IgfsCommonAbstractTest;
+import org.apache.ignite.internal.processors.igfs.IgfsEx;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.jetbrains.annotations.Nullable;
+import java.io.Externalizable;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.net.URI;
+import java.util.concurrent.Callable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for Hadoop file system factory.
+ */
+public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
+    /** Amount of "start" invocations */
+    private static final AtomicInteger START_CNT = new AtomicInteger();
+
+    /** Amount of "stop" invocations */
+    private static final AtomicInteger STOP_CNT = new AtomicInteger();
+
+    /** Path to secondary file system configuration. */
+    private static final String SECONDARY_CFG_PATH = "/work/core-site-HadoopFIleSystemFactorySelfTest.xml";
+
+    /** IGFS path for DUAL mode. */
+    private static final Path PATH_DUAL = new Path("/ignite/sync/test_dir");
+
+    /** IGFS path for PROXY mode. */
+    private static final Path PATH_PROXY = new Path("/ignite/proxy/test_dir");
+
+    /** IGFS path for DUAL mode. */
+    private static final IgfsPath IGFS_PATH_DUAL = new IgfsPath("/ignite/sync/test_dir");
+
+    /** IGFS path for PROXY mode. */
+    private static final IgfsPath IGFS_PATH_PROXY = new IgfsPath("/ignite/proxy/test_dir");
+
+    /** Secondary IGFS. */
+    private IgfsEx secondary;
+
+    /** Primary IGFS. */
+    private IgfsEx primary;
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        START_CNT.set(0);
+        STOP_CNT.set(0);
+
+        secondary = startSecondary();
+        primary = startPrimary();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        secondary = null;
+        primary = null;
+
+        stopAllGrids();
+    }
+
+    /**
+     * Test custom factory.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+    public void testCustomFactory() throws Exception {
+        assert START_CNT.get() == 1;
+        assert STOP_CNT.get() == 0;
+
+        // Use IGFS directly.
+        primary.mkdirs(IGFS_PATH_DUAL);
+
+        assert primary.exists(IGFS_PATH_DUAL);
+        assert secondary.exists(IGFS_PATH_DUAL);
+
+        GridTestUtils.assertThrows(null, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                primary.mkdirs(IGFS_PATH_PROXY);
+
+                return null;
+            }
+        }, IgfsInvalidPathException.class, null);
+
+        // Create remote instance.
+        FileSystem fs = FileSystem.get(URI.create("igfs://primary:primary@127.0.0.1:10500/"), baseConfiguration());
+
+        // Ensure lifecycle callback was invoked.
+        assert START_CNT.get() == 2;
+        assert STOP_CNT.get() == 0;
+
+        // Check file system operations.
+        assert fs.exists(PATH_DUAL);
+
+        assert fs.delete(PATH_DUAL, true);
+        assert !primary.exists(IGFS_PATH_DUAL);
+        assert !secondary.exists(IGFS_PATH_DUAL);
+        assert !fs.exists(PATH_DUAL);
+
+        assert fs.mkdirs(PATH_DUAL);
+        assert primary.exists(IGFS_PATH_DUAL);
+        assert secondary.exists(IGFS_PATH_DUAL);
+        assert fs.exists(PATH_DUAL);
+
+        assert fs.mkdirs(PATH_PROXY);
+        assert secondary.exists(IGFS_PATH_PROXY);
+        assert fs.exists(PATH_PROXY);
+
+        // Close file system and ensure that associated factory was notified.
+        fs.close();
+
+        assert START_CNT.get() == 2;
+        assert STOP_CNT.get() == 1;
+
+        // Stop primary node and ensure that base factory was notified.
+        G.stop(primary.context().kernalContext().grid().name(), true);
+
+        assert START_CNT.get() == 2;
+        assert STOP_CNT.get() == 2;
+    }
+
+    /**
+     * Start secondary IGFS.
+     *
+     * @return IGFS.
+     * @throws Exception If failed.
+     */
+    private static IgfsEx startSecondary() throws Exception {
+        return start("secondary", 11500, IgfsMode.PRIMARY, null);
+    }
+
+    /**
+     * Start primary IGFS.
+     *
+     * @return IGFS.
+     * @throws Exception If failed.
+     */
+    private static IgfsEx startPrimary() throws Exception {
+        // Prepare configuration.
+        Configuration conf = baseConfiguration();
+
+        conf.set("fs.defaultFS", "igfs://secondary:secondary@127.0.0.1:11500/");
+
+        writeConfigurationToFile(conf);
+
+        // Configure factory.
+        TestFactory factory = new TestFactory();
+
+        factory.setUri("igfs://secondary:secondary@127.0.0.1:11500/");
+        factory.setConfigPaths(SECONDARY_CFG_PATH);
+
+        // Configure file system.
+        IgniteHadoopIgfsSecondaryFileSystem fs = new IgniteHadoopIgfsSecondaryFileSystem();
+
+        fs.setFileSystemFactory(factory);
+
+        // Start.
+        return start("primary", 10500, IgfsMode.PRIMARY, fs);
+    }
+
+    /**
+     * Start Ignite node with IGFS instance.
+     *
+     * @param name Node and IGFS name.
+     * @param endpointPort Endpoint port.
+     * @param dfltMode Default path mode.
+     * @param secondaryFs Secondary file system.
+     * @return Igfs instance.
+     */
+    private static IgfsEx start(String name, int endpointPort, IgfsMode dfltMode,
+        @Nullable IgfsSecondaryFileSystem secondaryFs) {
+        IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
+
+        endpointCfg.setType(IgfsIpcEndpointType.TCP);
+        endpointCfg.setHost("127.0.0.1");
+        endpointCfg.setPort(endpointPort);
+
+        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+        igfsCfg.setDataCacheName("dataCache");
+        igfsCfg.setMetaCacheName("metaCache");
+        igfsCfg.setName(name);
+        igfsCfg.setDefaultMode(dfltMode);
+        igfsCfg.setIpcEndpointConfiguration(endpointCfg);
+        igfsCfg.setSecondaryFileSystem(secondaryFs);
+
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
+
+        dataCacheCfg.setName("dataCache");
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setOffHeapMaxMemory(0);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("metaCache");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName(name);
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
+        cfg.setFileSystemConfiguration(igfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+        cfg.setConnectorConfiguration(null);
+
+        return (IgfsEx)G.start(cfg).fileSystem(name);
+    }
+
+    /**
+     * Create base FileSystem configuration.
+     *
+     * @return Configuration.
+     */
+    private static Configuration baseConfiguration() {
+        Configuration conf = new Configuration();
+
+        conf.set("fs.igfs.impl", IgniteHadoopFileSystem.class.getName());
+
+        return conf;
+    }
+
+    /**
+     * Write configuration to file.
+     *
+     * @param conf Configuration.
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("ResultOfMethodCallIgnored")
+    private static void writeConfigurationToFile(Configuration conf) throws Exception {
+        final String path = U.getIgniteHome() + SECONDARY_CFG_PATH;
+
+        File file = new File(path);
+
+        file.delete();
+
+        assertFalse(file.exists());
+
+        try (FileOutputStream fos = new FileOutputStream(file)) {
+            conf.writeXml(fos);
+        }
+
+        assertTrue(file.exists());
+    }
+
+    /**
+     * Test factory.
+     */
+    private static class TestFactory extends CachingHadoopFileSystemFactory {
+        /**
+         * {@link Externalizable} support.
+         */
+        public TestFactory() {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void start() throws IgniteException {
+            START_CNT.incrementAndGet();
+
+            super.start();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void stop() throws IgniteException {
+            STOP_CNT.incrementAndGet();
+
+            super.stop();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
index 608bd25..5b6fd81 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
@@ -26,6 +26,8 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsUtils;
 import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.processors.igfs.UniversalFileSystemAdapter;
@@ -34,55 +36,55 @@ import org.apache.ignite.internal.processors.igfs.UniversalFileSystemAdapter;
  * Universal adapter wrapping {@link org.apache.hadoop.fs.FileSystem} instance.
  */
 public class HadoopFileSystemUniversalFileSystemAdapter implements UniversalFileSystemAdapter {
-    /** The wrapped filesystem. */
-    private final FileSystem fileSys;
+    /** File system factory. */
+    private final HadoopFileSystemFactory factory;
 
     /**
      * Constructor.
-     * @param fs the filesystem to be wrapped.
+     * @param factory File system factory.
      */
-    public HadoopFileSystemUniversalFileSystemAdapter(FileSystem fs) {
-        this.fileSys = fs;
+    public HadoopFileSystemUniversalFileSystemAdapter(HadoopFileSystemFactory factory) {
+        assert factory != null;
+
+        this.factory = factory;
     }
 
     /** {@inheritDoc} */
-    @Override public String name() {
-        return fileSys.getUri().toString();
+    @Override public String name() throws IOException {
+        return get().getUri().toString();
     }
 
     /** {@inheritDoc} */
     @Override public boolean exists(String path) throws IOException {
-        return fileSys.exists(new Path(path));
+        return get().exists(new Path(path));
     }
 
     /** {@inheritDoc} */
     @Override public boolean delete(String path, boolean recursive) throws IOException {
-        boolean ok = fileSys.delete(new Path(path), recursive);
-        return ok;
+        return get().delete(new Path(path), recursive);
     }
 
     /** {@inheritDoc} */
     @Override public void mkdirs(String path) throws IOException {
-        boolean ok = fileSys.mkdirs(new Path(path));
+        boolean ok = get().mkdirs(new Path(path));
         if (!ok)
             throw new IOException("Failed to mkdirs: " + path);
     }
 
     /** {@inheritDoc} */
     @Override public void format() throws IOException {
-        HadoopIgfsUtils.clear(fileSys);
+        HadoopIgfsUtils.clear(get());
     }
 
     /** {@inheritDoc} */
     @Override public Map<String, String> properties(String path) throws IOException {
         Path p = new Path(path);
 
-        FileStatus status = fileSys.getFileStatus(p);
+        FileStatus status = get().getFileStatus(p);
 
         Map<String,String> m = new HashMap<>(3); // max size == 4
 
         m.put(IgfsEx.PROP_USER_NAME, status.getOwner());
-
         m.put(IgfsEx.PROP_GROUP_NAME, status.getGroup());
 
         FsPermission perm = status.getPermission();
@@ -95,7 +97,7 @@ public class HadoopFileSystemUniversalFileSystemAdapter implements UniversalFile
 
     /** {@inheritDoc} */
     @Override public InputStream openInputStream(String path) throws IOException {
-        return fileSys.open(new Path(path));
+        return get().open(new Path(path));
     }
 
     /** {@inheritDoc} */
@@ -103,16 +105,27 @@ public class HadoopFileSystemUniversalFileSystemAdapter implements UniversalFile
         Path p = new Path(path);
 
         if (append)
-            return fileSys.append(p);
+            return get().append(p);
         else
-            return fileSys.create(p, true/*overwrite*/);
+            return get().create(p, true/*overwrite*/);
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T getAdapter(Class<T> clazz) {
-        if (clazz == FileSystem.class)
-            return (T)fileSys;
+    @SuppressWarnings("unchecked")
+    @Override public <T> T unwrap(Class<T> cls) {
+        if (HadoopFileSystemFactory.class.isAssignableFrom(cls))
+            return (T)factory;
 
         return null;
     }
+
+    /**
+     * Create file system.
+     *
+     * @return File system.
+     * @throws IOException If failed.
+     */
+    private FileSystem get() throws IOException {
+        return factory.get(FileSystemConfiguration.DFLT_USER_NAME);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
index 4ddfb0d..d9b5d66 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
@@ -17,12 +17,6 @@
 
 package org.apache.ignite.igfs;
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.util.concurrent.Callable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
@@ -34,9 +28,9 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
 import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
 import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
-import org.apache.ignite.internal.processors.hadoop.SecondaryFileSystemProvider;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsUtils;
 import org.apache.ignite.internal.processors.igfs.IgfsCommonAbstractTest;
 import org.apache.ignite.internal.util.typedef.G;
@@ -48,6 +42,13 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.concurrent.Callable;
+
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -173,12 +174,16 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
         else
             primaryConfFullPath = null;
 
-        SecondaryFileSystemProvider provider =
-            new SecondaryFileSystemProvider(primaryFsUriStr, primaryConfFullPath);
+        CachingHadoopFileSystemFactory fac = new CachingHadoopFileSystemFactory();
+
+        fac.setConfigPaths(primaryConfFullPath);
+        fac.setUri(primaryFsUriStr);
+
+        fac.start();
 
-        primaryFs = provider.createFileSystem(null);
+        primaryFs = fac.get(null); //provider.createFileSystem(null);
 
-        primaryFsUri = provider.uri();
+        primaryFsUri = primaryFs.getUri();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
index d368955..6617127 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
@@ -17,29 +17,6 @@
 
 package org.apache.ignite.igfs;
 
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.net.URI;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayDeque;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Deque;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.BlockLocation;
 import org.apache.hadoop.fs.ContentSummary;
@@ -59,6 +36,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
 import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
 import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsEx;
@@ -70,6 +48,7 @@ import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
@@ -79,6 +58,30 @@ import org.apache.ignite.testframework.GridTestUtils;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ThreadLocalRandom8;
 
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayDeque;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -380,9 +383,20 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
         cfg.setPrefetchBlocks(1);
         cfg.setDefaultMode(mode);
 
-        if (mode != PRIMARY)
-            cfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(
-                SECONDARY_URI, SECONDARY_CFG_PATH, SECONDARY_FS_USER));
+        if (mode != PRIMARY) {
+            CachingHadoopFileSystemFactory fac = new CachingHadoopFileSystemFactory();
+
+            fac.setUri(SECONDARY_URI);
+            fac.setConfigPaths(SECONDARY_CFG_PATH);
+
+            IgniteHadoopIgfsSecondaryFileSystem sec = new IgniteHadoopIgfsSecondaryFileSystem();
+
+            sec.setFileSystemFactory(fac);
+            sec.setDefaultUserName(SECONDARY_FS_USER);
+
+            // NB: start() will be invoked upon IgfsImpl init.
+            cfg.setSecondaryFileSystem(sec);
+        }
 
         cfg.setIpcEndpointConfiguration(primaryIpcEndpointConfiguration(gridName));
 
@@ -398,7 +412,8 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
             @Override public Object call() throws Exception {
                 return new IgniteHadoopFileSystem().getUri();
             }
-        }, IllegalStateException.class, "URI is null (was IgniteHadoopFileSystem properly initialized?).");
+        }, IllegalStateException.class,
+            "URI is null (was IgniteHadoopFileSystem properly initialized?)");
     }
 
     /** @throws Exception If failed. */
@@ -506,7 +521,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
                 // Ensure that IO is stopped when nobody else is need it.
                 fs.close();
 
-                assertEquals(initSize - 1, cache.size());
+                assert initSize >= cache.size();
 
                 assert (Boolean)stopField.get(io);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 6c542b5..9092f32 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -37,6 +37,7 @@ import org.apache.ignite.client.hadoop.HadoopClientProtocolEmbeddedSelfTest;
 import org.apache.ignite.client.hadoop.HadoopClientProtocolSelfTest;
 import org.apache.ignite.igfs.Hadoop1OverIgfsDualAsyncTest;
 import org.apache.ignite.igfs.Hadoop1OverIgfsDualSyncTest;
+import org.apache.ignite.igfs.HadoopFIleSystemFactorySelfTest;
 import org.apache.ignite.igfs.HadoopIgfs20FileSystemLoopbackPrimarySelfTest;
 import org.apache.ignite.igfs.HadoopIgfsDualAsyncSelfTest;
 import org.apache.ignite.igfs.HadoopIgfsDualSyncSelfTest;
@@ -113,6 +114,8 @@ public class IgniteHadoopTestSuite extends TestSuite {
         suite.addTest(new TestSuite(ldr.loadClass(Hadoop1OverIgfsDualSyncTest.class.getName())));
         suite.addTest(new TestSuite(ldr.loadClass(Hadoop1OverIgfsDualAsyncTest.class.getName())));
 
+        suite.addTest(new TestSuite(ldr.loadClass(HadoopFIleSystemFactorySelfTest.class.getName())));
+
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemLoopbackExternalPrimarySelfTest.class.getName())));
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemLoopbackExternalSecondarySelfTest.class.getName())));
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemLoopbackExternalDualSyncSelfTest.class.getName())));


[45/50] [abbrv] ignite git commit: IGNITE-2308: Fixed HadoopClassLoader dependency resolution. This closes #391.

Posted by vo...@apache.org.
IGNITE-2308: Fixed HadoopClassLoader dependency resolution. This closes #391.


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

Branch: refs/heads/ignite-2234
Commit: 012ca7308bf125d2c90d68ef7a8bc75aeb84bf53
Parents: ddbe2d5
Author: iveselovskiy <iv...@gridgain.com>
Authored: Mon Jan 4 10:47:28 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 4 10:47:28 2016 +0400

----------------------------------------------------------------------
 .../processors/hadoop/HadoopClassLoader.java    | 636 ++++++++++++++-----
 .../hadoop/HadoopClassLoaderTest.java           | 101 ++-
 .../hadoop/deps/CircularWIthHadoop.java         |  32 +
 .../hadoop/deps/CircularWithoutHadoop.java      |  27 +
 .../processors/hadoop/deps/WithCast.java        |  41 ++
 .../hadoop/deps/WithClassAnnotation.java        |  28 +
 .../hadoop/deps/WithConstructorInvocation.java  |  31 +
 .../processors/hadoop/deps/WithExtends.java     |  27 +
 .../processors/hadoop/deps/WithField.java       |  29 +
 .../processors/hadoop/deps/WithImplements.java  |  36 ++
 .../hadoop/deps/WithIndirectField.java          |  27 +
 .../processors/hadoop/deps/WithInitializer.java |  33 +
 .../processors/hadoop/deps/WithInnerClass.java  |  31 +
 .../hadoop/deps/WithLocalVariable.java          |  38 ++
 .../hadoop/deps/WithMethodAnnotation.java       |  32 +
 .../hadoop/deps/WithMethodArgument.java         |  31 +
 .../hadoop/deps/WithMethodCheckedException.java |  31 +
 .../hadoop/deps/WithMethodInvocation.java       |  31 +
 .../hadoop/deps/WithMethodReturnType.java       |  31 +
 .../hadoop/deps/WithMethodRuntimeException.java |  31 +
 .../processors/hadoop/deps/WithOuterClass.java  |  38 ++
 .../hadoop/deps/WithParameterAnnotation.java    |  31 +
 .../processors/hadoop/deps/WithStaticField.java |  29 +
 .../hadoop/deps/WithStaticInitializer.java      |  34 +
 .../processors/hadoop/deps/Without.java         |  25 +
 .../testsuites/IgniteHadoopTestSuite.java       |   3 +
 26 files changed, 1279 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
index f12af46..735133f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
@@ -30,7 +30,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.hadoop.v2.HadoopDaemon;
 import org.apache.ignite.internal.processors.hadoop.v2.HadoopNativeCodeLoader;
@@ -40,13 +40,16 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Handle;
 import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
 import org.objectweb.asm.commons.Remapper;
 import org.objectweb.asm.commons.RemappingClassAdapter;
 
@@ -125,10 +128,14 @@ public class HadoopClassLoader extends URLClassLoader {
      * @return {@code true} if we need to check this class.
      */
     private static boolean isHadoopIgfs(String cls) {
-        String ignitePackagePrefix = "org.apache.ignite";
-        int len = ignitePackagePrefix.length();
+        String ignitePkgPrefix = "org.apache.ignite";
+
+        int len = ignitePkgPrefix.length();
 
-        return cls.startsWith(ignitePackagePrefix) && (cls.indexOf("igfs.", len) != -1 || cls.indexOf(".fs.", len) != -1 || cls.indexOf("hadoop.", len) != -1);
+        return cls.startsWith(ignitePkgPrefix) && (
+            cls.indexOf("igfs.", len) != -1 ||
+            cls.indexOf(".fs.", len) != -1 ||
+            cls.indexOf("hadoop.", len) != -1);
     }
 
     /**
@@ -159,7 +166,7 @@ public class HadoopClassLoader extends URLClassLoader {
                 Boolean hasDeps = cache.get(name);
 
                 if (hasDeps == null) {
-                    hasDeps = hasExternalDependencies(name, new HashSet<String>());
+                    hasDeps = hasExternalDependencies(name);
 
                     cache.put(name, hasDeps);
                 }
@@ -266,10 +273,30 @@ public class HadoopClassLoader extends URLClassLoader {
     }
 
     /**
+     * Check whether class has external dependencies on Hadoop.
+     * 
      * @param clsName Class name.
+     * @return {@code True} if class has external dependencies.
+     */
+    boolean hasExternalDependencies(String clsName) {
+        CollectingContext ctx = new CollectingContext();
+
+        ctx.annVisitor = new CollectingAnnotationVisitor(ctx);
+        ctx.mthdVisitor = new CollectingMethodVisitor(ctx, ctx.annVisitor);
+        ctx.fldVisitor = new CollectingFieldVisitor(ctx, ctx.annVisitor);
+        ctx.clsVisitor = new CollectingClassVisitor(ctx, ctx.annVisitor, ctx.mthdVisitor, ctx.fldVisitor);
+        
+        return hasExternalDependencies(clsName, ctx);
+    }
+        
+    /**
+     * Check whether class has external dependencies on Hadoop.
+     * 
+     * @param clsName Class name.
+     * @param ctx Context.                
      * @return {@code true} If the class has external dependencies.
      */
-    boolean hasExternalDependencies(final String clsName, final Set<String> visited) {
+    boolean hasExternalDependencies(String clsName, CollectingContext ctx) {
         if (isHadoop(clsName)) // Hadoop must not be in classpath but Idea sucks, so filtering explicitly as external.
             return true;
 
@@ -291,157 +318,14 @@ public class HadoopClassLoader extends URLClassLoader {
             throw new RuntimeException("Failed to read class: " + clsName, e);
         }
 
-        visited.add(clsName);
-
-        final AtomicBoolean hasDeps = new AtomicBoolean();
-
-        rdr.accept(new ClassVisitor(Opcodes.ASM4) {
-            AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM4) {
-                // TODO
-            };
-
-            FieldVisitor fv = new FieldVisitor(Opcodes.ASM4) {
-                @Override public AnnotationVisitor visitAnnotation(String desc, boolean b) {
-                    onType(desc);
-
-                    return av;
-                }
-            };
-
-            MethodVisitor mv = new MethodVisitor(Opcodes.ASM4) {
-                @Override public AnnotationVisitor visitAnnotation(String desc, boolean b) {
-                    onType(desc);
-
-                    return av;
-                }
-
-                @Override public AnnotationVisitor visitParameterAnnotation(int i, String desc, boolean b) {
-                    onType(desc);
-
-                    return av;
-                }
-
-                @Override public AnnotationVisitor visitAnnotationDefault() {
-                    return av;
-                }
-
-                @Override public void visitFieldInsn(int i, String owner, String name, String desc) {
-                    onType(owner);
-                    onType(desc);
-                }
-
-                @Override public void visitFrame(int i, int i2, Object[] locTypes, int i3, Object[] stackTypes) {
-                    for (Object o : locTypes) {
-                        if (o instanceof String)
-                            onType((String)o);
-                    }
-
-                    for (Object o : stackTypes) {
-                        if (o instanceof String)
-                            onType((String)o);
-                    }
-                }
-
-                @Override public void visitLocalVariable(String name, String desc, String signature, Label lb,
-                    Label lb2, int i) {
-                    onType(desc);
-                }
-
-                @Override public void visitMethodInsn(int i, String owner, String name, String desc) {
-                    onType(owner);
-                }
-
-                @Override public void visitMultiANewArrayInsn(String desc, int dim) {
-                    onType(desc);
-                }
-
-                @Override public void visitTryCatchBlock(Label lb, Label lb2, Label lb3, String e) {
-                    onType(e);
-                }
-            };
-
-            void onClass(String depCls) {
-                assert validateClassName(depCls) : depCls;
-
-                if (depCls.startsWith("java.")) // Filter out platform classes.
-                    return;
-
-                if (visited.contains(depCls))
-                    return;
-
-                Boolean res = cache.get(depCls);
-
-                if (res == Boolean.TRUE || (res == null && hasExternalDependencies(depCls, visited)))
-                    hasDeps.set(true);
-            }
-
-            void onType(String type) {
-                if (type == null)
-                    return;
-
-                int off = 0;
-
-                while (type.charAt(off) == '[')
-                    off++; // Handle arrays.
-
-                if (off != 0)
-                    type = type.substring(off);
-
-                if (type.length() == 1)
-                    return; // Get rid of primitives.
-
-                if (type.charAt(type.length() - 1) == ';') {
-                    assert type.charAt(0) == 'L' : type;
-
-                    type = type.substring(1, type.length() - 1);
-                }
-
-                type = type.replace('/', '.');
-
-                onClass(type);
-            }
-
-            @Override public void visit(int i, int i2, String name, String signature, String superName,
-                String[] ifaces) {
-                onType(superName);
-
-                if (ifaces != null) {
-                    for (String iface : ifaces)
-                        onType(iface);
-                }
-            }
-
-            @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
-                onType(desc);
-
-                return av;
-            }
-
-            @Override public void visitInnerClass(String name, String outerName, String innerName, int i) {
-                onType(name);
-            }
-
-            @Override public FieldVisitor visitField(int i, String name, String desc, String signature, Object val) {
-                onType(desc);
+        ctx.visited.add(clsName);
 
-                return fv;
-            }
+        rdr.accept(ctx.clsVisitor, 0);
 
-            @Override public MethodVisitor visitMethod(int i, String name, String desc, String signature,
-                String[] exceptions) {
-                if (exceptions != null) {
-                    for (String e : exceptions)
-                        onType(e);
-                }
-
-                return mv;
-            }
-        }, 0);
-
-        if (hasDeps.get()) // We already know that we have dependencies, no need to check parent.
+        if (ctx.found) // We already know that we have dependencies, no need to check parent.
             return true;
 
-        // Here we are known to not have any dependencies but possibly we have a parent which have them.
+        // Here we are known to not have any dependencies but possibly we have a parent which has them.
         int idx = clsName.lastIndexOf('$');
 
         if (idx == -1) // No parent class.
@@ -449,13 +333,13 @@ public class HadoopClassLoader extends URLClassLoader {
 
         String parentCls = clsName.substring(0, idx);
 
-        if (visited.contains(parentCls))
+        if (ctx.visited.contains(parentCls))
             return false;
 
         Boolean res = cache.get(parentCls);
 
         if (res == null)
-            res = hasExternalDependencies(parentCls, visited);
+            res = hasExternalDependencies(parentCls, ctx);
 
         return res;
     }
@@ -616,4 +500,446 @@ public class HadoopClassLoader extends URLClassLoader {
     public String name() {
         return name;
     }
+
+    /**
+     * Context for dependencies collection.
+     */
+    private class CollectingContext {
+        /** Visited classes. */
+        private final Set<String> visited = new HashSet<>();
+
+        /** Whether dependency found. */
+        private boolean found;
+
+        /** Annotation visitor. */
+        private AnnotationVisitor annVisitor;
+
+        /** Method visitor. */
+        private MethodVisitor mthdVisitor;
+
+        /** Field visitor. */
+        private FieldVisitor fldVisitor;
+        
+        /** Class visitor. */
+        private ClassVisitor clsVisitor;
+
+        /**
+         * Processes a method descriptor
+         * @param methDesc The method desc String.
+         */
+        void onMethodsDesc(final String methDesc) {
+            // Process method return type:
+            onType(Type.getReturnType(methDesc));
+
+            if (found)
+                return;
+
+            // Process method argument types:
+            for (Type t: Type.getArgumentTypes(methDesc)) {
+                onType(t);
+
+                if (found)
+                    return;
+            }
+        }
+
+        /**
+         * Processes dependencies of a class.
+         *
+         * @param depCls The class name as dot-notated FQN.
+         */
+        void onClass(final String depCls) {
+            assert depCls.indexOf('/') == -1 : depCls; // class name should be fully converted to dot notation.
+            assert depCls.charAt(0) != 'L' : depCls;
+            assert validateClassName(depCls) : depCls;
+
+            if (depCls.startsWith("java.") || depCls.startsWith("javax.")) // Filter out platform classes.
+                return;
+
+            if (visited.contains(depCls))
+                return;
+
+            Boolean res = cache.get(depCls);
+
+            if (res == Boolean.TRUE || (res == null && hasExternalDependencies(depCls, this)))
+                found = true;
+        }
+
+        /**
+         * Analyses dependencies of given type.
+         *
+         * @param t The type to process.
+         */
+        void onType(Type t) {
+            if (t == null)
+                return;
+
+            int sort = t.getSort();
+
+            switch (sort) {
+                case Type.ARRAY:
+                    onType(t.getElementType());
+
+                    break;
+
+                case Type.OBJECT:
+                    onClass(t.getClassName());
+
+                    break;
+            }
+        }
+
+        /**
+         * Analyses dependencies of given object type.
+         *
+         * @param objType The object type to process.
+         */
+        void onInternalTypeName(String objType) {
+            if (objType == null)
+                return;
+
+            assert objType.length() > 1 : objType;
+
+            if (objType.charAt(0) == '[')
+                // handle array. In this case this is a type descriptor notation, like "[Ljava/lang/Object;"
+                onType(objType);
+            else {
+                assert objType.indexOf('.') == -1 : objType; // Must be slash-separated FQN.
+
+                String clsName = objType.replace('/', '.'); // Convert it to dot notation.
+
+                onClass(clsName); // Process.
+            }
+        }
+
+        /**
+         * Type description analyser.
+         *
+         * @param desc The description.
+         */
+        void onType(String desc) {
+            if (!F.isEmpty(desc)) {
+                if (desc.length() <= 1)
+                    return; // Optimization: filter out primitive types in early stage.
+
+                Type t = Type.getType(desc);
+
+                onType(t);
+            }
+        }
+    }    
+
+    /**
+     * Annotation visitor.
+     */
+    private static class CollectingAnnotationVisitor extends AnnotationVisitor {
+        /** */
+        final CollectingContext ctx;
+
+        /**
+         * Annotation visitor.
+         * 
+         * @param ctx The collector.
+         */
+        CollectingAnnotationVisitor(CollectingContext ctx) {
+            super(Opcodes.ASM4);
+
+            this.ctx = ctx;
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitAnnotation(String name, String desc) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return this;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitEnum(String name, String desc, String val) {
+            if (ctx.found)
+                return;
+
+            ctx.onType(desc);
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitArray(String name) {
+            return ctx.found ? null : this;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visit(String name, Object val) {
+            if (ctx.found)
+                return;
+
+            if (val instanceof Type)
+                ctx.onType((Type)val);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitEnd() {
+            // No-op.
+        }
+    }
+
+    /**
+     * Field visitor.
+     */
+    private static class CollectingFieldVisitor extends FieldVisitor {
+        /** Collector. */
+        private final CollectingContext ctx;
+
+        /** Annotation visitor. */
+        private final AnnotationVisitor av;
+
+        /**
+         * Constructor.
+         */
+        CollectingFieldVisitor(CollectingContext ctx, AnnotationVisitor av) {
+            super(Opcodes.ASM4);
+
+            this.ctx = ctx;
+            this.av = av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return ctx.found ? null : av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitAttribute(Attribute attr) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitEnd() {
+            // No-op.
+        }
+    }
+
+    /**
+     * Class visitor.
+     */
+    private static class CollectingClassVisitor extends ClassVisitor {
+        /** Collector. */
+        private final CollectingContext ctx;
+
+        /** Annotation visitor. */
+        private final AnnotationVisitor av;
+
+        /** Method visitor. */
+        private final MethodVisitor mv;
+
+        /** Field visitor. */
+        private final FieldVisitor fv;
+
+        /**
+         * Constructor.
+         *
+         * @param ctx Collector.
+         * @param av Annotation visitor.
+         * @param mv Method visitor.
+         * @param fv Field visitor.
+         */
+        CollectingClassVisitor(CollectingContext ctx, AnnotationVisitor av, MethodVisitor mv, FieldVisitor fv) {
+            super(Opcodes.ASM4);
+
+            this.ctx = ctx;
+            this.av = av;
+            this.mv = mv;
+            this.fv = fv;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visit(int i, int i2, String name, String signature, String superName, String[] ifaces) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(superName);
+
+            if (ctx.found)
+                return;
+
+            if (ifaces != null) {
+                for (String iface : ifaces) {
+                    ctx.onInternalTypeName(iface);
+
+                    if (ctx.found)
+                        return;
+                }
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return ctx.found ? null : av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitInnerClass(String name, String outerName, String innerName, int i) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(name);
+        }
+
+        /** {@inheritDoc} */
+        @Override public FieldVisitor visitField(int i, String name, String desc, String signature, Object val) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return ctx.found ? null : fv;
+        }
+
+        /** {@inheritDoc} */
+        @Override public MethodVisitor visitMethod(int i, String name, String desc, String signature,
+            String[] exceptions) {
+            if (ctx.found)
+                return null;
+
+            ctx.onMethodsDesc(desc);
+
+            // Process declared method exceptions:
+            if (exceptions != null) {
+                for (String e : exceptions)
+                    ctx.onInternalTypeName(e);
+            }
+
+            return ctx.found ? null : mv;
+        }
+    }
+
+    /**
+     * Method visitor.
+     */
+    private static class CollectingMethodVisitor extends MethodVisitor {
+        /** Collector. */
+        private final CollectingContext ctx;
+
+        /** Annotation visitor. */
+        private final AnnotationVisitor av;
+
+        /**
+         * Constructor.
+         *
+         * @param ctx Collector.
+         * @param av Annotation visitor.
+         */
+        private CollectingMethodVisitor(CollectingContext ctx, AnnotationVisitor av) {
+            super(Opcodes.ASM4);
+
+            this.ctx = ctx;
+            this.av = av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return ctx.found ? null : av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitParameterAnnotation(int i, String desc, boolean b) {
+            if (ctx.found)
+                return null;
+
+            ctx.onType(desc);
+
+            return ctx.found ? null : av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public AnnotationVisitor visitAnnotationDefault() {
+            return ctx.found ? null : av;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(owner);
+
+            if (ctx.found)
+                return;
+
+            ctx.onType(desc);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitFrame(int type, int nLoc, Object[] locTypes, int nStack, Object[] stackTypes) {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitLocalVariable(String name, String desc, String signature, Label lb,
+            Label lb2, int i) {
+            if (ctx.found)
+                return;
+
+            ctx.onType(desc);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitMethodInsn(int i, String owner, String name, String desc) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(owner);
+
+            if (ctx.found)
+                return;
+
+            ctx.onMethodsDesc(desc);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitMultiANewArrayInsn(String desc, int dim) {
+            if (ctx.found)
+                return;
+
+            ctx.onType(desc);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitTryCatchBlock(Label start, Label end, Label hndl, String typeStr) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(typeStr);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void visitTypeInsn(int opcode, String type) {
+            if (ctx.found)
+                return;
+
+            ctx.onInternalTypeName(type);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoaderTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoaderTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoaderTest.java
index 085dd45..55fac2c 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoaderTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoaderTest.java
@@ -17,53 +17,94 @@
 
 package org.apache.ignite.internal.processors.hadoop;
 
+import javax.security.auth.AuthPermission;
 import junit.framework.TestCase;
-import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.ignite.internal.processors.hadoop.deps.CircularWIthHadoop;
+import org.apache.ignite.internal.processors.hadoop.deps.CircularWithoutHadoop;
+import org.apache.ignite.internal.processors.hadoop.deps.WithIndirectField;
+import org.apache.ignite.internal.processors.hadoop.deps.WithCast;
+import org.apache.ignite.internal.processors.hadoop.deps.WithClassAnnotation;
+import org.apache.ignite.internal.processors.hadoop.deps.WithConstructorInvocation;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodCheckedException;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodRuntimeException;
+import org.apache.ignite.internal.processors.hadoop.deps.WithExtends;
+import org.apache.ignite.internal.processors.hadoop.deps.WithField;
+import org.apache.ignite.internal.processors.hadoop.deps.WithImplements;
+import org.apache.ignite.internal.processors.hadoop.deps.WithInitializer;
+import org.apache.ignite.internal.processors.hadoop.deps.WithInnerClass;
+import org.apache.ignite.internal.processors.hadoop.deps.WithLocalVariable;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodAnnotation;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodInvocation;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodArgument;
+import org.apache.ignite.internal.processors.hadoop.deps.WithMethodReturnType;
+import org.apache.ignite.internal.processors.hadoop.deps.WithOuterClass;
+import org.apache.ignite.internal.processors.hadoop.deps.WithParameterAnnotation;
+import org.apache.ignite.internal.processors.hadoop.deps.WithStaticField;
+import org.apache.ignite.internal.processors.hadoop.deps.WithStaticInitializer;
+import org.apache.ignite.internal.processors.hadoop.deps.Without;
 
 /**
- *
+ * Tests for Hadoop classloader.
  */
 public class HadoopClassLoaderTest extends TestCase {
     /** */
-    HadoopClassLoader ldr = new HadoopClassLoader(null, "test");
+    final HadoopClassLoader ldr = new HadoopClassLoader(null, "test");
 
     /**
      * @throws Exception If failed.
      */
     public void testClassLoading() throws Exception {
-        assertNotSame(Test1.class, ldr.loadClass(Test1.class.getName()));
-        assertNotSame(Test2.class, ldr.loadClass(Test2.class.getName()));
-        assertSame(Test3.class, ldr.loadClass(Test3.class.getName()));
-    }
+        assertNotSame(CircularWIthHadoop.class, ldr.loadClass(CircularWIthHadoop.class.getName()));
+        assertNotSame(CircularWithoutHadoop.class, ldr.loadClass(CircularWithoutHadoop.class.getName()));
 
-//    public void testDependencySearch() {
-//        assertTrue(ldr.hasExternalDependencies(Test1.class.getName(), new HashSet<String>()));
-//        assertTrue(ldr.hasExternalDependencies(Test2.class.getName(), new HashSet<String>()));
-//    }
+        assertSame(Without.class, ldr.loadClass(Without.class.getName()));
+    }
 
     /**
-     *
+     * Test dependency search.
      */
-    private static class Test1 {
-        /** */
-        Test2 t2;
+    public void testDependencySearch() {
+        // Positive cases:
+        final Class[] positiveClasses = {
+            Configuration.class,
+            HadoopUtils.class,
+            WithStaticField.class,
+            WithCast.class,
+            WithClassAnnotation.class,
+            WithConstructorInvocation.class,
+            WithMethodCheckedException.class,
+            WithMethodRuntimeException.class,
+            WithExtends.class,
+            WithField.class,
+            WithImplements.class,
+            WithInitializer.class,
+            WithInnerClass.class,
+            WithOuterClass.InnerNoHadoop.class,
+            WithLocalVariable.class,
+            WithMethodAnnotation.class,
+            WithMethodInvocation.class,
+            WithMethodArgument.class,
+            WithMethodReturnType.class,
+            WithParameterAnnotation.class,
+            WithStaticField.class,
+            WithStaticInitializer.class,
+            WithIndirectField.class,
+            CircularWIthHadoop.class,
+            CircularWithoutHadoop.class,
+        };
 
-        /** */
-        Job[][] jobs = new Job[4][4];
-    }
+        for (Class c: positiveClasses)
+            assertTrue(c.getName(), ldr.hasExternalDependencies(c.getName()));
 
-    /**
-     *
-     */
-    private static abstract class Test2 {
-        /** */
-        abstract Test1 t1();
-    }
+        // Negative cases:
+        final Class[] negativeClasses = {
+            Object.class,
+            AuthPermission.class,
+            Without.class,
+        };
 
-    /**
-     *
-     */
-    private static class Test3 {
-        // No-op.
+        for (Class c: negativeClasses)
+            assertFalse(c.getName(), ldr.hasExternalDependencies(c.getName()));
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWIthHadoop.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWIthHadoop.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWIthHadoop.java
new file mode 100644
index 0000000..c3aa7d9
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWIthHadoop.java
@@ -0,0 +1,32 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.mapreduce.Job;
+
+/**
+ * Class has a direct Hadoop dependency and a circular dependency on another class.
+ */
+@SuppressWarnings("unused")
+public class CircularWIthHadoop {
+    /** */
+    private Job[][] jobs = new Job[4][4];
+
+    /** */
+    private CircularWithoutHadoop y;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWithoutHadoop.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWithoutHadoop.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWithoutHadoop.java
new file mode 100644
index 0000000..93d659c
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/CircularWithoutHadoop.java
@@ -0,0 +1,27 @@
+/*
+ * 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.processors.hadoop.deps;
+
+/**
+ * Does not have direct Hadoop dependency, but has a circular
+ */
+@SuppressWarnings("unused")
+public class CircularWithoutHadoop {
+    /** */
+    private CircularWIthHadoop x;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithCast.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithCast.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithCast.java
new file mode 100644
index 0000000..5b1e8e0
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithCast.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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.FileSystem;
+
+/**
+ * Class contains casting to a Hadoop type.
+ */
+@SuppressWarnings("unused")
+public abstract class WithCast<T> {
+    /** */
+    public abstract T create();
+
+    /** */
+    public void consume(T t) {
+        // noop
+    }
+
+    /** */
+    void test(WithCast<FileSystem> c) {
+        FileSystem fs = c.create();
+
+        c.consume(fs);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithClassAnnotation.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithClassAnnotation.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithClassAnnotation.java
new file mode 100644
index 0000000..a9ecae0
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithClassAnnotation.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+
+/**
+ * Class has Hadoop annotation.
+ */
+@SuppressWarnings("unused")
+@InterfaceAudience.Public
+public class WithClassAnnotation {
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithConstructorInvocation.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithConstructorInvocation.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithConstructorInvocation.java
new file mode 100644
index 0000000..98c8991
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithConstructorInvocation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Invokes a Hadoop type constructor.
+ */
+@SuppressWarnings("unused")
+public class WithConstructorInvocation {
+    /** */
+    private void foo() {
+        Object x = new Configuration();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithExtends.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithExtends.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithExtends.java
new file mode 100644
index 0000000..80c99e1
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithExtends.java
@@ -0,0 +1,27 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.LocalFileSystem;
+
+/**
+ * Class extends a Hadoop class.
+ */
+public class WithExtends extends LocalFileSystem {
+    // noop
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithField.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithField.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithField.java
new file mode 100644
index 0000000..dd979db
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithField.java
@@ -0,0 +1,29 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Has a Hadoop field.
+ */
+@SuppressWarnings("unused")
+public class WithField {
+    /** */
+    private Configuration conf;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithImplements.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithImplements.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithImplements.java
new file mode 100644
index 0000000..c2d8e5b
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithImplements.java
@@ -0,0 +1,36 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Implements a Hadoop interface.
+ */
+public class WithImplements implements Configurable {
+    /** {@inheritDoc} */
+    @Override public void setConf(Configuration conf) {
+        // noop
+    }
+
+    /** {@inheritDoc} */
+    @Override public Configuration getConf() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithIndirectField.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithIndirectField.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithIndirectField.java
new file mode 100644
index 0000000..ce078f1
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithIndirectField.java
@@ -0,0 +1,27 @@
+/*
+ * 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.processors.hadoop.deps;
+
+/**
+ * Has a unidirected dependency on Hadoop-dependent class.
+ */
+@SuppressWarnings("unused")
+public class WithIndirectField {
+    /** */
+    WithField x;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInitializer.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInitializer.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInitializer.java
new file mode 100644
index 0000000..360986c
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInitializer.java
@@ -0,0 +1,33 @@
+/*
+ * 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.processors.hadoop.deps;
+
+/**
+ * Has a field initialized with an expression invoking Hadoop method.
+ */
+
+@SuppressWarnings({"ConstantConditions", "unused"})
+public class WithInitializer {
+    /** */
+    private final Object x = org.apache.hadoop.fs.FileSystem.getDefaultUri(null);
+
+    /** */
+    WithInitializer() throws Exception {
+        // noop
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInnerClass.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInnerClass.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInnerClass.java
new file mode 100644
index 0000000..4a5a49c
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithInnerClass.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configurable;
+
+/**
+ * Has a *static* inner class depending on Hadoop.
+ */
+@SuppressWarnings("unused")
+public class WithInnerClass {
+    /** */
+    private static abstract class Foo implements Configurable {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithLocalVariable.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithLocalVariable.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithLocalVariable.java
new file mode 100644
index 0000000..ea4a5de
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithLocalVariable.java
@@ -0,0 +1,38 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Has a local variable of Hadoop type.
+ */
+@SuppressWarnings({"unused", "ConstantConditions"})
+public class WithLocalVariable {
+    /** */
+    void foo() {
+        Configuration c = null;
+
+        moo(c);
+    }
+
+    /** */
+    void moo(Object x) {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodAnnotation.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodAnnotation.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodAnnotation.java
new file mode 100644
index 0000000..ff9fbe0
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodAnnotation.java
@@ -0,0 +1,32 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.classification.InterfaceStability;
+
+/**
+ * Method has a Hadoop annotation.
+ */
+@SuppressWarnings("unused")
+public class WithMethodAnnotation {
+    /** */
+    @InterfaceStability.Unstable
+    void foo() {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodArgument.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodArgument.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodArgument.java
new file mode 100644
index 0000000..7f639e4
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodArgument.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Contains a formal parameter of Hadoop type.
+ */
+@SuppressWarnings("unused")
+public class WithMethodArgument {
+    /** */
+    protected void paramaterMethod(Configuration c) {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodCheckedException.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodCheckedException.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodCheckedException.java
new file mode 100644
index 0000000..8fd12ae
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodCheckedException.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.ChecksumException;
+
+/**
+ * Method declares a checked Hadoop Exception.
+ */
+@SuppressWarnings("unused")
+public class WithMethodCheckedException {
+    /** */
+    void foo() throws ChecksumException {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodInvocation.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodInvocation.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodInvocation.java
new file mode 100644
index 0000000..de8b306
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodInvocation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.FileSystem;
+
+/**
+ * Method contains a Hadoop type method invocation.
+ */
+@SuppressWarnings("unused")
+public class WithMethodInvocation {
+    /** */
+    void foo(FileSystem fs) {
+        fs.getChildFileSystems();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodReturnType.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodReturnType.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodReturnType.java
new file mode 100644
index 0000000..0e0ea72
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodReturnType.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.FileSystem;
+
+/**
+ * Contains a method return value of Hadoop type.
+ */
+@SuppressWarnings("unused")
+public class WithMethodReturnType {
+    /** */
+    FileSystem fsMethod() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodRuntimeException.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodRuntimeException.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodRuntimeException.java
new file mode 100644
index 0000000..dcd471c
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithMethodRuntimeException.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.HadoopIllegalArgumentException;
+
+/**
+ * Method declares a runtime Hadoop Exception.
+ */
+@SuppressWarnings("unused")
+public class WithMethodRuntimeException {
+    /** */
+    void foo() throws HadoopIllegalArgumentException {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithOuterClass.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithOuterClass.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithOuterClass.java
new file mode 100644
index 0000000..cae1da7
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithOuterClass.java
@@ -0,0 +1,38 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * Outer class depends on Hadoop, but Inner *static* one does not.
+ */
+@SuppressWarnings("unused")
+public class WithOuterClass {
+    /** */
+    Configuration c;
+
+    /** */
+    public static class InnerNoHadoop {
+        /** */
+        int x;
+
+        /** */
+        void foo() {}
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithParameterAnnotation.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithParameterAnnotation.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithParameterAnnotation.java
new file mode 100644
index 0000000..9d3414e
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithParameterAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.classification.InterfaceStability;
+
+/**
+ * Has a paramater annotated with a Hadoop annotation.
+ */
+@SuppressWarnings("unused")
+public class WithParameterAnnotation {
+    /** */
+    void foo(@InterfaceStability.Stable Object annotatedParam) {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticField.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticField.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticField.java
new file mode 100644
index 0000000..301b912
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticField.java
@@ -0,0 +1,29 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import org.apache.hadoop.fs.FileSystem;
+
+/**
+ * Has a static field of Hadoop type.
+ */
+@SuppressWarnings("unused")
+public class WithStaticField {
+    /** */
+    static FileSystem fs;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticInitializer.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticInitializer.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticInitializer.java
new file mode 100644
index 0000000..e0fc2f3
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/WithStaticInitializer.java
@@ -0,0 +1,34 @@
+/*
+ * 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.processors.hadoop.deps;
+
+import java.util.List;
+import org.apache.hadoop.fs.FileSystem;
+
+/**
+ * Uses Hadoop type in a static initializer.
+ */
+@SuppressWarnings("unused")
+public class WithStaticInitializer {
+    /** */
+    static final List x;
+
+    static {
+        x = FileSystem.getAllStatistics();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/Without.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/Without.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/Without.java
new file mode 100644
index 0000000..ab84740
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/deps/Without.java
@@ -0,0 +1,25 @@
+/*
+ * 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.processors.hadoop.deps;
+
+/**
+ * Class that does not anyhow depend on Hadoop.
+ */
+public class Without {
+    // No-op.
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/012ca730/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 6641bc8..1831085 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -54,6 +54,7 @@ import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalPrimarySelfT
 import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalSecondarySelfTest;
 import org.apache.ignite.igfs.IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest;
 import org.apache.ignite.igfs.IgniteHadoopFileSystemSecondaryModeSelfTest;
+import org.apache.ignite.internal.processors.hadoop.HadoopClassLoaderTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopCommandLineTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopDefaultMapReducePlannerSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopFileSystemsTest;
@@ -95,6 +96,8 @@ public class IgniteHadoopTestSuite extends TestSuite {
 
         TestSuite suite = new TestSuite("Ignite Hadoop MR Test Suite");
 
+        suite.addTest(new TestSuite(ldr.loadClass(HadoopClassLoaderTest.class.getName())));
+
         suite.addTest(new TestSuite(ldr.loadClass(HadoopIgfs20FileSystemLoopbackPrimarySelfTest.class.getName())));
 
         suite.addTest(new TestSuite(ldr.loadClass(HadoopIgfsDualSyncSelfTest.class.getName())));


[12/50] [abbrv] ignite git commit: release-sources & dotnet doc fix

Posted by vo...@apache.org.
release-sources & dotnet doc fix


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

Branch: refs/heads/ignite-2234
Commit: dd0a8d3acc2696db3404f7708bf27e34c7456b07
Parents: 939a170
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 12:39:04 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 12:39:04 2015 +0300

----------------------------------------------------------------------
 assembly/release-sources.xml | 79 +++++++++++++++++++++++++++++++++++++++
 modules/clients/pom.xml      |  2 +-
 pom.xml                      | 23 +++++++-----
 3 files changed, 93 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dd0a8d3a/assembly/release-sources.xml
----------------------------------------------------------------------
diff --git a/assembly/release-sources.xml b/assembly/release-sources.xml
new file mode 100644
index 0000000..96e54f9
--- /dev/null
+++ b/assembly/release-sources.xml
@@ -0,0 +1,79 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+  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.
+-->
+
+<assembly>
+    <id>source-release</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+        <!-- main project directory structure -->
+        <fileSet>
+            <directory>.</directory>
+            <outputDirectory>/</outputDirectory>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <excludes>
+                <!-- build output -->
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/).*${project.build.directory}.*]</exclude>
+
+                <!-- NOTE: Most of the following excludes should not be required
+                     if the standard release process is followed. This is because the
+                     release plugin checks out project sources into a location like
+                     target/checkout, then runs the build from there. The result is
+                     a source-release archive that comes from a pretty clean directory
+                     structure.
+
+                     HOWEVER, if the release plugin is configured to run extra goals
+                     or generate a project website, it's definitely possible that some
+                     of these files will be present. So, it's safer to exclude them.
+                -->
+
+                <!-- IDEs -->
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?maven-eclipse\.xml]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.project]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.classpath]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iws]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.idea(/.*)?]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?out(/.*)?]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.ipr]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iml]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.settings(/.*)?]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.externalToolBuilders(/.*)?]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.deployables(/.*)?]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.wtpmodules(/.*)?]</exclude>
+
+                <!-- misc -->
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?cobertura\.ser]</exclude>
+
+                <!-- release-plugin temp files -->
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?pom\.xml\.releaseBackup]</exclude>
+                <exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?release\.properties]</exclude>
+
+                <!-- dotnet assemblies -->
+                <exclude>modules/platforms/dotnet/bin/**</exclude>
+            </excludes>
+        </fileSet>
+        <!-- license, readme, etc. calculated at build time -->
+        <fileSet>
+            <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd0a8d3a/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 1f4555f..faef4a4 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -142,7 +142,7 @@
             <id>docs</id>
             <activation>
                 <property>
-                    <name>!skipClientDocs</name>
+                    <name>clientDocs</name>
                 </property>
             </activation>
             <build>

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd0a8d3a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4bdad1e..3457c30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -476,25 +476,28 @@
                 <plugins>
                     <plugin>
                         <artifactId>maven-assembly-plugin</artifactId>
-                        <dependencies>
-                            <dependency>
-                                <groupId>org.apache.apache.resources</groupId>
-                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
-                                <version>1.0.4</version>
-                            </dependency>
-                        </dependencies>
                         <executions>
                             <execution>
+                                <!-- skip default -->
                                 <id>source-release-assembly</id>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                                <configuration>
+                                    <skipAssembly>true</skipAssembly>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>source-release-assembly-ignite</id>
                                 <phase>package</phase>
                                 <goals>
                                     <goal>single</goal>
                                 </goals>
                                 <configuration>
                                     <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
-                                    <descriptorRefs>
-                                        <descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
-                                    </descriptorRefs>
+                                    <descriptors>
+                                        <descriptor>assembly/release-sources.xml</descriptor>
+                                    </descriptors>
                                     <tarLongFileMode>gnu</tarLongFileMode>
                                     <finalName>${project.artifactId}-${project.version}-src</finalName>
                                     <appendAssemblyId>false</appendAssemblyId>


[32/50] [abbrv] ignite git commit: PageMemory - WIP.

Posted by vo...@apache.org.
PageMemory - WIP.


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

Branch: refs/heads/ignite-2234
Commit: 13e408efaeaa6a57061fa4d5f8be4a608495e9c7
Parents: ce2a29b
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Dec 29 17:32:06 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Dec 29 17:33:17 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       | 40 ++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/13e408ef/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index be4851d..480859d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -7667,6 +7667,22 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Gets object field offset.
+     *
+     * @param cls Object class.
+     * @param fieldName Field name.
+     * @return Field offset.
+     */
+    public static long fieldOffset(Class<?> cls, String fieldName) {
+        try {
+            return UNSAFE.objectFieldOffset(cls.getDeclaredField(fieldName));
+        }
+        catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
      * @param cls Class to check.
      * @return {@code True} if class is final.
      */
@@ -9174,6 +9190,30 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * @param cls The class to search.
+     * @param name Name of a field to get.
+     * @return Field or {@code null}.
+     */
+    @Nullable public static Field findNonPublicField(Class<?> cls, String name) {
+        while (cls != null) {
+            try {
+                Field fld = cls.getDeclaredField(name);
+
+                fld.setAccessible(true);
+
+                return fld;
+            }
+            catch (NoSuchFieldException e) {
+                // No-op.
+            }
+
+            cls = cls.getSuperclass();
+        }
+
+        return null;
+    }
+
+    /**
      * @param c Collection.
      * @param p Optional filters.
      * @return Resulting array list.


[48/50] [abbrv] ignite git commit: IGNITE-2206: Hadoop file system creation is now abstracted out using factory interface.

Posted by vo...@apache.org.
IGNITE-2206: Hadoop file system creation is now abstracted out using factory interface.


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

Branch: refs/heads/ignite-2234
Commit: 8ed73b4af8024167daeb4775e084b1f6a23fbf13
Parents: 7d58d14
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jan 5 10:59:31 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jan 5 10:59:31 2016 +0400

----------------------------------------------------------------------
 .../org/apache/ignite/igfs/IgfsUserContext.java |  16 +-
 .../igfs/secondary/IgfsSecondaryFileSystem.java |  14 -
 .../processors/hadoop/HadoopPayloadAware.java   |  28 ++
 .../ignite/internal/processors/igfs/IgfsEx.java |  13 -
 .../internal/processors/igfs/IgfsImpl.java      |  16 +-
 .../internal/processors/igfs/IgfsPaths.java     |  62 +++-
 .../igfs/IgfsSecondaryFileSystemImpl.java       |  11 -
 .../visor/node/VisorIgfsConfiguration.java      |  43 ---
 .../processors/igfs/IgfsAbstractSelfTest.java   |   8 +-
 .../igfs/IgfsExUniversalFileSystemAdapter.java  |  11 +-
 .../igfs/UniversalFileSystemAdapter.java        |   5 +-
 .../hadoop/fs/BasicHadoopFileSystemFactory.java | 209 ++++++++++++
 .../fs/CachingHadoopFileSystemFactory.java      |  86 +++++
 .../hadoop/fs/HadoopFileSystemFactory.java      |  52 +++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 264 +++++++--------
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    | 144 +++++---
 .../hadoop/fs/v2/IgniteHadoopFileSystem.java    | 115 ++++---
 .../hadoop/SecondaryFileSystemProvider.java     | 139 --------
 .../hadoop/fs/HadoopFileSystemCacheUtils.java   |   8 +-
 .../hadoop/fs/HadoopLazyConcurrentMap.java      |   5 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |  14 +-
 .../igfs/HadoopFIleSystemFactorySelfTest.java   | 326 +++++++++++++++++++
 ...oopFileSystemUniversalFileSystemAdapter.java |  53 +--
 ...oopSecondaryFileSystemConfigurationTest.java |  27 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |  71 ++--
 .../testsuites/IgniteHadoopTestSuite.java       |   3 +
 26 files changed, 1191 insertions(+), 552 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java
index 8db4e23..1e1cd31 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java
@@ -34,24 +34,24 @@ public abstract class IgfsUserContext {
      * The main contract of this method is that {@link #currentUser()} method invoked
      * inside closure always returns 'user' this callable executed with.
      * @param user the user name to invoke closure on behalf of.
-     * @param clo the closure to execute
+     * @param c the closure to execute
      * @param <T> The type of closure result.
      * @return the result of closure execution.
      * @throws IllegalArgumentException if user name is null or empty String or if the closure is null.
      */
-    public static <T> T doAs(String user, final IgniteOutClosure<T> clo) {
+    public static <T> T doAs(String user, final IgniteOutClosure<T> c) {
         if (F.isEmpty(user))
             throw new IllegalArgumentException("Failed to use null or empty user name.");
 
         final String ctxUser = userStackThreadLocal.get();
 
         if (F.eq(ctxUser, user))
-            return clo.apply(); // correct context is already there
+            return c.apply(); // correct context is already there
 
         userStackThreadLocal.set(user);
 
         try {
-            return clo.apply();
+            return c.apply();
         }
         finally {
             userStackThreadLocal.set(ctxUser);
@@ -81,24 +81,24 @@ public abstract class IgfsUserContext {
      *  }
      * </pre>
      * @param user the user name to invoke closure on behalf of.
-     * @param clbl the Callable to execute
+     * @param c the Callable to execute
      * @param <T> The type of callable result.
      * @return the result of closure execution.
      * @throws IllegalArgumentException if user name is null or empty String or if the closure is null.
      */
-    public static <T> T doAs(String user, final Callable<T> clbl) throws Exception {
+    public static <T> T doAs(String user, final Callable<T> c) throws Exception {
         if (F.isEmpty(user))
             throw new IllegalArgumentException("Failed to use null or empty user name.");
 
         final String ctxUser = userStackThreadLocal.get();
 
         if (F.eq(ctxUser, user))
-            return clbl.call(); // correct context is already there
+            return c.call(); // correct context is already there
 
         userStackThreadLocal.set(user);
 
         try {
-            return clbl.call();
+            return c.call();
         }
         finally {
             userStackThreadLocal.set(ctxUser);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
index ca6ecb7..3f124eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
@@ -192,18 +192,4 @@ public interface IgfsSecondaryFileSystem {
      * @throws IgniteException In case of error.
      */
     public long usedSpaceSize() throws IgniteException;
-
-    /**
-     * Gets the implementation specific properties of file system.
-     *
-     * @return Map of properties.
-     */
-    public Map<String,String> properties();
-
-
-    /**
-     * Closes the secondary file system.
-     * @throws IgniteException in case of an error.
-     */
-    public void close() throws IgniteException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopPayloadAware.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopPayloadAware.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopPayloadAware.java
new file mode 100644
index 0000000..9b79729
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopPayloadAware.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.hadoop;
+
+/**
+ * Gets payload for Hadoop secondary file system.
+ */
+public interface HadoopPayloadAware {
+    /**
+     * @return Payload.
+     */
+    public Object getPayload();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
index 8ff7247..cf268e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
@@ -43,19 +43,6 @@ public interface IgfsEx extends IgniteFileSystem {
     /** File property: prefer writes to local node. */
     public static final String PROP_PREFER_LOCAL_WRITES = "locWrite";
 
-    /** Property name for path to Hadoop configuration. */
-    public static final String SECONDARY_FS_CONFIG_PATH = "SECONDARY_FS_CONFIG_PATH";
-
-    /** Property name for URI of file system. */
-    public static final String SECONDARY_FS_URI = "SECONDARY_FS_URI";
-
-    /** Property name for default user name of file system.
-     * NOTE: for secondary file system this is just a default user name, which is used
-     * when the 2ndary filesystem is used outside of any user context.
-     * If another user name is set in the context, 2ndary file system will work on behalf
-     * of that user, which is different from the default. */
-     public static final String SECONDARY_FS_USER_NAME = "SECONDARY_FS_USER_NAME";
-
     /**
      * Stops IGFS cleaning all used resources.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 680e660..38914ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -72,6 +72,7 @@ import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
+import org.apache.ignite.internal.processors.hadoop.HadoopPayloadAware;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -87,6 +88,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.lifecycle.LifecycleAware;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.apache.ignite.thread.IgniteThreadPoolExecutor;
 import org.jetbrains.annotations.Nullable;
@@ -200,6 +202,9 @@ public final class IgfsImpl implements IgfsEx {
         data = igfsCtx.data();
         secondaryFs = cfg.getSecondaryFileSystem();
 
+        if (secondaryFs instanceof LifecycleAware)
+            ((LifecycleAware) secondaryFs).start();
+
         /* Default IGFS mode. */
         IgfsMode dfltMode;
 
@@ -256,8 +261,12 @@ public final class IgfsImpl implements IgfsEx {
 
         modeRslvr = new IgfsModeResolver(dfltMode, modes);
 
-        secondaryPaths = new IgfsPaths(secondaryFs == null ? null : secondaryFs.properties(), dfltMode,
-            modeRslvr.modesOrdered());
+        Object secondaryFsPayload = null;
+
+        if (secondaryFs instanceof HadoopPayloadAware)
+            secondaryFsPayload = ((HadoopPayloadAware) secondaryFs).getPayload();
+
+        secondaryPaths = new IgfsPaths(secondaryFsPayload, dfltMode, modeRslvr.modesOrdered());
 
         // Check whether IGFS LRU eviction policy is set on data cache.
         String dataCacheName = igfsCtx.configuration().getDataCacheName();
@@ -305,7 +314,8 @@ public final class IgfsImpl implements IgfsEx {
                 batch.cancel();
 
             try {
-                secondaryFs.close();
+                if (secondaryFs instanceof LifecycleAware)
+                    ((LifecycleAware)secondaryFs).stop();
             }
             catch (Exception e) {
                 log.error("Failed to close secondary file system.", e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
index fbf89ce..4a79259 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
@@ -17,17 +17,21 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
+
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.marshaller.jdk.JdkMarshaller;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -37,8 +41,8 @@ public class IgfsPaths implements Externalizable {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Additional secondary file system properties. */
-    private Map<String, String> props;
+    /** */
+    private byte[] payloadBytes;
 
     /** Default IGFS mode. */
     private IgfsMode dfltMode;
@@ -56,22 +60,25 @@ public class IgfsPaths implements Externalizable {
     /**
      * Constructor.
      *
-     * @param props Additional secondary file system properties.
+     * @param payload Payload.
      * @param dfltMode Default IGFS mode.
      * @param pathModes Path modes.
+     * @throws IgniteCheckedException If failed.
      */
-    public IgfsPaths(Map<String, String> props, IgfsMode dfltMode, @Nullable List<T2<IgfsPath,
-        IgfsMode>> pathModes) {
-        this.props = props;
+    public IgfsPaths(Object payload, IgfsMode dfltMode, @Nullable List<T2<IgfsPath, IgfsMode>> pathModes)
+        throws IgniteCheckedException {
         this.dfltMode = dfltMode;
         this.pathModes = pathModes;
-    }
 
-    /**
-     * @return Secondary file system properties.
-     */
-    public Map<String, String> properties() {
-        return props;
+        if (payload == null)
+            payloadBytes = null;
+        else {
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+            new JdkMarshaller().marshal(payload, out);
+
+            payloadBytes = out.toByteArray();
+        }
     }
 
     /**
@@ -88,9 +95,25 @@ public class IgfsPaths implements Externalizable {
         return pathModes;
     }
 
+    /**
+     * @return Payload.
+     *
+     * @throws IgniteCheckedException If failed to deserialize the payload.
+     */
+    @Nullable public Object getPayload(ClassLoader clsLdr) throws IgniteCheckedException {
+        if (payloadBytes == null)
+            return null;
+        else {
+            ByteArrayInputStream in = new ByteArrayInputStream(payloadBytes);
+
+            return new JdkMarshaller().unmarshal(in, clsLdr);
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        U.writeStringMap(out, props);
+        U.writeByteArray(out, payloadBytes);
+
         U.writeEnum(out, dfltMode);
 
         if (pathModes != null) {
@@ -98,7 +121,10 @@ public class IgfsPaths implements Externalizable {
             out.writeInt(pathModes.size());
 
             for (T2<IgfsPath, IgfsMode> pathMode : pathModes) {
+                assert pathMode.getKey() != null;
+
                 pathMode.getKey().writeExternal(out);
+
                 U.writeEnum(out, pathMode.getValue());
             }
         }
@@ -108,7 +134,8 @@ public class IgfsPaths implements Externalizable {
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        props = U.readStringMap(in);
+        payloadBytes = U.readByteArray(in);
+
         dfltMode = IgfsMode.fromOrdinal(in.readByte());
 
         if (in.readBoolean()) {
@@ -118,11 +145,10 @@ public class IgfsPaths implements Externalizable {
 
             for (int i = 0; i < size; i++) {
                 IgfsPath path = new IgfsPath();
-                path.readExternal(in);
 
-                T2<IgfsPath, IgfsMode> entry = new T2<>(path, IgfsMode.fromOrdinal(in.readByte()));
+                path.readExternal(in);
 
-                pathModes.add(entry);
+                pathModes.add(new T2<>(path, IgfsMode.fromOrdinal(in.readByte())));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
index 23d6322..44e858f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.igfs;
 
 import java.io.OutputStream;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.igfs.IgfsFile;
@@ -116,14 +115,4 @@ class IgfsSecondaryFileSystemImpl implements IgfsSecondaryFileSystem {
     @Override public long usedSpaceSize() throws IgniteException {
         return igfs.usedSpaceSize();
     }
-
-    /** {@inheritDoc} */
-    @Override public Map<String, String> properties() {
-        return Collections.emptyMap();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() throws IgniteException {
-        // No-op.
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index e85484d..ea0e721 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -29,9 +29,6 @@ import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_CONFIG_PATH;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_URI;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_USER_NAME;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
 
 /**
@@ -65,15 +62,6 @@ public class VisorIgfsConfiguration implements Serializable {
     /** Number of batches that can be concurrently sent to remote node. */
     private int perNodeParallelBatchCnt;
 
-    /** URI of the secondary Hadoop file system. */
-    private String secondaryHadoopFileSysUri;
-
-    /** Path for the secondary hadoop file system config. */
-    private String secondaryHadoopFileSysCfgPath;
-
-    /** User name for the secondary hadoop file system config. */
-    private String secondaryHadoopFileSysUserName;
-
     /** IGFS instance mode. */
     private IgfsMode dfltMode;
 
@@ -141,16 +129,6 @@ public class VisorIgfsConfiguration implements Serializable {
         cfg.perNodeBatchSize = igfs.getPerNodeBatchSize();
         cfg.perNodeParallelBatchCnt = igfs.getPerNodeParallelBatchCount();
 
-        IgfsSecondaryFileSystem secFs = igfs.getSecondaryFileSystem();
-
-        if (secFs != null) {
-            Map<String, String> props = secFs.properties();
-
-            cfg.secondaryHadoopFileSysUri = props.get(SECONDARY_FS_URI);
-            cfg.secondaryHadoopFileSysCfgPath = props.get(SECONDARY_FS_CONFIG_PATH);
-            cfg.secondaryHadoopFileSysUserName = props.get(SECONDARY_FS_USER_NAME);
-        }
-
         cfg.dfltMode = igfs.getDefaultMode();
         cfg.pathModes = igfs.getPathModes();
         cfg.dualModePutExecutorSrvc = compactClass(igfs.getDualModePutExecutorService());
@@ -251,27 +229,6 @@ public class VisorIgfsConfiguration implements Serializable {
     }
 
     /**
-     * @return URI of the secondary Hadoop file system.
-     */
-    @Nullable public String secondaryHadoopFileSystemUri() {
-        return secondaryHadoopFileSysUri;
-    }
-
-    /**
-     * @return User name of the secondary Hadoop file system.
-     */
-    @Nullable public String secondaryHadoopFileSystemUserName() {
-        return secondaryHadoopFileSysUserName;
-    }
-
-    /**
-     * @return Path for the secondary hadoop file system config.
-     */
-    @Nullable public String secondaryHadoopFileSystemConfigPath() {
-        return secondaryHadoopFileSysCfgPath;
-    }
-
-    /**
      * @return IGFS instance mode.
      */
     public IgfsMode defaultMode() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index b290303..015b992 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -2744,7 +2744,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
         finally {
             U.closeQuiet(os);
 
-            IgfsEx igfsEx = uni.getAdapter(IgfsEx.class);
+            IgfsEx igfsEx = uni.unwrap(IgfsEx.class);
 
             if (igfsEx != null)
                 awaitFileClose(igfsEx.asSecondary(), file);
@@ -2868,7 +2868,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
      * @throws IgniteCheckedException If failed.
      */
     protected void checkExist(UniversalFileSystemAdapter uni, IgfsPath... paths) throws IgniteCheckedException {
-        IgfsEx ex = uni.getAdapter(IgfsEx.class);
+        IgfsEx ex = uni.unwrap(IgfsEx.class);
         for (IgfsPath path : paths) {
             if (ex != null)
                 assert ex.context().meta().fileId(path) != null : "Path doesn't exist [igfs=" + ex.name() +
@@ -2921,7 +2921,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     protected void checkNotExist(UniversalFileSystemAdapter uni, IgfsPath... paths) throws Exception {
-        IgfsEx ex = uni.getAdapter(IgfsEx.class);
+        IgfsEx ex = uni.unwrap(IgfsEx.class);
         for (IgfsPath path : paths) {
             if (ex != null)
                 assert ex.context().meta().fileId(path) == null : "Path exists [igfs=" + ex.name() + ", path=" +
@@ -3222,7 +3222,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
      */
     @SuppressWarnings("unchecked")
     public static void clear(UniversalFileSystemAdapter uni) throws Exception {
-        IgfsEx igfsEx = uni.getAdapter(IgfsEx.class);
+        IgfsEx igfsEx = uni.unwrap(IgfsEx.class);
 
         if (igfsEx != null)
             clear(igfsEx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsExUniversalFileSystemAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsExUniversalFileSystemAdapter.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsExUniversalFileSystemAdapter.java
index 7583364..c6bef72 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsExUniversalFileSystemAdapter.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsExUniversalFileSystemAdapter.java
@@ -28,7 +28,6 @@ import org.apache.ignite.igfs.IgfsPath;
  * Universal adapter over {@link IgfsEx} filesystem.
  */
 public class IgfsExUniversalFileSystemAdapter implements UniversalFileSystemAdapter {
-
     /** The wrapped igfs. */
     private final IgfsEx igfsEx;
 
@@ -69,18 +68,14 @@ public class IgfsExUniversalFileSystemAdapter implements UniversalFileSystemAdap
     @Override public boolean delete(String path, boolean recursive) throws IOException {
         IgfsPath igfsPath = new IgfsPath(path);
 
-        boolean del = igfsEx.delete(igfsPath, recursive);
-
-        return del;
+        return igfsEx.delete(igfsPath, recursive);
     }
 
     /** {@inheritDoc} */
     @Override public InputStream openInputStream(String path) throws IOException {
         IgfsPath igfsPath = new IgfsPath(path);
 
-        IgfsInputStreamAdapter adapter = igfsEx.open(igfsPath);
-
-        return adapter;
+        return igfsEx.open(igfsPath);
     }
 
     /** {@inheritDoc} */
@@ -97,7 +92,7 @@ public class IgfsExUniversalFileSystemAdapter implements UniversalFileSystemAdap
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T getAdapter(Class<T> clazz) {
+    @Override public <T> T unwrap(Class<T> clazz) {
         if (clazz == IgfsEx.class)
             return (T)igfsEx;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
index ba8c164..eef0057 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
@@ -31,8 +31,9 @@ public interface UniversalFileSystemAdapter {
     /**
      * Gets name of the FS.
      * @return name of this file system.
+     * @throws IOException in case of failure.
      */
-    String name();
+    String name() throws IOException;
 
     /**
      * Answers if a file denoted by path exists.
@@ -93,5 +94,5 @@ public interface UniversalFileSystemAdapter {
      * @param <T> The type we need to adapt to.
      * @return the adapter object of the given type.
      */
-    <T> T getAdapter(Class<T> clazz);
+    <T> T unwrap(Class<T> clazz);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
new file mode 100644
index 0000000..1e2bbf2
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
@@ -0,0 +1,209 @@
+/*
+ * 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.hadoop.fs;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
+import org.apache.ignite.internal.processors.hadoop.HadoopUtils;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lifecycle.LifecycleAware;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Arrays;
+
+/**
+ * Simple Hadoop file system factory which delegates to {@code FileSystem.get()} on each call.
+ * <p>
+ * If {@code "fs.[prefix].impl.disable.cache"} is set to {@code true}, file system instances will be cached by Hadoop.
+ */
+public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Externalizable, LifecycleAware {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** File system URI. */
+    protected String uri;
+
+    /** File system config paths. */
+    protected String[] cfgPaths;
+
+    /** Configuration of the secondary filesystem, never null. */
+    protected transient Configuration cfg;
+
+    /** Resulting URI. */
+    protected transient URI fullUri;
+
+    /**
+     * Constructor.
+     */
+    public BasicHadoopFileSystemFactory() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public FileSystem get(String usrName) throws IOException {
+        return create0(IgfsUtils.fixUserName(usrName));
+    }
+
+    /**
+     * Internal file system create routine.
+     *
+     * @param usrName User name.
+     * @return File system.
+     * @throws IOException If failed.
+     */
+    protected FileSystem create0(String usrName) throws IOException {
+        assert cfg != null;
+
+        try {
+            return FileSystem.get(fullUri, cfg, usrName);
+        }
+        catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+
+            throw new IOException("Failed to create file system due to interrupt.", e);
+        }
+    }
+
+    /**
+     * Gets file system URI.
+     * <p>
+     * This URI will be used as a first argument when calling {@link FileSystem#get(URI, Configuration, String)}.
+     * <p>
+     * If not set, default URI will be picked from file system configuration using
+     * {@link FileSystem#getDefaultUri(Configuration)} method.
+     *
+     * @return File system URI.
+     */
+    @Nullable public String getUri() {
+        return uri;
+    }
+
+    /**
+     * Sets file system URI. See {@link #getUri()} for more information.
+     *
+     * @param uri File system URI.
+     */
+    public void setUri(@Nullable String uri) {
+        this.uri = uri;
+    }
+
+    /**
+     * Gets paths to additional file system configuration files (e.g. core-site.xml).
+     * <p>
+     * Path could be either absolute or relative to {@code IGNITE_HOME} environment variable.
+     * <p>
+     * All provided paths will be loaded in the order they provided and then applied to {@link Configuration}. It means
+     * that path order might be important in some cases.
+     * <p>
+     * <b>NOTE!</b> Factory can be serialized and transferred to other machines where instance of
+     * {@link IgniteHadoopFileSystem} resides. Corresponding paths must exist on these machines as well.
+     *
+     * @return Paths to file system configuration files.
+     */
+    @Nullable public String[] getConfigPaths() {
+        return cfgPaths;
+    }
+
+    /**
+     * Set paths to additional file system configuration files (e.g. core-site.xml). See {@link #getConfigPaths()} for
+     * more information.
+     *
+     * @param cfgPaths Paths to file system configuration files.
+     */
+    public void setConfigPaths(String... cfgPaths) {
+        this.cfgPaths = cfgPaths;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start() throws IgniteException {
+        cfg = HadoopUtils.safeCreateConfiguration();
+
+        if (cfgPaths != null) {
+            for (String cfgPath : cfgPaths) {
+                if (cfgPath == null)
+                    throw new NullPointerException("Configuration path cannot be null: " + Arrays.toString(cfgPaths));
+                else {
+                    URL url = U.resolveIgniteUrl(cfgPath);
+
+                    if (url == null) {
+                        // If secConfPath is given, it should be resolvable:
+                        throw new IgniteException("Failed to resolve secondary file system configuration path " +
+                            "(ensure that it exists locally and you have read access to it): " + cfgPath);
+                    }
+
+                    cfg.addResource(url);
+                }
+            }
+        }
+
+        // If secondary fs URI is not given explicitly, try to get it from the configuration:
+        if (uri == null)
+            fullUri = FileSystem.getDefaultUri(cfg);
+        else {
+            try {
+                fullUri = new URI(uri);
+            }
+            catch (URISyntaxException use) {
+                throw new IgniteException("Failed to resolve secondary file system URI: " + uri);
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void stop() throws IgniteException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        U.writeString(out, uri);
+
+        if (cfgPaths != null) {
+            out.writeInt(cfgPaths.length);
+
+            for (String cfgPath : cfgPaths)
+                U.writeString(out, cfgPath);
+        }
+        else
+            out.writeInt(-1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        uri = U.readString(in);
+
+        int cfgPathsCnt = in.readInt();
+
+        if (cfgPathsCnt != -1) {
+            cfgPaths = new String[cfgPathsCnt];
+
+            for (int i = 0; i < cfgPathsCnt; i++)
+                cfgPaths[i] = U.readString(in);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
new file mode 100644
index 0000000..91f7777
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
@@ -0,0 +1,86 @@
+/*
+ * 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.hadoop.fs;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.processors.hadoop.fs.HadoopFileSystemsUtils;
+import org.apache.ignite.internal.processors.hadoop.fs.HadoopLazyConcurrentMap;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+
+import java.io.IOException;
+import java.net.URI;
+
+/**
+ * Caching Hadoop file system factory. Caches {@link FileSystem} instances on per-user basis. Doesn't rely on
+ * built-in Hadoop {@code FileSystem} caching mechanics. Separate {@code FileSystem} instance is created for each
+ * user instead.
+ * <p>
+ * This makes cache instance resistant to concurrent calls to {@link FileSystem#close()} in other parts of the user
+ * code. On the other hand, this might cause problems on some environments. E.g. if Kerberos is enabled, a call to
+ * {@link FileSystem#get(URI, Configuration, String)} will refresh Kerberos token. But this factory implementation
+ * calls this method only once per user what may lead to token expiration. In such cases it makes sense to either
+ * use {@link BasicHadoopFileSystemFactory} or implement your own factory.
+ */
+public class CachingHadoopFileSystemFactory extends BasicHadoopFileSystemFactory {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Per-user file system cache. */
+    private final transient HadoopLazyConcurrentMap<String, FileSystem> cache = new HadoopLazyConcurrentMap<>(
+        new HadoopLazyConcurrentMap.ValueFactory<String, FileSystem>() {
+            @Override public FileSystem createValue(String key) throws IOException {
+                return create0(key);
+            }
+        }
+    );
+
+    /**
+     * Public non-arg constructor.
+     */
+    public CachingHadoopFileSystemFactory() {
+        // noop
+    }
+
+    /** {@inheritDoc} */
+    @Override public FileSystem get(String usrName) throws IOException {
+        return cache.getOrCreate(IgfsUtils.fixUserName(usrName));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start() throws IgniteException {
+        super.start();
+
+        // Disable caching.
+        cfg.setBoolean(HadoopFileSystemsUtils.disableFsCachePropertyName(fullUri.getScheme()), true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void stop() throws IgniteException {
+        super.stop();
+
+        try {
+            cache.close();
+        }
+        catch (IgniteCheckedException ice) {
+            throw new IgniteException(ice);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/HadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/HadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/HadoopFileSystemFactory.java
new file mode 100644
index 0000000..5ad08ab
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/HadoopFileSystemFactory.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.hadoop.fs;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
+import org.apache.ignite.igfs.IgfsMode;
+import org.apache.ignite.lifecycle.LifecycleAware;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+/**
+ * Factory for Hadoop {@link FileSystem} used by {@link IgniteHadoopIgfsSecondaryFileSystem}.
+ * <p>
+ * {@link #get(String)} method will be used whenever a call to a target {@code FileSystem} is required.
+ * <p>
+ * It is implementation dependent whether to rely on built-in Hadoop file system cache, implement own caching facility
+ * or doesn't cache file systems at all.
+ * <p>
+ * Concrete factory may implement {@link LifecycleAware} interface. In this case start and stop callbacks will be
+ * performed by Ignite. You may want to implement some initialization or cleanup there.
+ * <p>
+ * Note that factory extends {@link Serializable} interface as it might be necessary to transfer factories over the
+ * wire to {@link IgniteHadoopFileSystem} if {@link IgfsMode#PROXY} is enabled for some file
+ * system paths.
+ */
+public interface HadoopFileSystemFactory extends Serializable {
+    /**
+     * Gets file system for the given user name.
+     *
+     * @param usrName User name
+     * @return File system.
+     * @throws IOException In case of error.
+     */
+    public FileSystem get(String usrName) throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index 1ca6938..9f544c1 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -17,15 +17,7 @@
 
 package org.apache.ignite.hadoop.fs;
 
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.ParentNotDirectoryException;
@@ -35,6 +27,7 @@ import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.igfs.IgfsDirectoryNotEmptyException;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsFile;
@@ -45,71 +38,59 @@ import org.apache.ignite.igfs.IgfsPathNotFoundException;
 import org.apache.ignite.igfs.IgfsUserContext;
 import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
 import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
-import org.apache.ignite.internal.processors.hadoop.SecondaryFileSystemProvider;
-import org.apache.ignite.internal.processors.hadoop.fs.HadoopLazyConcurrentMap;
-import org.apache.ignite.internal.processors.hadoop.fs.HadoopLazyConcurrentMap.ValueFactory;
+import org.apache.ignite.internal.processors.hadoop.HadoopPayloadAware;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsProperties;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsSecondaryFileSystemPositionedReadable;
-import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.processors.igfs.IgfsFileImpl;
 import org.apache.ignite.internal.processors.igfs.IgfsFileInfo;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.lang.IgniteOutClosure;
+import org.apache.ignite.lifecycle.LifecycleAware;
 import org.jetbrains.annotations.Nullable;
 
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_GROUP_NAME;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_PERMISSION;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_USER_NAME;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_CONFIG_PATH;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_URI;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_USER_NAME;
 
 /**
- * Adapter to use any Hadoop file system {@link FileSystem} as {@link IgfsSecondaryFileSystem}.
- * In fact, this class deals with different FileSystems depending on the user context,
- * see {@link IgfsUserContext#currentUser()}.
+ * Secondary file system which delegates calls to an instance of Hadoop {@link FileSystem}.
+ * <p>
+ * Target {@code FileSystem}'s are created on per-user basis using passed {@link HadoopFileSystemFactory}.
  */
-public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem {
-    /** Properties of file system, see {@link #properties()}
-     *
-     * See {@link IgfsEx#SECONDARY_FS_CONFIG_PATH}
-     * See {@link IgfsEx#SECONDARY_FS_URI}
-     * See {@link IgfsEx#SECONDARY_FS_USER_NAME}
-     * */
-    private final Map<String, String> props = new HashMap<>();
-
-    /** Secondary file system provider. */
-    private final SecondaryFileSystemProvider secProvider;
-
+public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, LifecycleAware,
+    HadoopPayloadAware {
     /** The default user name. It is used if no user context is set. */
-    private final String dfltUserName;
+    private String dfltUsrName;
 
-    /** FileSystem instance created for the default user.
-     * Stored outside the fileSysLazyMap due to performance reasons. */
-    private final FileSystem dfltFs;
+    /** Factory. */
+    private HadoopFileSystemFactory fsFactory;
 
-    /** Lazy per-user cache for the file systems. It is cleared and nulled in #close() method. */
-    private final HadoopLazyConcurrentMap<String, FileSystem> fileSysLazyMap = new HadoopLazyConcurrentMap<>(
-        new ValueFactory<String, FileSystem>() {
-            @Override public FileSystem createValue(String key) {
-                try {
-                    assert !F.isEmpty(key);
-
-                    return secProvider.createFileSystem(key);
-                }
-                catch (IOException ioe) {
-                    throw new IgniteException(ioe);
-                }
-            }
-        }
-    );
+    /**
+     * Default constructor for Spring.
+     */
+    public IgniteHadoopIgfsSecondaryFileSystem() {
+        // No-op.
+    }
 
     /**
      * Simple constructor that is to be used by default.
      *
      * @param uri URI of file system.
      * @throws IgniteCheckedException In case of error.
+     * @deprecated Use {@link #getFileSystemFactory()} instead.
      */
+    @Deprecated
     public IgniteHadoopIgfsSecondaryFileSystem(String uri) throws IgniteCheckedException {
         this(uri, null, null);
     }
@@ -120,7 +101,9 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
      * @param uri URI of file system.
      * @param cfgPath Additional path to Hadoop configuration.
      * @throws IgniteCheckedException In case of error.
+     * @deprecated Use {@link #getFileSystemFactory()} instead.
      */
+    @Deprecated
     public IgniteHadoopIgfsSecondaryFileSystem(@Nullable String uri, @Nullable String cfgPath)
         throws IgniteCheckedException {
         this(uri, cfgPath, null);
@@ -131,46 +114,73 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
      *
      * @param uri URI of file system.
      * @param cfgPath Additional path to Hadoop configuration.
-     * @param userName User name.
+     * @param usrName User name.
      * @throws IgniteCheckedException In case of error.
+     * @deprecated Use {@link #getFileSystemFactory()} instead.
      */
+    @Deprecated
     public IgniteHadoopIgfsSecondaryFileSystem(@Nullable String uri, @Nullable String cfgPath,
-        @Nullable String userName) throws IgniteCheckedException {
-        // Treat empty uri and userName arguments as nulls to improve configuration usability:
-        if (F.isEmpty(uri))
-            uri = null;
-
-        if (F.isEmpty(cfgPath))
-            cfgPath = null;
-
-        if (F.isEmpty(userName))
-            userName = null;
+        @Nullable String usrName) throws IgniteCheckedException {
+        setDefaultUserName(usrName);
 
-        this.dfltUserName = IgfsUtils.fixUserName(userName);
+        CachingHadoopFileSystemFactory fac = new CachingHadoopFileSystemFactory();
 
-        try {
-            this.secProvider = new SecondaryFileSystemProvider(uri, cfgPath);
+        fac.setUri(uri);
 
-            // File system creation for the default user name.
-            // The value is *not* stored in the 'fileSysLazyMap' cache, but saved in field:
-            this.dfltFs = secProvider.createFileSystem(dfltUserName);
-        }
-        catch (IOException e) {
-            throw new IgniteCheckedException(e);
-        }
+        if (cfgPath != null)
+            fac.setConfigPaths(cfgPath);
 
-        assert dfltFs != null;
+        setFileSystemFactory(fac);
+    }
 
-        uri = secProvider.uri().toString();
+    /**
+     * Gets default user name.
+     * <p>
+     * Defines user name which will be used during file system invocation in case no user name is defined explicitly
+     * through {@link FileSystem#get(URI, Configuration, String)}.
+     * <p>
+     * Also this name will be used if you manipulate {@link IgniteFileSystem} directly and do not set user name
+     * explicitly using {@link IgfsUserContext#doAs(String, IgniteOutClosure)} or
+     * {@link IgfsUserContext#doAs(String, Callable)} methods.
+     * <p>
+     * If not set value of system property {@code "user.name"} will be used. If this property is not set either,
+     * {@code "anonymous"} will be used.
+     *
+     * @return Default user name.
+     */
+    @Nullable public String getDefaultUserName() {
+        return dfltUsrName;
+    }
 
-        if (!uri.endsWith("/"))
-            uri += "/";
+    /**
+     * Sets default user name. See {@link #getDefaultUserName()} for details.
+     *
+     * @param dfltUsrName Default user name.
+     */
+    public void setDefaultUserName(@Nullable String dfltUsrName) {
+        this.dfltUsrName = dfltUsrName;
+    }
 
-        if (cfgPath != null)
-            props.put(SECONDARY_FS_CONFIG_PATH, cfgPath);
+    /**
+     * Gets secondary file system factory.
+     * <p>
+     * This factory will be used whenever a call to a target {@link FileSystem} is required.
+     * <p>
+     * If not set, {@link CachingHadoopFileSystemFactory} will be used.
+     *
+     * @return Secondary file system factory.
+     */
+    public HadoopFileSystemFactory getFileSystemFactory() {
+        return fsFactory;
+    }
 
-        props.put(SECONDARY_FS_URI, uri);
-        props.put(SECONDARY_FS_USER_NAME, dfltUserName);
+    /**
+     * Sets secondary file system factory. See {@link #getFileSystemFactory()} for details.
+     *
+     * @param factory Secondary file system factory.
+     */
+    public void setFileSystemFactory(HadoopFileSystemFactory factory) {
+        this.fsFactory = factory;
     }
 
     /**
@@ -180,7 +190,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
      * @return Hadoop path.
      */
     private Path convert(IgfsPath path) {
-        URI uri = fileSysForUser().getUri();
+        URI uri = fileSystemForUser().getUri();
 
         return new Path(uri.getScheme(), uri.getAuthority(), path.toString());
     }
@@ -234,7 +244,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public boolean exists(IgfsPath path) {
         try {
-            return fileSysForUser().exists(convert(path));
+            return fileSystemForUser().exists(convert(path));
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to check file existence [path=" + path + "]");
@@ -245,7 +255,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     @Nullable @Override public IgfsFile update(IgfsPath path, Map<String, String> props) {
         HadoopIgfsProperties props0 = new HadoopIgfsProperties(props);
 
-        final FileSystem fileSys = fileSysForUser();
+        final FileSystem fileSys = fileSystemForUser();
 
         try {
             if (props0.userName() != null || props0.groupName() != null)
@@ -266,7 +276,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     @Override public void rename(IgfsPath src, IgfsPath dest) {
         // Delegate to the secondary file system.
         try {
-            if (!fileSysForUser().rename(convert(src), convert(dest)))
+            if (!fileSystemForUser().rename(convert(src), convert(dest)))
                 throw new IgfsException("Failed to rename (secondary file system returned false) " +
                     "[src=" + src + ", dest=" + dest + ']');
         }
@@ -278,7 +288,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public boolean delete(IgfsPath path, boolean recursive) {
         try {
-            return fileSysForUser().delete(convert(path), recursive);
+            return fileSystemForUser().delete(convert(path), recursive);
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to delete file [path=" + path + ", recursive=" + recursive + "]");
@@ -288,7 +298,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public void mkdirs(IgfsPath path) {
         try {
-            if (!fileSysForUser().mkdirs(convert(path)))
+            if (!fileSystemForUser().mkdirs(convert(path)))
                 throw new IgniteException("Failed to make directories [path=" + path + "]");
         }
         catch (IOException e) {
@@ -299,7 +309,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public void mkdirs(IgfsPath path, @Nullable Map<String, String> props) {
         try {
-            if (!fileSysForUser().mkdirs(convert(path), new HadoopIgfsProperties(props).permission()))
+            if (!fileSystemForUser().mkdirs(convert(path), new HadoopIgfsProperties(props).permission()))
                 throw new IgniteException("Failed to make directories [path=" + path + ", props=" + props + "]");
         }
         catch (IOException e) {
@@ -310,7 +320,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public Collection<IgfsPath> listPaths(IgfsPath path) {
         try {
-            FileStatus[] statuses = fileSysForUser().listStatus(convert(path));
+            FileStatus[] statuses = fileSystemForUser().listStatus(convert(path));
 
             if (statuses == null)
                 throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path);
@@ -333,7 +343,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public Collection<IgfsFile> listFiles(IgfsPath path) {
         try {
-            FileStatus[] statuses = fileSysForUser().listStatus(convert(path));
+            FileStatus[] statuses = fileSystemForUser().listStatus(convert(path));
 
             if (statuses == null)
                 throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path);
@@ -360,13 +370,13 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
 
     /** {@inheritDoc} */
     @Override public IgfsSecondaryFileSystemPositionedReadable open(IgfsPath path, int bufSize) {
-        return new HadoopIgfsSecondaryFileSystemPositionedReadable(fileSysForUser(), convert(path), bufSize);
+        return new HadoopIgfsSecondaryFileSystemPositionedReadable(fileSystemForUser(), convert(path), bufSize);
     }
 
     /** {@inheritDoc} */
     @Override public OutputStream create(IgfsPath path, boolean overwrite) {
         try {
-            return fileSysForUser().create(convert(path), overwrite);
+            return fileSystemForUser().create(convert(path), overwrite);
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to create file [path=" + path + ", overwrite=" + overwrite + "]");
@@ -380,8 +390,8 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
             new HadoopIgfsProperties(props != null ? props : Collections.<String, String>emptyMap());
 
         try {
-            return fileSysForUser().create(convert(path), props0.permission(), overwrite, bufSize,
-                (short)replication, blockSize, null);
+            return fileSystemForUser().create(convert(path), props0.permission(), overwrite, bufSize,
+                (short) replication, blockSize, null);
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to create file [path=" + path + ", props=" + props +
@@ -394,7 +404,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     @Override public OutputStream append(IgfsPath path, int bufSize, boolean create,
         @Nullable Map<String, String> props) {
         try {
-            return fileSysForUser().append(convert(path), bufSize);
+            return fileSystemForUser().append(convert(path), bufSize);
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to append file [path=" + path + ", bufSize=" + bufSize + "]");
@@ -404,7 +414,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     /** {@inheritDoc} */
     @Override public IgfsFile info(final IgfsPath path) {
         try {
-            final FileStatus status = fileSysForUser().getFileStatus(convert(path));
+            final FileStatus status = fileSystemForUser().getFileStatus(convert(path));
 
             if (status == null)
                 return null;
@@ -479,65 +489,61 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
         try {
             // We don't use FileSystem#getUsed() since it counts only the files
             // in the filesystem root, not all the files recursively.
-            return fileSysForUser().getContentSummary(new Path("/")).getSpaceConsumed();
+            return fileSystemForUser().getContentSummary(new Path("/")).getSpaceConsumed();
         }
         catch (IOException e) {
             throw handleSecondaryFsError(e, "Failed to get used space size of file system.");
         }
     }
 
-    /** {@inheritDoc} */
-    @Override public Map<String, String> properties() {
-        return props;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() throws IgniteException {
-        Exception e = null;
-
-        try {
-            dfltFs.close();
-        }
-        catch (Exception e0) {
-            e = e0;
-        }
-
-        try {
-            fileSysLazyMap.close();
-        }
-        catch (IgniteCheckedException ice) {
-            if (e == null)
-                e = ice;
-        }
-
-        if (e != null)
-            throw new IgniteException(e);
-    }
-
     /**
      * Gets the underlying {@link FileSystem}.
      * This method is used solely for testing.
      * @return the underlying Hadoop {@link FileSystem}.
      */
     public FileSystem fileSystem() {
-        return fileSysForUser();
+        return fileSystemForUser();
     }
 
     /**
      * Gets the FileSystem for the current context user.
      * @return the FileSystem instance, never null.
      */
-    private FileSystem fileSysForUser() {
+    private FileSystem fileSystemForUser() {
         String user = IgfsUserContext.currentUser();
 
         if (F.isEmpty(user))
-            user = dfltUserName; // default is never empty.
+            user = IgfsUtils.fixUserName(dfltUsrName);
 
         assert !F.isEmpty(user);
 
-        if (F.eq(user, dfltUserName))
-            return dfltFs; // optimization
+        try {
+            return fsFactory.get(user);
+        }
+        catch (IOException ioe) {
+            throw new IgniteException(ioe);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start() throws IgniteException {
+        dfltUsrName = IgfsUtils.fixUserName(dfltUsrName);
+
+        if (fsFactory == null)
+            fsFactory = new CachingHadoopFileSystemFactory();
+
+        if (fsFactory instanceof LifecycleAware)
+            ((LifecycleAware) fsFactory).start();
+    }
 
-        return fileSysLazyMap.getOrCreate(user);
+    /** {@inheritDoc} */
+    @Override public void stop() throws IgniteException {
+        if (fsFactory instanceof LifecycleAware)
+             ((LifecycleAware)fsFactory).stop();
+    }
+
+    /** {@inheritDoc} */
+    @Override public HadoopFileSystemFactory getPayload() {
+        return fsFactory;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8ed73b4a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
index 5dce67f..71f6435 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
@@ -17,19 +17,6 @@
 
 package org.apache.ignite.hadoop.fs.v1;
 
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.BlockLocation;
 import org.apache.hadoop.fs.ContentSummary;
@@ -43,7 +30,9 @@ import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.DFSUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Progressable;
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
 import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsFile;
@@ -51,7 +40,6 @@ import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.igfs.IgfsPathSummary;
 import org.apache.ignite.internal.igfs.common.IgfsLogger;
-import org.apache.ignite.internal.processors.hadoop.SecondaryFileSystemProvider;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsInputStream;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsOutputStream;
 import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsProxyInputStream;
@@ -68,8 +56,23 @@ import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lifecycle.LifecycleAware;
 import org.jetbrains.annotations.Nullable;
 
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import static org.apache.ignite.configuration.FileSystemConfiguration.DFLT_IGFS_LOG_BATCH_SIZE;
 import static org.apache.ignite.configuration.FileSystemConfiguration.DFLT_IGFS_LOG_DIR;
 import static org.apache.ignite.igfs.IgfsMode.PROXY;
@@ -85,8 +88,6 @@ import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_GROUP_NAME;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_PERMISSION;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_PREFER_LOCAL_WRITES;
 import static org.apache.ignite.internal.processors.igfs.IgfsEx.PROP_USER_NAME;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_CONFIG_PATH;
-import static org.apache.ignite.internal.processors.igfs.IgfsEx.SECONDARY_FS_URI;
 
 /**
  * {@code IGFS} Hadoop 1.x file system driver over file system API. To use
@@ -165,8 +166,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
     /** IGFS mode resolver. */
     private IgfsModeResolver modeRslvr;
 
-    /** Secondary file system instance. */
-    private FileSystem secondaryFs;
+    /** The secondary file system factory. */
+    private HadoopFileSystemFactory factory;
 
     /** Management connection flag. */
     private boolean mgmt;
@@ -327,21 +328,28 @@ public class IgniteHadoopFileSystem extends FileSystem {
             }
 
             if (initSecondary) {
-                Map<String, String> props = paths.properties();
+                try {
+                    factory = (HadoopFileSystemFactory) paths.getPayload(getClass().getClassLoader());
+                }
+                catch (IgniteCheckedException e) {
+                    throw new IOException("Failed to get secondary file system factory.", e);
+                }
+
+                assert factory != null;
 
-                String secUri = props.get(SECONDARY_FS_URI);
-                String secConfPath = props.get(SECONDARY_FS_CONFIG_PATH);
+                if (factory instanceof LifecycleAware)
+                    ((LifecycleAware) factory).start();
 
                 try {
-                    SecondaryFileSystemProvider secProvider = new SecondaryFileSystemProvider(secUri, secConfPath);
+                    FileSystem secFs = factory.get(user);
 
-                    secondaryFs = secProvider.createFileSystem(user);
+                    secondaryUri = secFs.getUri();
 
-                    secondaryUri = secProvider.uri();
+                    A.ensure(secondaryUri != null, "Secondary file system uri should not be null.");
                 }
                 catch (IOException e) {
                     if (!mgmt)
-                        throw new IOException("Failed to connect to the secondary file system: " + secUri, e);
+                        throw new IOException("Failed to connect to the secondary file system: " + secondaryUri, e);
                     else
                         LOG.warn("Visor failed to create secondary file system (operations on paths with PROXY mode " +
                             "will have no effect): " + e.getMessage());
@@ -409,8 +417,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
         if (clientLog.isLogEnabled())
             clientLog.close();
 
-        if (secondaryFs != null)
-            U.closeQuiet(secondaryFs);
+        if (factory instanceof LifecycleAware)
+            ((LifecycleAware) factory).stop();
 
         // Reset initialized resources.
         uri = null;
@@ -425,6 +433,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             A.notNull(p, "p");
 
             if (mode(p) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -453,6 +463,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             A.notNull(p, "p");
 
             if (mode(p) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -482,6 +494,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
 
         try {
             if (mode(p) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -490,8 +504,7 @@ public class IgniteHadoopFileSystem extends FileSystem {
                 }
 
                 secondaryFs.setOwner(toSecondary(p), username, grpName);
-            }
-            else if (rmtClient.update(convert(p), F.asMap(PROP_USER_NAME, username, PROP_GROUP_NAME, grpName)) == null)
+            } else if (rmtClient.update(convert(p), F.asMap(PROP_USER_NAME, username, PROP_GROUP_NAME, grpName)) == null)
                 throw new IOException("Failed to set file permission (file not found?)" +
                     " [path=" + p + ", userName=" + username + ", groupName=" + grpName + ']');
         }
@@ -511,6 +524,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsMode mode = mode(path);
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -583,6 +598,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
                     path + ", overwrite=" + overwrite + ", bufSize=" + bufSize + ']');
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -664,6 +681,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
                     ", path=" + path + ", bufSize=" + bufSize + ']');
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -727,6 +746,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsMode mode = mode(srcPath);
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -787,6 +808,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsMode mode = mode(path);
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -832,6 +855,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsMode mode = mode(path);
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -896,26 +921,35 @@ public class IgniteHadoopFileSystem extends FileSystem {
 
     /** {@inheritDoc} */
     @Override public void setWorkingDirectory(Path newPath) {
-        if (newPath == null) {
-            Path homeDir = getHomeDirectory();
+        try {
+            if (newPath == null) {
+                Path homeDir = getHomeDirectory();
 
-            if (secondaryFs != null)
-                secondaryFs.setWorkingDirectory(toSecondary(homeDir));
+                FileSystem secondaryFs  = secondaryFileSystem();
 
-            workingDir = homeDir;
-        }
-        else {
-            Path fixedNewPath = fixRelativePart(newPath);
+                if (secondaryFs != null)
+                    secondaryFs.setWorkingDirectory(toSecondary(homeDir));
+
+                workingDir = homeDir;
+            }
+            else {
+                Path fixedNewPath = fixRelativePart(newPath);
 
-            String res = fixedNewPath.toUri().getPath();
+                String res = fixedNewPath.toUri().getPath();
 
-            if (!DFSUtil.isValidName(res))
-                throw new IllegalArgumentException("Invalid DFS directory name " + res);
+                if (!DFSUtil.isValidName(res))
+                    throw new IllegalArgumentException("Invalid DFS directory name " + res);
 
-            if (secondaryFs != null)
-                secondaryFs.setWorkingDirectory(toSecondary(fixedNewPath));
+                FileSystem secondaryFs  = secondaryFileSystem();
 
-            workingDir = fixedNewPath;
+                if (secondaryFs != null)
+                    secondaryFs.setWorkingDirectory(toSecondary(fixedNewPath));
+
+                workingDir = fixedNewPath;
+            }
+        }
+        catch (IOException e) {
+            throw new RuntimeException("Failed to obtain secondary file system instance.", e);
         }
     }
 
@@ -936,6 +970,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsMode mode = mode(path);
 
             if (mode == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -977,6 +1013,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
 
         try {
             if (mode(f) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -1007,6 +1045,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
 
         try {
             if (mode(f) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -1038,6 +1078,8 @@ public class IgniteHadoopFileSystem extends FileSystem {
             IgfsPath path = convert(status.getPath());
 
             if (mode(status.getPath()) == PROXY) {
+                final FileSystem secondaryFs = secondaryFileSystem();
+
                 if (secondaryFs == null) {
                     assert mgmt;
 
@@ -1103,7 +1145,7 @@ public class IgniteHadoopFileSystem extends FileSystem {
      * @return {@code true} If secondary file system is initialized.
      */
     public boolean hasSecondaryFileSystem() {
-        return secondaryFs != null;
+        return factory != null;
     }
 
     /**
@@ -1123,7 +1165,7 @@ public class IgniteHadoopFileSystem extends FileSystem {
      * @return Secondary file system path.
      */
     private Path toSecondary(Path path) {
-        assert secondaryFs != null;
+        assert factory != null;
         assert secondaryUri != null;
 
         return convertPath(path, secondaryUri);
@@ -1298,4 +1340,16 @@ public class IgniteHadoopFileSystem extends FileSystem {
     public String user() {
         return user;
     }
+
+    /**
+     * Gets cached or creates a {@link FileSystem}.
+     *
+     * @return The secondary file system.
+     */
+    private @Nullable FileSystem secondaryFileSystem() throws IOException{
+        if (factory == null)
+            return null;
+
+        return factory.get(user);
+    }
 }
\ No newline at end of file


[10/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: 7049f52ee956a168b4dcb043a672a6a9eb04ce56
Parents: fad8b7a 18c413c
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Dec 25 17:10:35 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Dec 25 17:10:35 2015 +0300

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     |  25 +++-
 .../ignite/internal/binary/BinaryContext.java   |  44 +-----
 .../internal/binary/BinaryEnumObjectImpl.java   |   4 +-
 .../internal/binary/BinaryObjectImpl.java       |  27 ++--
 .../internal/binary/GridBinaryMarshaller.java   |  82 ++++++++++-
 .../connection/GridClientNioTcpConnection.java  |  17 +--
 .../processors/cache/GridCacheProcessor.java    |   3 +-
 .../binary/CacheObjectBinaryProcessorImpl.java  |   3 +
 .../dht/atomic/GridDhtAtomicCache.java          |  89 ++++++------
 .../GridDhtPartitionsExchangeFuture.java        |  20 ++-
 ...ridNearOptimisticTxPrepareFutureAdapter.java |  10 +-
 .../client/message/GridClientCacheBean.java     | 139 +++++++++++++++++++
 .../rest/client/message/GridClientNodeBean.java |  70 ++++++----
 .../top/GridTopologyCommandHandler.java         |  38 +++--
 .../util/nio/GridNioRecoveryDescriptor.java     |   7 -
 .../ignite/internal/util/nio/GridNioServer.java |   7 +
 .../communication/tcp/TcpCommunicationSpi.java  |  12 +-
 .../ignite/IgniteCacheAffinitySelfTest.java     |   7 -
 .../fair/FairAffinityDynamicCacheSelfTest.java  |  17 +--
 .../cache/CrossCacheTxRandomOperationsTest.java |   2 -
 ...yMetadataUpdateChangingTopologySelfTest.java |  97 ++++++++-----
 .../internal/util/nio/GridNioSelfTest.java      | 127 ++++++++++-------
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |  17 ++-
 .../TcpDiscoveryMulticastIpFinderSelfTest.java  |  21 ++-
 .../IgniteCacheRestartTestSuite2.java           |   3 +
 .../stream/mqtt/IgniteMqttStreamerTest.java     |  33 +++--
 .../GridUriDeploymentFileProcessorSelfTest.java |  19 ++-
 27 files changed, 617 insertions(+), 323 deletions(-)
----------------------------------------------------------------------



[02/50] [abbrv] ignite git commit: Merge branch 'ignite-1.5' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge branch 'ignite-1.5' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: b534c42711d289408bacc9824300d6ec5fcc0fe7
Parents: 524d72e 81458f5
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Dec 21 18:56:55 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Dec 21 18:56:55 2015 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryObjectImpl.java       |  20 +-
 .../processors/cache/IgniteCacheProxy.java      |   5 +-
 .../cache/query/GridCacheQueryManager.java      |   8 +-
 .../processors/query/GridQueryProcessor.java    |  10 +-
 .../IgniteCacheBinaryObjectsScanSelfTest.java   | 137 +++++++++
 .../cache/IgniteCacheAbstractQuerySelfTest.java | 300 +++++++++++++------
 .../IgniteCacheReplicatedQuerySelfTest.java     |  10 +-
 .../local/IgniteCacheLocalQuerySelfTest.java    |   2 +-
 .../IgniteBinaryCacheQueryTestSuite.java        |   2 +
 .../Apache.Ignite.Core/Binary/Package-Info.cs   |   2 +-
 .../Apache.Ignite.Core/Cache/Package-Info.cs    |   2 +-
 .../Cache/Query/Continuous/Package-Info.cs      |   2 +-
 .../Cache/Query/Package-Info.cs                 |   2 +-
 .../Cache/Store/Package-Info.cs                 |   2 +-
 .../Apache.Ignite.Core/Cluster/Package-Info.cs  |   2 +-
 .../Apache.Ignite.Core/Compute/Package-Info.cs  |   2 +-
 .../Datastream/Package-Info.cs                  |   2 +-
 .../Apache.Ignite.Core/Events/Package-Info.cs   |   2 +-
 .../Lifecycle/Package-Info.cs                   |   2 +-
 .../Messaging/Package-Info.cs                   |   2 +-
 .../dotnet/Apache.Ignite.Core/Package-Info.cs   |   2 +-
 .../Apache.Ignite.Core/Resource/Package-Info.cs |   2 +-
 .../Apache.Ignite.Core/Services/Package-Info.cs |   2 +-
 .../Transactions/Package-Info.cs                |   2 +-
 24 files changed, 394 insertions(+), 130 deletions(-)
----------------------------------------------------------------------



[11/50] [abbrv] ignite git commit: ignite-1.5 Added node attributes in AuthenticationContext.

Posted by vo...@apache.org.
ignite-1.5 Added node attributes in AuthenticationContext.


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

Branch: refs/heads/ignite-2234
Commit: 939a170d9d27822b0ed19b019ecf8c76142c544d
Parents: 18c413c
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 28 12:10:53 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 28 12:10:53 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  7 +++--
 .../ignite/internal/IgniteNodeAttributes.java   |  3 ++
 .../processors/rest/GridRestProcessor.java      |  4 +++
 .../rest/client/message/GridClientNodeBean.java |  4 +--
 .../plugin/security/AuthenticationContext.java  | 33 +++++++++++++++++---
 5 files changed, 42 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/939a170d/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 6e0be10..14b5816 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -788,7 +788,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
 
             startProcessor(new ClusterProcessor(ctx));
 
-            fillNodeAttributes();
+            fillNodeAttributes(notifyEnabled);
 
             U.onGridStart();
 
@@ -1201,10 +1201,11 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
     /**
      * Creates attributes map and fills it in.
      *
+     * @param notifyEnabled Update notifier flag.
      * @throws IgniteCheckedException thrown if was unable to set up attribute.
      */
     @SuppressWarnings({"SuspiciousMethodCalls", "unchecked", "TypeMayBeWeakened"})
-    private void fillNodeAttributes() throws IgniteCheckedException {
+    private void fillNodeAttributes(boolean notifyEnabled) throws IgniteCheckedException {
         final String[] incProps = cfg.getIncludeProperties();
 
         try {
@@ -1242,6 +1243,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
                 }
             }
 
+            ctx.addNodeAttribute(IgniteNodeAttributes.ATTR_UPDATE_NOTIFIER_ENABLED, notifyEnabled);
+
             if (log.isDebugEnabled())
                 log.debug("Added system properties to node attributes.");
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/939a170d/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
index ba04403..3c5f960 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
@@ -144,6 +144,9 @@ public final class IgniteNodeAttributes {
     /** Binary protocol version. */
     public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver";
 
+    /** Update notifier enabled. */
+    public static final String ATTR_UPDATE_NOTIFIER_ENABLED = ATTR_PREFIX + ".update.notifier.enabled";
+
     /**
      * Enforces singleton.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/939a170d/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index 4bb02c4..e839443 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.List;
@@ -656,6 +657,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
 
         authCtx.subjectType(REMOTE_CLIENT);
         authCtx.subjectId(req.clientId());
+        authCtx.nodeAttributes(Collections.<String, Object>emptyMap());
 
         SecurityCredentials cred;
 
@@ -884,11 +886,13 @@ public class GridRestProcessor extends GridProcessorAdapter {
 
         /** Session token id. */
         private final UUID sesId;
+
         /**
          * Time when session is used last time.
          * If this time was set at TIMEDOUT_FLAG, then it should never be changed.
          */
         private final AtomicLong lastTouchTime = new AtomicLong(U.currentTimeMillis());
+
         /** Security context. */
         private volatile SecurityContext secCtx;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/939a170d/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
index 8ba6eb5..ca82608 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
@@ -233,8 +233,8 @@ public class GridClientNodeBean implements Externalizable {
             for (GridClientCacheBean cacheBean : caches) {
                 if (cacheBean.getName() == null)
                     dfltCacheMode = cacheBean.getMode().toString();
-                else
-                    cacheMap.put(cacheBean.getName(), cacheBean.getMode().toString());
+
+                cacheMap.put(cacheBean.getName(), cacheBean.getMode().toString());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/939a170d/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
index 16e282d..91f3379 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.plugin.security;
 
 import java.net.InetSocketAddress;
+import java.util.Collections;
+import java.util.Map;
 import java.util.UUID;
 
 /**
@@ -31,11 +33,14 @@ public class AuthenticationContext {
     private UUID subjId;
 
     /** Credentials. */
-    private SecurityCredentials credentials;
+    private SecurityCredentials creds;
 
     /** Subject address. */
     private InetSocketAddress addr;
 
+    /** */
+    private Map<String, Object> nodeAttrs;
+
     /**
      * Gets subject type.
      *
@@ -78,16 +83,16 @@ public class AuthenticationContext {
      * @return Security credentials.
      */
     public SecurityCredentials credentials() {
-        return credentials;
+        return creds;
     }
 
     /**
      * Sets security credentials.
      *
-     * @param credentials Security credentials.
+     * @param creds Security credentials.
      */
-    public void credentials(SecurityCredentials credentials) {
-        this.credentials = credentials;
+    public void credentials(SecurityCredentials creds) {
+        this.creds = creds;
     }
 
     /**
@@ -107,4 +112,22 @@ public class AuthenticationContext {
     public void address(InetSocketAddress addr) {
         this.addr = addr;
     }
+
+    /**
+     * Gets node attributes.
+     *
+     * @return Node attributes or empty map for {@link SecuritySubjectType#REMOTE_CLIENT}.
+     */
+    public Map<String, Object> nodeAttributes() {
+        return nodeAttrs != null ? nodeAttrs : Collections.<String, Object>emptyMap();
+    }
+
+    /**
+     * Sets node attributes.
+     *
+     * @param nodeAttrs Node attributes.
+     */
+    public void nodeAttributes(Map<String, Object> nodeAttrs) {
+        this.nodeAttrs = nodeAttrs;
+    }
 }
\ No newline at end of file


[23/50] [abbrv] ignite git commit: RAT fix

Posted by vo...@apache.org.
RAT fix


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

Branch: refs/heads/ignite-2234
Commit: f97dc9fe399792ff81fc936a47704c6d62656bd8
Parents: 156e787
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 17:15:59 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 17:15:59 2015 +0300

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f97dc9fe/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index b7b417b..4497d01 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -826,7 +826,7 @@
                                         <exclude>**/keystore/*.pfx</exclude><!--bin-files-->
                                         <!--special excludes-->
                                         <exclude>idea/ignite_codeStyle.xml</exclude>
-                                        <exclude>DEVNOTES.txt</exclude>
+                                        <exclude>**/DEVNOTES.txt</exclude>
                                         <exclude>**/NOTICE*</exclude>
                                         <exclude>**/LICENSE*</exclude>
                                         <exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->


[35/50] [abbrv] ignite git commit: IGNITE-2228: .NET: Compute futures could be cancelled.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/PlatformTarget.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/PlatformTarget.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/PlatformTarget.cs
index 4a4f93b..0472ce4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/PlatformTarget.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/PlatformTarget.cs
@@ -22,6 +22,7 @@ namespace Apache.Ignite.Core.Impl
     using System.Diagnostics;
     using System.Diagnostics.CodeAnalysis;
     using System.IO;
+    using System.Threading;
     using System.Threading.Tasks;
     using Apache.Ignite.Core.Impl.Binary;
     using Apache.Ignite.Core.Impl.Binary.IO;
@@ -289,6 +290,26 @@ namespace Apache.Ignite.Core.Impl
         }
 
         /// <summary>
+        /// Perform out operation.
+        /// </summary>
+        /// <param name="type">Operation type.</param>
+        /// <param name="action">Action to be performed on the stream.</param>
+        /// <returns></returns>
+        protected IUnmanagedTarget DoOutOpObject(int type, Action<BinaryWriter> action)
+        {
+            using (var stream = IgniteManager.Memory.Allocate().GetStream())
+            {
+                var writer = _marsh.StartMarshal(stream);
+
+                action(writer);
+
+                FinishMarshal(writer);
+
+                return UU.TargetInStreamOutObject(_target, type, stream.SynchronizeOutput());
+            }
+        }
+
+        /// <summary>
         /// Perform simple output operation accepting single argument.
         /// </summary>
         /// <param name="type">Operation type.</param>
@@ -633,6 +654,37 @@ namespace Apache.Ignite.Core.Impl
         /// <param name="keepBinary">Keep binary flag, only applicable to object futures. False by default.</param>
         /// <param name="convertFunc">The function to read future result from stream.</param>
         /// <returns>Created future.</returns>
+        protected Future<T> GetFuture<T>(Func<long, int, IUnmanagedTarget> listenAction, bool keepBinary = false,
+            Func<BinaryReader, T> convertFunc = null)
+        {
+            var futType = FutureType.Object;
+
+            var type = typeof(T);
+
+            if (type.IsPrimitive)
+                IgniteFutureTypeMap.TryGetValue(type, out futType);
+
+            var fut = convertFunc == null && futType != FutureType.Object
+                ? new Future<T>()
+                : new Future<T>(new FutureConverter<T>(_marsh, keepBinary, convertFunc));
+
+            var futHnd = _marsh.Ignite.HandleRegistry.Allocate(fut);
+
+            var futTarget = listenAction(futHnd, (int) futType);
+
+            fut.SetTarget(futTarget);
+
+            return fut;
+        }
+
+        /// <summary>
+        /// Creates a future and starts listening.
+        /// </summary>
+        /// <typeparam name="T">Future result type</typeparam>
+        /// <param name="listenAction">The listen action.</param>
+        /// <param name="keepBinary">Keep binary flag, only applicable to object futures. False by default.</param>
+        /// <param name="convertFunc">The function to read future result from stream.</param>
+        /// <returns>Created future.</returns>
         protected Future<T> GetFuture<T>(Action<long, int> listenAction, bool keepBinary = false,
             Func<BinaryReader, T> convertFunc = null)
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
index 860e703..5e54a4c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/IgniteJniNativeMethods.cs
@@ -113,6 +113,12 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteTargetListenFutureForOperation")]
         public static extern void TargetListenFutForOp(void* ctx, void* target, long futId, int typ, int opId);
 
+        [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteTargetListenFutureAndGet")]
+        public static extern void* TargetListenFutAndGet(void* ctx, void* target, long futId, int typ);
+
+        [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteTargetListenFutureForOperationAndGet")]
+        public static extern void* TargetListenFutForOpAndGet(void* ctx, void* target, long futId, int typ, int opId);
+
         [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteAffinityPartitions")]
         public static extern int AffinityParts(void* ctx, void* target);
 
@@ -178,7 +184,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
         public static extern void ComputeWithTimeout(void* ctx, void* target, long timeout);
 
         [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteComputeExecuteNative")]
-        public static extern void ComputeExecuteNative(void* ctx, void* target, long taskPtr, long topVer);
+        public static extern void* ComputeExecuteNative(void* ctx, void* target, long taskPtr, long topVer);
 
         [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteContinuousQueryClose")]
         public static extern void ContinuousQryClose(void* ctx, void* target);
@@ -354,5 +360,13 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteAtomicLongClose")]
         public static extern void AtomicLongClose(void* ctx, void* target);
+
+        [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteListenableCancel")]
+        [return: MarshalAs(UnmanagedType.U1)]
+        public static extern bool ListenableCancel(void* ctx, void* target);
+
+        [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteListenableIsCancelled")]
+        [return: MarshalAs(UnmanagedType.U1)]
+        public static extern bool ListenableIsCancelled(void* ctx, void* target);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
index 56a184d..4c8f1dc 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -305,6 +305,21 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             JNI.TargetListenFutForOp(target.Context, target.Target, futId, typ, opId);
         }
 
+        internal static IUnmanagedTarget TargetListenFutureAndGet(IUnmanagedTarget target, long futId, int typ)
+        {
+            var res = JNI.TargetListenFutAndGet(target.Context, target.Target, futId, typ);
+
+            return target.ChangeTarget(res);
+        }
+
+        internal static IUnmanagedTarget TargetListenFutureForOperationAndGet(IUnmanagedTarget target, long futId,
+            int typ, int opId)
+        {
+            var res = JNI.TargetListenFutForOpAndGet(target.Context, target.Target, futId, typ, opId);
+
+            return target.ChangeTarget(res);
+        }
+
         #endregion
 
         #region NATIVE METHODS: AFFINITY
@@ -440,9 +455,11 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             JNI.ComputeWithTimeout(target.Context, target.Target, timeout);
         }
 
-        internal static void ComputeExecuteNative(IUnmanagedTarget target, long taskPtr, long topVer)
+        internal static IUnmanagedTarget ComputeExecuteNative(IUnmanagedTarget target, long taskPtr, long topVer)
         {
-            JNI.ComputeExecuteNative(target.Context, target.Target, taskPtr, topVer);
+            void* res = JNI.ComputeExecuteNative(target.Context, target.Target, taskPtr, topVer);
+
+            return target.ChangeTarget(res);
         }
 
         #endregion
@@ -816,6 +833,16 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             JNI.AtomicLongClose(target.Context, target.Target);
         }
 
+        internal static bool ListenableCancel(IUnmanagedTarget target)
+        {
+            return JNI.ListenableCancel(target.Context, target.Target);
+        }
+
+        internal static bool ListenableIsCancelled(IUnmanagedTarget target)
+        {
+            return JNI.ListenableIsCancelled(target.Context, target.Target);
+        }
+
         #endregion
     }
 }


[40/50] [abbrv] ignite git commit: IGNITE-2330: Simplified GridFunc.

Posted by vo...@apache.org.
IGNITE-2330: Simplified GridFunc.


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

Branch: refs/heads/ignite-2234
Commit: 80579253febd6389dbb3a84706671cc8083df1f2
Parents: dffcb83
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jan 3 01:15:24 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jan 3 01:15:24 2016 +0400

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |   27 +-
 .../internal/cluster/ClusterGroupAdapter.java   |   10 +-
 .../discovery/GridDiscoveryManager.java         |   19 +-
 .../loadbalancer/GridLoadBalancerManager.java   |    8 +-
 .../processors/cache/GridCacheAdapter.java      |   14 +-
 .../processors/cache/GridCacheContext.java      |    3 +-
 .../cache/GridCacheEvictionManager.java         |    5 +-
 .../processors/cache/GridCacheIoManager.java    |    5 +-
 .../processors/cache/GridCacheIterator.java     |    4 +-
 .../processors/cache/GridCacheKeySet.java       |    2 +-
 .../GridCachePartitionExchangeManager.java      |   12 +-
 .../processors/cache/GridCacheProcessor.java    |    9 +-
 .../processors/cache/GridCacheSwapManager.java  |    7 +-
 .../processors/cache/GridCacheUtils.java        |   92 +
 .../cache/GridCacheValueCollection.java         |    5 +-
 .../processors/cache/IgniteCacheProxy.java      |    4 +-
 .../dht/GridClientPartitionTopology.java        |    3 +-
 .../dht/GridDhtPartitionTopologyImpl.java       |    3 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |    3 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |    3 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |    5 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   21 +-
 .../dht/preloader/GridDhtForceKeysFuture.java   |    8 +-
 .../distributed/near/GridNearCacheAdapter.java  |   11 +-
 .../local/atomic/GridLocalAtomicCache.java      |   17 +-
 .../GridCacheAtomicStampedImpl.java             |    5 +-
 .../internal/processors/igfs/IgfsProcessor.java |    8 +-
 .../dotnet/PlatformDotNetCacheStore.java        |    4 +-
 .../top/GridTopologyCommandHandler.java         |    3 +-
 .../org/apache/ignite/internal/util/F0.java     |  325 +---
 .../internal/util/GridExecutionStatistics.java  |    4 +-
 .../ignite/internal/util/IgniteUtils.java       |    4 +-
 .../ignite/internal/util/lang/GridFunc.java     | 1776 ++++--------------
 .../ignite/internal/util/lang/GridTuple3.java   |    1 -
 .../ignite/internal/util/lang/GridTuple4.java   |    1 -
 .../ignite/internal/util/lang/GridTuple5.java   |    1 -
 .../ignite/internal/util/lang/GridTuple6.java   |    1 -
 .../ignite/internal/util/lang/GridTupleV.java   |    1 -
 .../java/org/apache/ignite/lang/IgniteUuid.java |    2 +-
 .../memory/MemoryEventStorageSpi.java           |    1 +
 .../cache/GridCacheLuceneQueryIndexTest.java    |    4 +-
 .../distributed/GridCacheEventAbstractTest.java |    2 +-
 .../IpcSharedMemoryCrashDetectionSelfTest.java  |   16 +-
 .../ignite/lang/GridBasicPerformanceTest.java   |   10 +-
 .../ignite/lang/GridFuncPerformanceTest.java    |  102 -
 .../ignite/loadtest/GridLoadTestStatistics.java |    2 +-
 .../query/h2/opt/GridH2TreeIndex.java           |    4 +-
 47 files changed, 583 insertions(+), 1994 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 14b5816..7fc0313 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -589,8 +589,16 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
     @Override public List<String> getLifecycleBeansFormatted() {
         LifecycleBean[] beans = cfg.getLifecycleBeans();
 
-        return F.isEmpty(beans) ? Collections.<String>emptyList() :
-            (List<String>)F.transform(beans, F.<LifecycleBean>string());
+        if (F.isEmpty(beans))
+            return Collections.emptyList();
+        else {
+            List<String> res = new ArrayList<>(beans.length);
+
+            for (LifecycleBean bean : beans)
+                res.add(String.valueOf(bean));
+
+            return res;
+        }
     }
 
     /**
@@ -2269,16 +2277,19 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         Collection<Object> objs = new ArrayList<>();
 
         if (!F.isEmpty(cfg.getLifecycleBeans()))
-            F.copy(objs, cfg.getLifecycleBeans());
+            Collections.addAll(objs, cfg.getLifecycleBeans());
 
         if (!F.isEmpty(cfg.getSegmentationResolvers()))
-            F.copy(objs, cfg.getSegmentationResolvers());
+            Collections.addAll(objs, cfg.getSegmentationResolvers());
 
-        if (cfg.getConnectorConfiguration() != null)
-            F.copy(objs, cfg.getConnectorConfiguration().getMessageInterceptor(),
-                cfg.getConnectorConfiguration().getSslContextFactory());
+        if (cfg.getConnectorConfiguration() != null) {
+            objs.add(cfg.getConnectorConfiguration().getMessageInterceptor());
+            objs.add(cfg.getConnectorConfiguration().getSslContextFactory());
+        }
 
-        F.copy(objs, cfg.getMarshaller(), cfg.getGridLogger(), cfg.getMBeanServer());
+        objs.add(cfg.getMarshaller());
+        objs.add(cfg.getGridLogger());
+        objs.add(cfg.getMBeanServer());
 
         return objs;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index 75168a1..a153b83 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -51,6 +51,7 @@ import org.apache.ignite.internal.IgniteServicesImpl;
 import org.apache.ignite.internal.IgnitionEx;
 import org.apache.ignite.internal.executor.GridExecutorService;
 import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
+import org.apache.ignite.internal.util.lang.GridNodePredicate;
 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;
@@ -367,8 +368,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
         guard();
 
         try {
-            if (p != null)
-                ctx.resource().injectGeneric(p);
+            ctx.resource().injectGeneric(p);
 
             return new ClusterGroupAdapter(ctx, subjId, this.p != null ? F.and(p, this.p) : p);
         }
@@ -703,6 +703,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         gridName = U.readString(in);
         subjId = U.readUuid(in);
@@ -919,7 +920,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
 
                 ClusterNode node = isOldest ? U.oldest(super.nodes(), null) : U.youngest(super.nodes(), null);
 
-                IgnitePredicate<ClusterNode> p = F.nodeForNodes(node);
+                IgnitePredicate<ClusterNode> p = new GridNodePredicate(node);
 
                 state = new AgeClusterGroupState(node, p, lastTopVer);
             }
@@ -961,8 +962,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
             guard();
 
             try {
-                if (p != null)
-                    ctx.resource().injectGeneric(p);
+                ctx.resource().injectGeneric(p);
 
                 return new ClusterGroupAdapter(ctx, this.subjId, new GroupPredicate(this, p));
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 72a2bef..844fd0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -30,7 +30,6 @@ import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -79,7 +78,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.jobmetrics.GridJobMetrics;
 import org.apache.ignite.internal.processors.security.SecurityContext;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridBoundedConcurrentOrderedMap;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -1317,13 +1315,26 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
     }
 
     /**
+     * Gets collection of node for given node IDs.
+     *
+     * @param ids Ids to include.
+     * @return Collection with all alive nodes for given IDs.
+     */
+    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids) {
+        return F.isEmpty(ids) ? Collections.<ClusterNode>emptyList() :
+            F.view(
+                F.viewReadOnly(ids, U.id2Node(ctx)),
+                F.notNull());
+    }
+
+    /**
      * Gets collection of node for given node IDs and predicates.
      *
      * @param ids Ids to include.
      * @param p Filter for IDs.
      * @return Collection with all alive nodes for given IDs.
      */
-    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids, IgnitePredicate<UUID>... p) {
+    public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids, IgnitePredicate<UUID> p) {
         return F.isEmpty(ids) ? Collections.<ClusterNode>emptyList() :
             F.view(
                 F.viewReadOnly(ids, U.id2Node(ctx), p),
@@ -2565,7 +2576,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
             nearEnabledCaches = Collections.unmodifiableSet(nearEnabledSet);
 
             daemonNodes = Collections.unmodifiableList(new ArrayList<>(
-                F.view(F.concat(false, loc, rmts), F0.not(daemonFilter))));
+                F.view(F.concat(false, loc, rmts), F.not(daemonFilter))));
 
             Map<UUID, ClusterNode> nodeMap = new HashMap<>(allNodes().size() + daemonNodes.size(), 1.0f);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
index 631168b..efe09b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/loadbalancer/GridLoadBalancerManager.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.managers.loadbalancer;
 
 import java.util.Collection;
+import java.util.LinkedList;
 import java.util.List;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -92,7 +93,12 @@ public class GridLoadBalancerManager extends GridManagerAdapter<LoadBalancingSpi
                 if (F.isEmpty(exclNodes))
                     return GridLoadBalancerManager.this.getBalancedNode(ses, top, job);
 
-                List<ClusterNode> nodes = F.loseList(top, true, exclNodes);
+                List<ClusterNode> nodes = new LinkedList<>();
+
+                for (ClusterNode topNode : top) {
+                    if (!exclNodes.contains(topNode))
+                        nodes.add(topNode);
+                }
 
                 if (nodes.isEmpty())
                     return null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 5d4c386..a4cf737 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -106,7 +106,6 @@ import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.GridClosureException;
 import org.apache.ignite.internal.util.lang.GridTriple;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
-import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.C2;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.CI2;
@@ -2150,12 +2149,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size() == 1) {
             @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx)
                 throws IgniteCheckedException {
-                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys,
-                    new C1<K, EntryProcessor<K, V, Object>>() {
-                            @Override public EntryProcessor apply(K k) {
-                            return entryProcessor;
-                        }
-                    });
+                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
 
                 IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap, args);
 
@@ -2222,11 +2216,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp(keys) {
             @Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) {
-                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor<K, V, Object>>() {
-                    @Override public EntryProcessor apply(K k) {
-                        return entryProcessor;
-                    }
-                });
+                Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
 
                 return tx.invokeAsync(ctx, invokeMap, args);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index c10ebf3..ef49567 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -85,7 +85,6 @@ import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
 import org.apache.ignite.internal.processors.offheap.GridOffHeapProcessor;
 import org.apache.ignite.internal.processors.plugin.CachePluginManager;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.lang.GridFunc;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -1512,7 +1511,7 @@ public class GridCacheContext<K, V> implements Externalizable {
             Collection<ClusterNode> nearNodes = null;
 
             if (!F.isEmpty(readers)) {
-                nearNodes = discovery().nodes(readers, F0.notEqualTo(nearNodeId));
+                nearNodes = discovery().nodes(readers, F.notEqualTo(nearNodeId));
 
                 if (log.isDebugEnabled())
                     log.debug("Mapping entry to near nodes [nodes=" + U.nodeIds(nearNodes) + ", entry=" + entry + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 845e204..f542f4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -63,7 +63,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridBusyLock;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridUnsafe;
@@ -1310,7 +1309,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
                 try {
                     GridCacheVersion ver = e.version();
 
-                    return info.version().equals(ver) && F.isAll(info.filter());
+                    return info.version().equals(ver) && F.isAll(e, info.filter());
                 }
                 catch (GridCacheEntryRemovedException ignored) {
                     return false;
@@ -1341,7 +1340,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
         Collection<ClusterNode> backups;
 
         if (evictSync)
-            backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F0.notEqualTo(cctx.localNode()));
+            backups = F.view(cctx.dht().topology().nodes(entry.partition(), topVer), F.notEqualTo(cctx.localNode()));
         else
             backups = Collections.emptySet();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 0aa8b1b..4c9cdf2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -57,7 +57,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPr
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryRequest;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryResponse;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.GridSpinReadWriteLock;
 import org.apache.ignite.internal.util.typedef.CI1;
@@ -731,7 +730,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 }
 
                 if (added) {
-                    if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
+                    if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
                         if (log.isDebugEnabled())
                             log.debug("Message will not be sent because all nodes left topology [msg=" + msg +
                                 ", nodes=" + U.toShortString(nodes) + ']');
@@ -767,7 +766,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     U.sleep(retryDelay);
                 }
 
-                if (!F.exist(F.nodeIds(nodes), F0.not(F.contains(leftIds)))) {
+                if (!F.exist(F.nodeIds(nodes), F.not(F.contains(leftIds)))) {
                     if (log.isDebugEnabled())
                         log.debug("Message will not be sent because all nodes left topology [msg=" + msg + ", nodes=" +
                             U.toShortString(nodes) + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
index 19da4a8..e4a471c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIterator.java
@@ -19,6 +19,8 @@ package org.apache.ignite.internal.processors.cache;
 
 import java.util.Iterator;
 import javax.cache.Cache;
+
+import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridSerializableIterator;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteClosure;
@@ -57,7 +59,7 @@ public class GridCacheIterator<K, V, T> implements GridSerializableIterator<T> {
     ) {
         this.cctx = cctx;
 
-        it = F.iterator0(c, false, filter);
+        it = F.identityIterator(c, F0.and(filter));
 
         this.trans = trans;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
index 6d18b7d..af0c704 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheKeySet.java
@@ -66,7 +66,7 @@ public class GridCacheKeySet<K, V> extends GridSerializableSet<K> {
 
     /** {@inheritDoc} */
     @Override public Iterator<K> iterator() {
-        return new GridCacheIterator<>(ctx, map.values(), F.<K, V>cacheEntry2Key(), filter);
+        return new GridCacheIterator<>(ctx, map.values(), CU.<K, V>cacheEntry2Key(), filter);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index a0f7f93..4732597 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -80,6 +80,7 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiInClosure;
+import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.thread.IgniteThread;
@@ -1270,9 +1271,16 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                     }
 
                     // After workers line up and before preloading starts we initialize all futures.
-                    if (log.isDebugEnabled())
+                    if (log.isDebugEnabled()) {
+                        IgnitePredicate p = new IgnitePredicate<IgniteInternalFuture<?>>() {
+                            @Override public boolean apply(IgniteInternalFuture<?> f) {
+                                return !f.isDone();
+                            }
+                        };
+
                         log.debug("Before waiting for exchange futures [futs" +
-                            F.view(exchFuts.values(), F.unfinishedFutures()) + ", worker=" + this + ']');
+                            F.view(exchFuts.values(), p) + ", worker=" + this + ']');
+                    }
 
                     // Take next exchange future.
                     exchFut = poll(futQ, timeout, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index ff02e70..f6fc9d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -96,7 +96,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
 import org.apache.ignite.internal.processors.plugin.CachePluginManager;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1160,8 +1159,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 log.debug("Executed onKernalStart() callback for DHT cache: " + dht.name());
         }
 
-        for (GridCacheManager mgr : F.view(ctx.managers(), F0.notContains(dhtExcludes(ctx))))
-            mgr.onKernalStart();
+        Collection<GridCacheManager> excluded = dhtExcludes(ctx);
+
+        for (GridCacheManager mgr : ctx.managers()) {
+            if (!excluded.contains(mgr))
+                mgr.onKernalStart();
+        }
 
         cache.onKernalStart();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 37b5e15..4490f63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -42,7 +42,6 @@ import org.apache.ignite.internal.processors.offheap.GridOffHeapProcessor;
 import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyCloseableIterator;
-import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.GridWeakIterator;
 import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.lang.GridTuple;
@@ -1581,7 +1580,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
      */
     public <K, V> Iterator<Map.Entry<K, V>> lazySwapIterator() throws IgniteCheckedException {
         if (!swapEnabled)
-            return new GridEmptyIterator<>();
+            return F.emptyIterator();
 
         return lazyIterator(cctx.gridSwap().rawIterator(spaceName));
     }
@@ -1672,7 +1671,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
     private <K, V> Iterator<Map.Entry<K, V>> lazyIterator(
         final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it) {
         if (it == null)
-            return new GridEmptyIterator<>();
+            return F.emptyIterator();
 
         checkIteratorQueue();
 
@@ -1743,7 +1742,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
     private Iterator<KeyCacheObject> keyIterator(
         final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it) {
         if (it == null)
-            return new GridEmptyIterator<>();
+            return F.emptyIterator();
 
         checkIteratorQueue();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 51f6dcd..b7baf7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -43,6 +43,8 @@ import javax.cache.configuration.Factory;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.integration.CacheWriterException;
+import javax.cache.processor.EntryProcessor;
+
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
@@ -284,6 +286,41 @@ public class GridCacheUtils {
         }
     };
 
+    /** */
+    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
+        @Override public Object apply(Object o) {
+            return ((Cache.Entry)o).getKey();
+        }
+
+        @Override public String toString() {
+            return "Map entry to key transformer closure.";
+        }
+    };
+
+    /** */
+    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
+        @SuppressWarnings({"unchecked"})
+        @Nullable @Override public Object apply(Object o) {
+            return ((Cache.Entry)o).getValue();
+        }
+
+        @Override public String toString() {
+            return "Cache entry to get-value transformer closure.";
+        }
+    };
+
+    /** */
+    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;
+        }
+
+        @Override public String toString() {
+            return "Cache entry has-peek-value predicate.";
+        }
+    };
+
     /**
      * Ensure singleton.
      */
@@ -1863,4 +1900,59 @@ public class GridCacheUtils {
 
         return res;
     }
+
+    /**
+     * Create invoke map for the given key set. All provided values will be set to the passed entry processor.
+     *
+     * @param keys Keys.
+     * @param entryProc Entry processor.
+     * @return Invoke map.
+     */
+    @SuppressWarnings("unchecked")
+    public static <K, V, T> Map<? extends K, EntryProcessor<K, V, Object>> invokeMap(
+        final Set<? extends K> keys, final EntryProcessor<K, V, T> entryProc) {
+        return F.viewAsMap(keys,
+            new C1<K, EntryProcessor<K, V, Object>>() {
+                @Override public EntryProcessor apply(K k) {
+                    return entryProc;
+                }
+            });
+    }
+
+    /**
+     * 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.
+     *
+     * @param <K> Key type.
+     * @param <V> Value type.
+     * @return Closure that returns value for an entry.
+     */
+    @SuppressWarnings({"unchecked"})
+    public static <K, V> IgniteClosure<Cache.Entry<K, V>, V> cacheEntry2Get() {
+        return (IgniteClosure<Cache.Entry<K, V>, V>)CACHE_ENTRY_VAL_GET;
+    }
+
+    /**
+     * Gets predicate which returns {@code true} if entry has peek value.
+     *
+     * @param <K> Cache key type.
+     * @param <V> Cache value type.
+     * @return Predicate which returns {@code true} if entry has peek value.
+     */
+    @SuppressWarnings({"unchecked"})
+    public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheHasPeekValue() {
+        return (IgnitePredicate<Cache.Entry<K, V>>)CACHE_ENTRY_HAS_PEEK_VAL;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
index 2d1686e..68b54b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheValueCollection.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridSerializableCollection;
 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.CU;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.jetbrains.annotations.Nullable;
 
@@ -72,8 +73,8 @@ public class GridCacheValueCollection<K, V> extends GridSerializableCollection<V
         return new GridCacheIterator<K, V, V>(
             ctx,
             map.values(),
-            F.<K, V>cacheEntry2Get(),
-            ctx.vararg(F0.and(filter, F.<K, V>cacheHasPeekValue()))
+            CU.<K, V>cacheEntry2Get(),
+            ctx.vararg(F0.and(filter, CU.<K, V>cacheHasPeekValue()))
         ) {
             {
                 advance();

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 27a7587..a6e0ea8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -69,7 +69,6 @@ import org.apache.ignite.internal.processors.cache.query.CacheQuery;
 import org.apache.ignite.internal.processors.cache.query.CacheQueryFuture;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
-import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.lang.GridClosureException;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;
@@ -77,6 +76,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.CX1;
+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.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -579,7 +579,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
 
             return new QueryCursor<Cache.Entry<K, V>>() {
                 @Override public Iterator<Cache.Entry<K, V>> iterator() {
-                    return cur != null ? cur.iterator() : new GridEmptyIterator<Cache.Entry<K, V>>();
+                    return cur != null ? cur.iterator() : F.<Cache.Entry<K, V>>emptyIterator();
                 }
 
                 @Override public List<Cache.Entry<K, V>> getAll() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
index 8aef5ad..9c18ad0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
@@ -37,7 +37,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -698,7 +697,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
 
             // Remove obsolete mappings.
             if (cur != null) {
-                for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
+                for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
                     Set<UUID> ids = part2node.get(p);
 
                     if (ids != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index a0709c5..cdf0fc2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -41,7 +41,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap2;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -1055,7 +1054,7 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
 
             // Remove obsolete mappings.
             if (cur != null) {
-                for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
+                for (Integer p : F.view(cur.keySet(), F.notIn(parts.keySet()))) {
                     Set<UUID> ids = part2node.get(p);
 
                     if (ids != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index ae24ed1..2b40436 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.lang.GridClosureException;
@@ -1382,7 +1381,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
         Collection<ClusterNode> nearNodes = null;
 
         if (!F.isEmpty(readers)) {
-            nearNodes = ctx.discovery().nodes(readers, F0.not(F.idForNodeId(nodeId)));
+            nearNodes = ctx.discovery().nodes(readers, F.not(F.idForNodeId(nodeId)));
 
             if (log.isDebugEnabled())
                 log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) + ", entry=" + cached +

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 534a560..1fe3ae2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -42,7 +42,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
@@ -641,7 +640,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter {
             // Otherwise, during rollback we will not know whether locks need
             // to be rolled back.
             // Loose all skipped and previously locked (we cannot reenter locks here).
-            final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F0.notIn(skipped)) : keys;
+            final Collection<KeyCacheObject> passedKeys = skipped != null ? F.view(keys, F.notIn(skipped)) : keys;
 
             if (log.isDebugEnabled())
                 log.debug("Lock keys: " + passedKeys);

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 40399b4..47dafc8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.dr.GridDrType;
 import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
 import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -1287,14 +1286,14 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
 
                 if (!F.isEmpty(readers)) {
                     Collection<ClusterNode> nearNodes =
-                        cctx.discovery().nodes(readers, F0.not(F.idForNodeId(tx.nearNodeId())));
+                        cctx.discovery().nodes(readers, F.not(F.idForNodeId(tx.nearNodeId())));
 
                     if (log.isDebugEnabled())
                         log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) +
                             ", entry=" + entry + ']');
 
                     // Exclude DHT nodes.
-                    map(entry, F.view(nearNodes, F0.notIn(dhtNodes)), nearMap);
+                    map(entry, F.view(nearNodes, F.notIn(dhtNodes)), nearMap);
                 }
                 else if (log.isDebugEnabled())
                     log.debug("Entry has no near readers: " + entry);

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 393413e..e0b108b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -77,12 +77,10 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSing
 import org.apache.ignite.internal.processors.cache.dr.GridCacheDrExpirationInfo;
 import org.apache.ignite.internal.processors.cache.dr.GridCacheDrInfo;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionConflictContext;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -412,9 +410,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
-        A.notNull(key, "key");
+        A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F0.asMap(key, val),
+        return updateAllAsync0(F.asMap(key, val),
             null,
             null,
             null,
@@ -428,9 +426,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
-        A.notNull(key, "key");
+        A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F0.asMap(key, val),
+        return updateAllAsync0(F.asMap(key, val),
             null,
             null,
             null,
@@ -445,7 +443,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     @Override public V tryPutIfAbsent(K key, V val) throws IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
-        return (V)updateAllAsync0(F0.asMap(key, val),
+        return (V)updateAllAsync0(F.asMap(key, val),
             null,
             null,
             null,
@@ -795,18 +793,13 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync(Set<? extends K> keys,
-        final EntryProcessor<K, V, T> entryProcessor,
-        Object... args) {
+        EntryProcessor<K, V, T> entryProcessor, Object... args) {
         A.notNull(keys, "keys", entryProcessor, "entryProcessor");
 
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
-            @Override public EntryProcessor apply(K k) {
-                return entryProcessor;
-            }
-        });
+        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
index 7970a44..6b03131 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java
@@ -43,7 +43,6 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridLeanSet;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -521,8 +520,11 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec
             if (!cctx.rebalanceEnabled()) {
                 Collection<KeyCacheObject> retryKeys = F.view(
                     keys,
-                    F0.notIn(missedKeys),
-                    F0.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key())));
+                    F.and(
+                        F.notIn(missedKeys),
+                        F.notIn(F.viewReadOnly(res.forcedInfos(), CU.<KeyCacheObject, V>info2Key()))
+                    )
+                );
 
                 if (!retryKeys.isEmpty())
                     map(retryKeys, F.concat(false, node, exc));

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 5bf18d9..5c48dc7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -64,6 +64,7 @@ import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
 import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteBiPredicate;
 import org.jetbrains.annotations.NotNull;
@@ -416,7 +417,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
 
     /** {@inheritDoc} */
     @Override public Collection<V> values(CacheEntryPredicate... filter) {
-        return new GridCacheValueCollection<>(ctx, entrySet(filter), ctx.vararg(F.<K, V>cacheHasPeekValue()));
+        return new GridCacheValueCollection<>(ctx, entrySet(filter), ctx.vararg(CU.<K, V>cacheHasPeekValue()));
     }
 
     /** {@inheritDoc} */
@@ -558,12 +559,12 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
         /** {@inheritDoc} */
         @NotNull @Override public Iterator<Cache.Entry<K, V>> iterator() {
             return new EntryIterator(nearSet.iterator(),
-                F.iterator0(dhtSet, false, new P1<Cache.Entry<K, V>>() {
-                    @Override public boolean apply(Cache.Entry<K, V> e) {
+                F.identityIterator(dhtSet, new P1<Cache.Entry<K, V>>() {
+                    @Override
+                    public boolean apply(Cache.Entry<K, V> e) {
                         try {
                             return GridNearCacheAdapter.super.localPeek(e.getKey(), NEAR_PEEK_MODE, null) == null;
-                        }
-                        catch (IgniteCheckedException ex) {
+                        } catch (IgniteCheckedException ex) {
                             throw new IgniteException(ex);
                         }
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 6130ead..3b60f96 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -60,7 +60,6 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -189,7 +188,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
     @Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F0.asMap(key, val),
+        return updateAllAsync0(F.asMap(key, val),
             null,
             null,
             true,
@@ -202,7 +201,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
     @Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
-        return updateAllAsync0(F0.asMap(key, val),
+        return updateAllAsync0(F.asMap(key, val),
             null,
             null,
             false,
@@ -659,11 +658,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
-            @Override public EntryProcessor apply(K k) {
-                return entryProcessor;
-            }
-        });
+        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 
@@ -729,11 +724,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() {
-            @Override public EntryProcessor apply(K k) {
-                return entryProcessor;
-            }
-        });
+        Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = CU.invokeMap(keys, entryProcessor);
 
         return updateAllAsync0(null,
             invokeMap,

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index f7a82a9..84c4269 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -30,7 +30,6 @@ import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -179,8 +178,8 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(internalCompareAndSet(F0.equalTo(expVal), wrapperClosure(newVal),
-                F0.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
+            return CU.outTx(internalCompareAndSet(F.equalTo(expVal), wrapperClosure(newVal),
+                F.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 5b8cf86..b313084 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -45,7 +45,6 @@ import org.apache.ignite.internal.IgniteNodeAttributes;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.ipc.IpcServerEndpoint;
 import org.apache.ignite.internal.util.typedef.C1;
-import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -128,11 +127,8 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 
         final Map<String, CacheConfiguration> cacheCfgs = new HashMap<>();
 
-        F.forEach(gridCfg.getCacheConfiguration(), new CI1<CacheConfiguration>() {
-            @Override public void apply(CacheConfiguration c) {
-                cacheCfgs.put(c.getName(), c);
-            }
-        });
+        for (CacheConfiguration c : gridCfg.getCacheConfiguration())
+            cacheCfgs.put(c.getName(), c);
 
         Collection<IgfsAttributes> attrVals = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
index 7e65c22..9f0fd3f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
@@ -235,13 +235,13 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
                         @Override public Set<Entry<K, V>> entrySet() {
                             return new AbstractSet<Entry<K, V>>() {
                                 @Override public Iterator<Entry<K, V>> iterator() {
-                                    return F.iterator(entries, new C1<Cache.Entry<? extends K, ? extends V>, Entry<K, V>>() {
+                                    return F.iteratorReadOnly(entries, new C1<Cache.Entry<? extends K, ? extends V>, Entry<K, V>>() {
                                         private static final long serialVersionUID = 0L;
 
                                         @Override public Entry<K, V> apply(Cache.Entry<? extends K, ? extends V> entry) {
                                             return new GridMapEntry<>(entry.getKey(), entry.getValue());
                                         }
-                                    }, true);
+                                    });
                                 }
 
                                 @Override public int size() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 297785e..5e12199 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -135,8 +135,7 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter {
                 }
                 else
                     node = F.find(ctx.discovery().allNodes(), null, new P1<ClusterNode>() {
-                        @Override
-                        public boolean apply(ClusterNode n) {
+                        @Override public boolean apply(ClusterNode n) {
                             return containsIp(n.addresses(), ip);
                         }
                     });

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
index 7e9e448..b819226 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/F0.java
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.internal.util;
 
-import java.util.Collection;
-import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.IgniteCheckedException;
@@ -27,11 +25,9 @@ import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
 import org.apache.ignite.internal.processors.cache.CacheEntrySerializablePredicate;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
-import org.apache.ignite.internal.util.lang.GridFunc;
 import org.apache.ignite.internal.util.lang.GridNodePredicate;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
-import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.jetbrains.annotations.Nullable;
@@ -42,79 +38,6 @@ import org.jetbrains.annotations.Nullable;
  */
 public class F0 {
     /**
-     * Negates given predicates.
-     * <p>
-     * Gets predicate (not peer-deployable) that evaluates to {@code true} if any of given predicates
-     * evaluates to {@code false}. If all predicates evaluate to {@code true} the
-     * result predicate will evaluate to {@code false}.
-     *
-     * @param p Predicate to negate.
-     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Negated predicate (not peer-deployable).
-     */
-    public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
-        return F.isAlwaysFalse(p) ? F.<T>alwaysTrue() : F.isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !F.isAll(t, p);
-            }
-        };
-    }
-
-    /**
-     * Gets predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
-     * to {@code target} or both are {@code null}.
-     *
-     * @param target Object to compare free variable to.
-     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate (not peer-deployable) that evaluates to {@code true} if its free variable is not equal
-     *      to {@code target} or both are {@code null}.
-     */
-    public static <T> IgnitePredicate<T> notEqualTo(@Nullable final T target) {
-        return new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !F.eq(t, target);
-            }
-        };
-    }
-
-    /**
-     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable
-     * is not contained in given collection.
-     *
-     * @param c Collection to check for containment.
-     * @param <T> Type of the free variable for the predicate and type of the
-     *      collection elements.
-     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is not
-     *      contained in given collection.
-     */
-    public static <T> IgnitePredicate<T> notIn(@Nullable final Collection<? extends T> c) {
-        return F.isEmpty(c) ? GridFunc.<T>alwaysTrue() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                assert c != null;
-
-                return !c.contains(t);
-            }
-        };
-    }
-
-    /**
-     * Gets predicate (not perr-deployable) that evaluates to {@code true} if its free variable is equal
-     * to {@code target} or both are {@code null}.
-     *
-     * @param target Object to compare free variable to.
-     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if its free variable is equal to
-     *      {@code target} or both are {@code null}.
-     */
-    public static <T> IgnitePredicate<T> equalTo(@Nullable final T target) {
-        return new P1<T>() {
-            @Override public boolean apply(T t) {
-                return F.eq(t, target);
-            }
-        };
-    }
-
-    /**
      * @param p1 Filter1.
      * @param p2 Filter2.
      * @return And filter.
@@ -133,16 +56,12 @@ public class F0 {
         if (e1 && e2)
             return CU.alwaysTrue0();
 
-        if (e1 && !e2) {
-            assert p2 != null;
-
+        if (e1) {
             if (p2.length == 1)
                 return p2[0];
         }
 
-        if (!e1 && e2) {
-            assert p1 != null;
-
+        if (e2) {
             if (p1.length == 1)
                 return p1[0];
         }
@@ -150,16 +69,12 @@ public class F0 {
         return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
             @Override public boolean apply(GridCacheEntryEx e) {
                 if (!e1) {
-                    assert p1 != null;
-
                     for (CacheEntryPredicate p : p1)
                         if (p != null && !p.apply(e))
                             return false;
                 }
 
                 if (!e2) {
-                    assert p2 != null;
-
                     for (CacheEntryPredicate p : p2)
                         if (p != null && !p.apply(e))
                             return false;
@@ -186,15 +101,11 @@ public class F0 {
 
             @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
                 if (!e1) {
-                    assert p1 != null;
-
                     for (CacheEntryPredicate p : p1)
                         p.prepareMarshal(ctx);
                 }
 
                 if (!e2) {
-                    assert p2 != null;
-
                     for (CacheEntryPredicate p : p2)
                         p.prepareMarshal(ctx);
                 }
@@ -203,63 +114,6 @@ public class F0 {
     }
 
     /**
-     * @param p Filter1.
-     * @param ps Filter2.
-     * @return And filter.
-     */
-    public static CacheEntryPredicate and0(
-        @Nullable final CacheEntryPredicate p,
-        @Nullable final CacheEntryPredicate... ps) {
-        if (p == null && F.isEmptyOrNulls(ps))
-            return CU.alwaysTrue0();
-
-        if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
-            return CU.alwaysFalse0();
-
-        if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
-            return CU.alwaysTrue0();
-
-        return new CacheEntrySerializablePredicate(new CacheEntryPredicateAdapter() {
-            @Override public boolean apply(GridCacheEntryEx e) {
-                assert ps != null;
-
-                if (p != null && !p.apply(e))
-                    return false;
-
-                for (CacheEntryPredicate p : ps) {
-                    if (p != null && !p.apply(e))
-                        return false;
-                }
-
-                return true;
-            }
-
-            @Override public void entryLocked(boolean locked) {
-                assert ps != null;
-
-                if (p != null)
-                    p.entryLocked(locked);
-
-                for (CacheEntryPredicate p : ps) {
-                    if (p != null)
-                        p.entryLocked(locked);
-                }
-            }
-
-            @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
-                assert ps != null;
-
-                if (p != null)
-                    p.prepareMarshal(ctx);
-
-                for (CacheEntryPredicate p : ps)
-                    if (p != null)
-                        p.prepareMarshal(ctx);
-            }
-        });
-    }
-
-    /**
      * Get a predicate (non peer-deployable) that evaluates to {@code true} if each of its component predicates
      * evaluates to {@code true}. The components are evaluated in order they are supplied.
      * Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
@@ -287,16 +141,12 @@ public class F0 {
         if (e1 && e2)
             return F.alwaysTrue();
 
-        if (e1 && !e2) {
-            assert p2 != null;
-
+        if (e1) {
             if (p2.length == 1)
                 return (IgnitePredicate<T>)p2[0];
         }
 
-        if (!e1 && e2) {
-            assert p1 != null;
-
+        if (e2) {
             if (p1.length == 1)
                 return (IgnitePredicate<T>)p1[0];
         }
@@ -305,15 +155,11 @@ public class F0 {
             Set<UUID> ids = new GridLeanSet<>();
 
             if (!e1) {
-                assert p1 != null;
-
                 for (IgnitePredicate<? super T> p : p1)
                     ids.addAll(((GridNodePredicate)p).nodeIds());
             }
 
             if (!e2) {
-                assert p2 != null;
-
                 for (IgnitePredicate<? super T> p : p2)
                     ids.addAll(((GridNodePredicate)p).nodeIds());
             }
@@ -325,16 +171,12 @@ public class F0 {
             return new P1<T>() {
                 @Override public boolean apply(T t) {
                     if (!e1) {
-                        assert p1 != null;
-
                         for (IgnitePredicate<? super T> p : p1)
                             if (p != null && !p.apply(t))
                                 return false;
                     }
 
                     if (!e2) {
-                        assert p2 != null;
-
                         for (IgnitePredicate<? super T> p : p2)
                             if (p != null && !p.apply(t))
                                 return false;
@@ -347,148 +189,6 @@ public class F0 {
     }
 
     /**
-     * Get a predicate (not peer-deployable) that evaluates to {@code true} if each of its component predicates
-     * evaluates to {@code true}. The components are evaluated in order they are supplied.
-     * Evaluation will be stopped as soon as first predicate evaluates to {@code false}.
-     * Passed in predicates are NOT copied. If no predicates are passed in the returned
-     * predicate will always evaluate to {@code false}.
-     *
-     * @param ps Passed in predicate. If none provided - always-{@code false} predicate is
-     *      returned.
-     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if each of its component predicates
-     *      evaluates to {@code true}.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> IgnitePredicate<T> and(
-        @Nullable final IgnitePredicate<? super T> p,
-        @Nullable final IgnitePredicate<? super T>... ps
-    ) {
-        if (p == null && F.isEmptyOrNulls(ps))
-            return F.alwaysTrue();
-
-        if (F.isAlwaysFalse(p) && F.isAlwaysFalse(ps))
-            return F.alwaysFalse();
-
-        if (F.isAlwaysTrue(p) && F.isAlwaysTrue(ps))
-            return F.alwaysTrue();
-
-        if (isAllNodePredicates(p) && isAllNodePredicates(ps)) {
-            assert ps != null;
-
-            Set<UUID> ids = new GridLeanSet<>();
-
-            for (IgnitePredicate<? super T> p0 : ps) {
-                Collection<UUID> list = ((GridNodePredicate)p0).nodeIds();
-
-                if (ids.isEmpty())
-                    ids.addAll(list);
-                else
-                    ids.retainAll(list);
-            }
-
-            Collection<UUID> list = ((GridNodePredicate)p).nodeIds();
-
-            if (ids.isEmpty())
-                ids.addAll(list);
-            else
-                ids.retainAll(list);
-
-            // T must be <T extends GridNode>.
-            return (IgnitePredicate<T>)new GridNodePredicate(ids);
-        }
-        else {
-            return new P1<T>() {
-                @Override public boolean apply(T t) {
-                    assert ps != null;
-
-                    if (p != null && !p.apply(t))
-                        return false;
-
-                    for (IgnitePredicate<? super T> p : ps)
-                        if (p != null && !p.apply(t))
-                            return false;
-
-                    return true;
-                }
-            };
-        }
-    }
-
-    /**
-     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
-     * in given collection.
-     *
-     * @param c Collection to check for containment.
-     * @param <T> Type of the free variable for the predicate and type of the
-     *      collection elements.
-     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
-     *      contained in given collection.
-     */
-    public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
-        return F.isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                assert c != null;
-
-                return c.contains(t);
-            }
-        };
-    }
-
-    /**
-     * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
-     * that is contained in the passed in collection.
-     *
-     * @param c Collection used for predicate filter.
-     * @param <T> Element type.
-     * @return Predicate which returns {@code true} if it receives an element
-     *  that is contained in the passed in collection.
-     */
-    public static <T> IgnitePredicate<T> contains(@Nullable final Collection<T> c) {
-        return c == null || c.isEmpty() ? GridFunc.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return c.contains(t);
-            }
-        };
-    }
-
-    /**
-     * Provides predicate (not peer-deployable) which returns {@code true} if it receives an element
-     * that is not contained in the passed in collection.
-     *
-     * @param c Collection used for predicate filter.
-     * @param <T> Element type.
-     * @return Predicate which returns {@code true} if it receives an element
-     *  that is not contained in the passed in collection.
-     */
-    public static <T> IgnitePredicate<T> notContains(@Nullable final Collection<T> c) {
-        return c == null || c.isEmpty() ? GridFunc.<T>alwaysTrue() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !c.contains(t);
-            }
-        };
-    }
-
-    /**
-     * Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
-     *
-     * @param ps Collection of predicates to test.
-     * @return {@code True} if all passed in predicates are instances of {@link GridNodePredicate} class.
-     */
-    public static boolean isAllNodePredicates(@Nullable Iterable<? extends IgnitePredicate<?>> ps) {
-        if (F.isEmpty(ps))
-            return false;
-
-        assert ps != null;
-
-        for (IgnitePredicate<?> p : ps)
-            if (!(p instanceof GridNodePredicate))
-                return false;
-
-        return true;
-    }
-
-    /**
      * Tests if all passed in predicates are instances of {@link GridNodePredicate} class.
      *
      * @param ps Collection of predicates to test.
@@ -498,27 +198,10 @@ public class F0 {
         if (F.isEmpty(ps))
             return false;
 
-        assert ps != null;
-
         for (IgnitePredicate<?> p : ps)
             if (!(p instanceof GridNodePredicate))
                 return false;
 
         return true;
     }
-
-    /**
-     * Creates map with given values, adding a strict not-null check for value.
-     *
-     * @param key Key.
-     * @param val Value.
-     * @param <K> Key's type.
-     * @param <V> Value's type.
-     * @return Created map.
-     */
-    public static <K, V> Map<K, V> asMap(K key, V val) {
-        A.notNull(val, "val");
-
-        return F.asMap(key, val);
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
index a23fe28..fc2e3a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridExecutionStatistics.java
@@ -71,13 +71,13 @@ public class GridExecutionStatistics {
 
         long time = startTime.get().get2();
 
-        AtomicInteger cnt = F.addIfAbsent(cntMap, name, F.newAtomicInt());
+        AtomicInteger cnt = F.addIfAbsent(cntMap, name, new AtomicInteger());
 
         assert cnt != null;
 
         cnt.incrementAndGet();
 
-        AtomicLong d = F.addIfAbsent(durationMap, name, F.newAtomicLong());
+        AtomicLong d = F.addIfAbsent(durationMap, name, new AtomicLong());
 
         assert d != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 480859d..a92ccab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8508,7 +8508,7 @@ public abstract class IgniteUtils {
             throw new IgniteCheckedException("Addresses can not be resolved [addr=" + addrs +
                 ", hostNames=" + hostNames + ']');
 
-        return F.viewListReadOnly(res, F.<InetAddress>identity());
+        return Collections.unmodifiableList(res);
     }
 
     /**
@@ -8555,7 +8555,7 @@ public abstract class IgniteUtils {
             res.add(new InetSocketAddress(addr, port));
         }
 
-        return F.viewListReadOnly(res, F.<InetSocketAddress>identity());
+        return Collections.unmodifiableList(res);
     }
 
     /**


[43/50] [abbrv] ignite git commit: Revert "IGNITE-2330: Simplified GridFunc."

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ddbe2d59/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 015be5c..0678657 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
@@ -35,10 +35,16 @@ import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicReference;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
+import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridEmptyIterator;
@@ -46,6 +52,7 @@ 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.GridSerializableList;
 import org.apache.ignite.internal.util.GridSerializableMap;
 import org.apache.ignite.internal.util.GridSerializableSet;
 import org.apache.ignite.internal.util.typedef.C1;
@@ -61,6 +68,7 @@ import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteCallable;
 import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.lang.IgniteOutClosure;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteReducer;
 import org.jetbrains.annotations.NotNull;
@@ -144,6 +152,13 @@ public class GridFunc {
     };
 
     /** */
+    public static final IgnitePredicate<Object> IS_NULL = new P1<Object>() {
+        @Override public boolean apply(Object o) {
+            return o == null;
+        }
+    };
+
+    /** */
     public static final IgnitePredicate<Object> IS_NOT_NULL = new P1<Object>() {
         @Override public boolean apply(Object o) {
             return o != null;
@@ -151,6 +166,28 @@ public class GridFunc {
     };
 
     /** */
+    private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallable<List>() {
+        @Override public List call() {
+            return new ArrayList();
+        }
+
+        @Override public String toString() {
+            return "Array list factory.";
+        }
+    };
+
+    /** */
+    private static final IgniteCallable<?> LINKED_LIST_FACTORY = new IgniteCallable<LinkedList>() {
+        @Override public LinkedList call() {
+            return new LinkedList();
+        }
+
+        @Override public String toString() {
+            return "Linked list factory.";
+        }
+    };
+
+    /** */
     private static final IgniteCallable<?> SET_FACTORY = new IgniteCallable<Set>() {
         @Override public Set call() {
             return new HashSet();
@@ -162,6 +199,61 @@ public class GridFunc {
     };
 
     /** */
+    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<AtomicLong> ATOMIC_LONG_FACTORY = new IgniteCallable<AtomicLong>() {
+        @Override public AtomicLong call() {
+            return new AtomicLong(0);
+        }
+
+        @Override public String toString() {
+            return "Atomic long factory.";
+        }
+    };
+
+    /** */
+    private static final IgniteCallable<AtomicBoolean> ATOMIC_BOOL_FACTORY = new IgniteCallable<AtomicBoolean>() {
+        @Override public AtomicBoolean call() {
+            return new AtomicBoolean();
+        }
+
+        @Override public String toString() {
+            return "Atomic boolean factory.";
+        }
+    };
+
+    /** */
+    private static final IgniteCallable<?> ATOMIC_REF_FACTORY = new IgniteCallable<AtomicReference>() {
+        @Override public AtomicReference call() {
+            return new AtomicReference();
+        }
+
+        @Override public String toString() {
+            return "Atomic reference factory.";
+        }
+    };
+
+    /** */
+    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<?> CONCURRENT_MAP_FACTORY = new IgniteCallable<ConcurrentMap>() {
         @Override public ConcurrentMap call() {
             return new ConcurrentHashMap8();
@@ -184,6 +276,42 @@ public class GridFunc {
     };
 
     /** */
+    private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
+        @Override public Object apply(Object o) {
+            return ((Cache.Entry)o).getKey();
+        }
+
+        @Override public String toString() {
+            return "Map entry to key transformer closure.";
+        }
+    };
+
+
+    /** */
+    private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
+        @SuppressWarnings({"unchecked"})
+        @Nullable @Override public Object apply(Object o) {
+            return ((Cache.Entry)o).getValue();
+        }
+
+        @Override public String toString() {
+            return "Cache entry to get-value transformer closure.";
+        }
+    };
+
+    /** */
+    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;
+        }
+
+        @Override public String toString() {
+            return "Cache entry has-peek-value predicate.";
+        }
+    };
+
+    /** */
     private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosure<ClusterNode, UUID>() {
         @Override public UUID apply(ClusterNode n) {
             return n.id();
@@ -216,8 +344,12 @@ public class GridFunc {
         }
     };
 
-    /** Empty iterator. */
-    private static final GridEmptyIterator EMPTY_ITER = new GridEmptyIterator();
+    /** */
+    private static final IgnitePredicate<IgniteInternalFuture<?>> UNFINISHED_FUTURE = new IgnitePredicate<IgniteInternalFuture<?>>() {
+        @Override public boolean apply(IgniteInternalFuture<?> f) {
+            return !f.isDone();
+        }
+    };
 
     /**
      * Gets predicate that evaluates to {@code true} only for given local node ID.
@@ -250,6 +382,23 @@ public class GridFunc {
     }
 
     /**
+     * Creates new collection by removing duplicates from the given collection.
+     *
+     * @param c Collection to remove duplicates from.
+     * @param <T> Type of the collection.
+     * @return De-duped collection.
+     */
+    public static <T> Collection<T> dedup(Collection<? extends T> c) {
+        A.notNull(c, "c");
+
+        Collection<T> set = new GridLeanSet<>();
+
+        set.addAll(c);
+
+        return set;
+    }
+
+    /**
      * Calculates sum of all elements.
      * <p>
      * <img src="{@docRoot}/img/sum.png">
@@ -429,6 +578,8 @@ public class GridFunc {
         if (isEmpty(res))
             return Collections.emptyList();
 
+        assert res != null;
+
         Collection<T> c = new ArrayList<>(res.size());
 
         for (ComputeJobResult r : res)
@@ -542,6 +693,20 @@ public class GridFunc {
     }
 
     /**
+     * Gets random value from given array. This operation
+     * does not iterate through array elements and returns immediately.
+     *
+     * @param c Input collection.
+     * @param <T> Type of the collection.
+     * @return Random value from the input collection.
+     */
+    public static <T> T rand(T... c) {
+        A.notNull(c, "c");
+
+        return c[ThreadLocalRandom8.current().nextInt(c.length)];
+    }
+
+    /**
      * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
      * a new collection will be created and the element and passed in collection will be
      * copied into the new one. The returned collection will be modifiable. If {@code copy}
@@ -564,6 +729,8 @@ public class GridFunc {
                 return l;
             }
 
+            assert c != null;
+
             Collection<T> ret = new ArrayList<>(c.size() + 1);
 
             ret.add(t);
@@ -575,6 +742,8 @@ public class GridFunc {
             if (isEmpty(c))
                 return Collections.singletonList(t);
 
+            assert c != null;
+
             return new GridSerializableCollection<T>() {
                 @NotNull
                 @Override public Iterator<T> iterator() {
@@ -631,11 +800,8 @@ public class GridFunc {
             if (isEmpty(c1) && isEmpty(c2))
                 return new ArrayList<>(0);
 
-            if (isEmpty(c1)) {
-                assert c2 != null;
-
+            if (isEmpty(c1))
                 return new ArrayList<>(c2);
-            }
 
             if (isEmpty(c2))
                 return new ArrayList<>(c1);
@@ -708,7 +874,7 @@ public class GridFunc {
      * @param obj One or more elements.
      * @return Concatenated array.
      */
-    public static <T> T[] concat(@Nullable T[] arr, T[] obj) {
+    public static <T> T[] concat(@Nullable T[] arr, T... obj) {
         T[] newArr;
 
         if (arr == null || arr.length == 0)
@@ -723,15 +889,17 @@ public class GridFunc {
     }
 
     /**
-     * Concatenate two iterators.
+     * Concatenates multiple iterators as single one.
      *
-     * @param iter1 Iterator 1.
-     * @param iter2 Iterator 2.
+     * @param iters Iterators.
      * @return Single iterator.
      */
     @SuppressWarnings("unchecked")
-    public static <T> Iterator<T> concat(Iterator<T> iter1, Iterator<T> iter2) {
-        return concat(asList(iter1, iter2).iterator());
+    public static <T> Iterator<T> concat(Iterator<T> ... iters) {
+        if (iters.length == 1)
+            return iters[0];
+
+        return concat(asList(iters).iterator());
     }
 
     /**
@@ -812,10 +980,11 @@ public class GridFunc {
      * @param <T> Type of collections.
      * @return Collection of remaining elements
      */
-    public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp, @Nullable Collection<T0> filter) {
+    public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp,
+        @Nullable Collection<T0> filter) {
         A.notNull(c, "c");
 
-        return lose(c, cp, in(filter));
+        return lose(c, cp, F0.in(filter));
     }
 
     /**
@@ -825,11 +994,11 @@ public class GridFunc {
      * @param c Input collection.
      * @param cp If {@code true} method creates new collection without modifying the input one,
      *      otherwise does <tt>in-place</tt> modifications.
-     * @param p Predicate.
+     * @param p Predicates to filter by. If no predicates provided - no elements are lost.
      * @param <T> Type of collections.
      * @return Collection of remaining elements.
      */
-    public static <T> Collection<T> lose(Collection<T> c, boolean cp, IgnitePredicate<? super T> p) {
+    public static <T> Collection<T> lose(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
         A.notNull(c, "c");
 
         Collection<T> res;
@@ -837,18 +1006,19 @@ public class GridFunc {
         if (!cp) {
             res = c;
 
-            if (!isAlwaysFalse(p)) {
-                for (Iterator<T> iter = res.iterator(); iter.hasNext(); )
-                    if (p.apply(iter.next()))
+            if (isEmpty(p))
+                res.clear();
+            else if (!isAlwaysFalse(p))
+                for (Iterator<T> iter = res.iterator(); iter.hasNext();)
+                    if (isAll(iter.next(), p))
                         iter.remove();
-            }
         }
         else {
             res = new LinkedList<>();
 
-            if (!isAlwaysTrue(p))
+            if (!isEmpty(p) && !isAlwaysTrue(p))
                 for (T t : c)
-                    if (!p.apply(t))
+                    if (!isAll(t, p))
                         res.add(t);
         }
 
@@ -856,6 +1026,162 @@ public class GridFunc {
     }
 
     /**
+     * Loses all entries in input map that are evaluated to {@code true} by all given predicates.
+     *
+     * @param m Map to filter.
+     * @param cp If {@code true} method creates new map not modifying input, otherwise does
+     *      <tt>in-place</tt> modifications.
+     * @param p Optional set of predicates to use for filtration. If none provided - original map
+     *  will (or its copy) be returned.
+     * @param <K> Type of the free variable for the predicate and type of map's keys.
+     * @param <V> Type of the free variable for the predicate and type of map's values.
+     * @return Filtered map.
+     */
+    @SuppressWarnings({"unchecked"})
+    public static <K, V> Map<K, V> lose(Map<K, V> m, boolean cp,
+        @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
+        A.notNull(m, "m");
+
+        Map<K, V> res;
+
+        if (!cp) {
+            res = m;
+
+            if (isEmpty(p))
+                res.clear();
+            else if (!isAlwaysFalse(p))
+                for (Iterator<Map.Entry<K, V>> iter = m.entrySet().iterator(); iter.hasNext();)
+                    if (isAll(iter.next(), p))
+                        iter.remove();
+        }
+        else {
+            res = U.newHashMap(m.size());
+
+            if (!isEmpty(p) && !isAlwaysTrue(p))
+                for (Map.Entry<K, V> e : m.entrySet())
+                    if (!F.isAll(e, p))
+                        res.put(e.getKey(), e.getValue());
+        }
+
+        return res;
+    }
+
+    /**
+     * Loses all entries in input map which keys are evaluated to {@code true} by all
+     * given predicates.
+     *
+     * @param m Map to filter.
+     * @param cp If {@code true} method creates new map not modifying input, otherwise does
+     *      <tt>in-place</tt> modifications.
+     * @param p Optional set of predicates to use for filtration. If none provided - original
+     *      map (or its copy) will be returned.
+     * @param <K> Type of the free variable for the predicate and type of map's keys.
+     * @param <V> Type of map's values.
+     * @return Filtered map.
+     */
+    public static <K, V> Map<K, V> loseKeys(
+        Map<K, V> m,
+        boolean cp,
+        @Nullable final IgnitePredicate<? super K>... p
+    ) {
+        return lose(m, cp, new P1<Map.Entry<K, V>>() {
+            @Override public boolean apply(Map.Entry<K, V> e) {
+                return isAll(e.getKey(), p);
+            }
+        });
+    }
+
+    /**
+     * Loses all entries in input map which values are evaluated to {@code true} by all
+     * given predicates.
+     *
+     * @param m Map to filter.
+     * @param cp If {@code true} method creates new map not modifying input, otherwise does
+     *      <tt>in-place</tt> modifications.
+     * @param p Optional set of predicates to use for filtration. If none provided - original
+     *      map (or its copy) will be returned.
+     * @param <K> Type of the free variable for the predicate and type of map's keys.
+     * @param <V> Type of map's values.
+     * @return Filtered map.
+     */
+    public static <K, V> Map<K, V> loseValues(Map<K, V> m, boolean cp,
+        @Nullable final IgnitePredicate<? super V>... p) {
+        return lose(m, cp, new P1<Map.Entry<K, V>>() {
+            @Override public boolean apply(Map.Entry<K, V> e) {
+                return isAll(e.getValue(), p);
+            }
+        });
+    }
+
+    /**
+     * Loses all elements in input list that are contained in {@code filter} collection.
+     *
+     * @param c Input list.
+     * @param cp If {@code true} method creates new list not modifying input,
+     *      otherwise does <tt>in-place</tt> modifications.
+     * @param filter Filter collection. If {@code filter} collection is empty or
+     *      {@code null} - no elements are lost.
+     * @param <T> Type of list.
+     * @return List of remaining elements
+     */
+    public static <T> List<T> loseList(List<T> c, boolean cp, @Nullable Collection<? super T> filter) {
+        A.notNull(c, "c");
+
+        List<T> res;
+
+        if (!cp) {
+            res = c;
+
+            if (filter != null)
+                res.removeAll(filter);
+        }
+        else {
+            res = new LinkedList<>();
+
+            for (T t : c) {
+                if (filter == null || !filter.contains(t))
+                    res.add(t);
+            }
+        }
+
+        return res;
+    }
+
+    /**
+     * Loses all elements in input list for which any of the predicates evaluate to {@code true}.
+     *
+     * @param c Input list.
+     * @param cp If {@code true} method creates new list not modifying input,
+     *      otherwise does <tt>in-place</tt> modifications.
+     * @param p Looses all elements for which any of the predicates evaluate to {@code true}.
+     * @param <T> Type of list.
+     * @return List of remaining elements
+     */
+    public static <T> List<T> filterList(List<T> c, boolean cp, @Nullable IgnitePredicate<T>... p) {
+        A.notNull(c, "c");
+
+        List<T> res;
+
+        if (!cp) {
+            res = c;
+
+            if (p != null)
+                for (Iterator<T> it = c.iterator(); it.hasNext();)
+                    if (isAny(it.next(), p))
+                        it.remove();
+        }
+        else {
+            res = new ArrayList<>(c.size());
+
+            for (T t : c)
+                if (!isAny(t, p))
+                    res.add(t);
+        }
+
+        return res;
+    }
+
+    /**
      * Gets closure which converts node to node ID.
      *
      * @return Closure which converts node to node ID.
@@ -927,40 +1253,34 @@ public class GridFunc {
     }
 
     /**
-     * Retains all elements in input collection that are contained in {@code filter}.
+     * Creates predicates that evaluates to {@code true} for each node in given collection.
+     * Note that if collection is empty the result predicate will always evaluate to {@code false}.
+     * Implementation simply creates {@link GridNodePredicate} instance.
      *
-     * @param c Input collection.
-     * @param cp If {@code true} method creates collection not modifying input, otherwise does
-     *      <tt>in-place</tt> modifications.
-     * @param filter Filter collection. If filter collection is {@code null} or empty -
-     *      an empty collection will be returned.
-     * @param <T> Type of collections.
-     * @return Collection of retain elements.
+     * @param nodes Collection of nodes. If none provided - result predicate will always
+     *      return {@code false}.
+     * @return Predicates that evaluates to {@code true} for each node in given collection.
      */
-    public static <T0, T extends T0> Collection<T> retain(Collection<T> c, boolean cp,
-        @Nullable Collection<? extends T0> filter) {
-        A.notNull(c, "c");
-
-        return retain(c, cp, in(filter));
+    public static IgnitePredicate<ClusterNode> nodeForNodes(ClusterNode... nodes) {
+        return new GridNodePredicate(nodes);
     }
 
     /**
-     * Retains all elements in input collection that are evaluated to {@code true}
-     * by the given predicate.
+     * Retains all elements in input collection that are contained in {@code filter}.
      *
      * @param c Input collection.
      * @param cp If {@code true} method creates collection not modifying input, otherwise does
      *      <tt>in-place</tt> modifications.
-     * @param p Predicates to filter by. If no predicates provides - all elements
-     *      will be retained.
+     * @param filter Filter collection. If filter collection is {@code null} or empty -
+     *      an empty collection will be returned.
      * @param <T> Type of collections.
      * @return Collection of retain elements.
      */
-    public static <T> Collection<T> retain(Collection<T> c, boolean cp, IgnitePredicate<? super T> p) {
+    public static <T0, T extends T0> Collection<T> retain(Collection<T> c, boolean cp,
+        @Nullable Collection<? extends T0> filter) {
         A.notNull(c, "c");
-        A.notNull(p, "p");
 
-        return lose(c, cp, not(p));
+        return retain(c, cp, F0.in(filter));
     }
 
     /**
@@ -975,7 +1295,7 @@ public class GridFunc {
      * @param <T> Type of collections.
      * @return Collection of retain elements.
      */
-    public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>[] p) {
+    public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
         A.notNull(c, "c");
 
         return lose(c, cp, not(p));
@@ -1025,19 +1345,36 @@ public class GridFunc {
     }
 
     /**
-     * Create list containing two elements.
+     * Curries given closure.
      *
-     * @param t1 First element.
-     * @param t2 Second element.
-     * @return List.
+     * @param f Closure.
+     * @param e Parameter.
+     * @param <T> Input type.
+     * @param <R> Output type.
+     * @return Curried closure.
      */
-    public static <T> List<T> asList(T t1, T t2) {
-        ArrayList<T> res = new ArrayList<>(2);
-
-        res.add(t1);
-        res.add(t2);
+    public static <T, R> IgniteOutClosure<R> curry(final IgniteClosure<? super T, R> f, final T e) {
+        return new IgniteOutClosure<R>() {
+            @Override public R apply() {
+                return f.apply(e);
+            }
+        };
+    }
 
-        return res;
+    /**
+     * Curries given closure.
+     *
+     * @param f Closure.
+     * @param e Parameter.
+     * @param <T> Input type.
+     * @return Curried closure.
+     */
+    public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
+        return new GridAbsClosure() {
+            @Override public void apply() {
+                f.apply(e);
+            }
+        };
     }
 
     /**
@@ -1053,7 +1390,6 @@ public class GridFunc {
      * @param <T> Array type.
      * @return {@link List} instance for array.
      */
-    @SuppressWarnings("unchecked")
     public static <T> List<T> asList(@Nullable T... vals) {
         return isEmpty(vals) ? Collections.<T>emptyList() : Arrays.asList(vals);
     }
@@ -1064,9 +1400,8 @@ public class GridFunc {
      * @param <T> Type of the iterator.
      * @return Newly created empty iterator.
      */
-    @SuppressWarnings("unchecked")
     public static <T> GridIterator<T> emptyIterator() {
-        return EMPTY_ITER;
+        return new GridEmptyIterator<>();
     }
 
     /**
@@ -1239,29 +1574,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets size of the given collection.
-     *
-     * @param c Collection.
-     * @return Size.
-     */
-    public static <T> int size(@Nullable Collection<? extends T> c) {
-        return c == null || c.isEmpty() ? 0 : c.size();
-    }
-
-    /**
-     * Gets size of the given collection with provided optional predicates.
-     *
-     * @param c Collection to size.
-     * @param p Optional predicates that filters out elements from count.
-     * @param <T> Type of the iterator.
-     * @return Number of elements in the collection for which all given predicates
-     *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
-     */
-    public static <T> int size(@Nullable Collection<? extends T> c, IgnitePredicate<? super T> p) {
-        return c == null || c.isEmpty() ? 0 : isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
-    }
-
-    /**
      * Gets size of the given collection with provided optional predicates.
      *
      * @param c Collection to size.
@@ -1270,34 +1582,12 @@ public class GridFunc {
      * @return Number of elements in the collection for which all given predicates
      *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
      */
-    public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>[] p) {
+    public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>... p) {
         return c == null || c.isEmpty() ? 0 : isEmpty(p) || isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
     }
 
     /**
-     * Gets size of the given iterator. Iterator will be traversed to get the count.
-     *
-     * @param it Iterator to size.
-     * @param <T> Type of the iterator.
-     * @return Number of elements in the iterator.
-     */
-    public static <T> int size(@Nullable Iterator<? extends T> it) {
-        if (it == null)
-            return 0;
-
-        int n = 0;
-
-        while (it.hasNext()) {
-            n++;
-
-            it.next();
-        }
-
-        return n;
-    }
-
-    /**
-     * Gets size of the given iterator with provided optional predicate. Iterator
+     * Gets size of the given iterator with provided optional predicates. Iterator
      * will be traversed to get the count.
      *
      * @param it Iterator to size.
@@ -1306,7 +1596,7 @@ public class GridFunc {
      * @return Number of elements in the iterator for which all given predicates
      *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
      */
-    public static <T> int size(@Nullable Iterator<? extends T> it, IgnitePredicate<? super T> p) {
+    public static <T> int size(@Nullable Iterator<? extends T> it, @Nullable IgnitePredicate<? super T>... p) {
         if (it == null)
             return 0;
 
@@ -1314,7 +1604,7 @@ public class GridFunc {
 
         if (!isAlwaysFalse(p)) {
             while (it.hasNext()) {
-                if (p.apply(it.next()))
+                if (isAll(it.next(), p))
                     n++;
             }
         }
@@ -1323,52 +1613,34 @@ public class GridFunc {
     }
 
     /**
-     * Gets size of the given iterator with provided optional predicates. Iterator
-     * will be traversed to get the count.
-     *
-     * @param it Iterator to size.
-     * @param p Optional predicates that filters out elements from count.
-     * @param <T> Type of the iterator.
-     * @return Number of elements in the iterator for which all given predicates
-     *      evaluates to {@code true}. If no predicates is provided - all elements are counted.
-     */
-    public static <T> int size(@Nullable Iterator<? extends T> it, @Nullable IgnitePredicate<? super T>[] p) {
-        if (it == null)
-            return 0;
-
-        int n = 0;
-
-        if (!isAlwaysFalse(p)) {
-            while (it.hasNext()) {
-                if (isAll(it.next(), p))
-                    n++;
-            }
-        }
-
-        return n;
-    }
-
-    /**
-     * Creates write-through light-weight view on given collection.
+     * Creates write-through light-weight view on given collection with provided predicates. Resulting
+     * collection will only "have" elements for which all provided predicates, if any, evaluate
+     * to {@code true}. Note that only wrapping collection will be created and no duplication of
+     * data will occur. Also note that if array of given predicates is not empty then method
+     * {@code size()} uses full iteration through the collection.
      *
      * @param c Input collection that serves as a base for the view.
      * @param p Optional predicates. If predicates are not provided - all elements will be in the view.
      * @param <T> Type of the collection.
      * @return Light-weight view on given collection with provided predicate.
      */
-    public static <T> Collection<T> view(@Nullable final Collection<T> c, final IgnitePredicate<? super T> p) {
+    @SafeVarargs
+    public static <T> Collection<T> view(@Nullable final Collection<T> c,
+        @Nullable final IgnitePredicate<? super T>... p) {
         if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
-        return isAlwaysTrue(p) ? c : new GridSerializableCollection<T>() {
+        assert c != null;
+
+        return isEmpty(p) || isAlwaysTrue(p) ? c : new GridSerializableCollection<T>() {
             // Pass through (will fail for readonly).
             @Override public boolean add(T e) {
-                return p.apply(e) && c.add(e);
+                return isAll(e, p) && c.add(e);
             }
 
             @NotNull
             @Override public Iterator<T> iterator() {
-                return identityIterator(c, p);
+                return F.iterator0(c, false, p);
             }
 
             @Override public int size() {
@@ -1376,82 +1648,117 @@ public class GridFunc {
             }
 
             @Override public boolean isEmpty() {
-                return !iterator().hasNext();
+                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
             }
         };
     }
 
     /**
-     * Creates read-only light-weight view on given collection with transformation.
+     * Creates read-only light-weight view on given collection with transformation and provided
+     * predicates. Resulting collection will only "have" {@code transformed} elements for which
+     * all provided predicate, if any, evaluates to {@code true}. Note that only wrapping
+     * collection will be created and no duplication of data will occur. Also note that if array
+     * of given predicates is not empty then method {@code size()} uses full iteration through
+     * the collection.
      *
      * @param c Input collection that serves as a base for the view.
      * @param trans Transformation closure.
+     * @param p Optional predicated. If predicates are not provided - all elements will be in the view.
      * @param <T1> Type of the collection.
      * @return Light-weight view on given collection with provided predicate.
      */
     @SuppressWarnings("RedundantTypeArguments")
+    @SafeVarargs
     public static <T1, T2> Collection<T2> viewReadOnly(@Nullable final Collection<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans) {
+        final IgniteClosure<? super T1, T2> trans, @Nullable final IgnitePredicate<? super T1>... p) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(c))
+        if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyList();
 
+        assert c != null;
+
         return new GridSerializableCollection<T2>() {
             @NotNull
             @Override public Iterator<T2> iterator() {
-                return F.<T1, T2>iteratorReadOnly(c, trans);
+                return F.<T1, T2>iterator(c, trans, true, p);
             }
 
             @Override public int size() {
-                return c.size();
+                return F.isEmpty(p) ? c.size() : F.size(iterator());
             }
 
             @Override public boolean isEmpty() {
-                return c.isEmpty();
+                return F.isEmpty(p) ? c.isEmpty() : !iterator().hasNext();
             }
         };
     }
 
     /**
-     * Creates read-only light-weight view on given collection with transformation and provided
-     * predicates. Resulting collection will only "have" {@code transformed} elements for which
-     * all provided predicate, if any, evaluates to {@code true}. Note that only wrapping
-     * collection will be created and no duplication of data will occur. Also note that if array
-     * of given predicates is not empty then method {@code size()} uses full iteration through
-     * the collection.
+     * Creates read-only light-weight view on given list with provided transformation.
+     * Resulting list will only "have" {@code transformed} elements. Note that only wrapping
+     * list will be created and no duplication of data will occur.
      *
-     * @param c Input collection that serves as a base for the view.
+     * @param c Input list that serves as a base for the view.
      * @param trans Transformation closure.
-     * @param p Optional predicated. If predicates are not provided - all elements will be in the view.
-     * @param <T1> Type of the collection.
-     * @return Light-weight view on given collection with provided predicate.
+     * @param <T1> Type of the list.
+     * @return Light-weight view on given list with provided transformation.
      */
     @SuppressWarnings("RedundantTypeArguments")
-    public static <T1, T2> Collection<T2> viewReadOnly(@Nullable final Collection<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans, @Nullable final IgnitePredicate<? super T1> p) {
+    public static <T1, T2> List<T2> viewListReadOnly(@Nullable final List<? extends T1> c,
+        final IgniteClosure<? super T1, T2> trans) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(c) || isAlwaysFalse(p))
+        if (isEmpty(c))
             return Collections.emptyList();
 
-        return new GridSerializableCollection<T2>() {
+        assert c != null;
+
+        return new GridSerializableList<T2>() {
+            /** */
+            private static final long serialVersionUID = 3126625219739967068L;
+
+            @Override public T2 get(int idx) {
+                return trans.apply(c.get(idx));
+            }
+
             @NotNull
             @Override public Iterator<T2> iterator() {
-                return F.<T1, T2>iterator(c, trans, true, p);
+                return F.<T1, T2>iterator(c, trans, true);
             }
 
             @Override public int size() {
-                return F.size(iterator());
+                return c.size();
             }
 
             @Override public boolean isEmpty() {
-                return !iterator().hasNext();
+                return c.isEmpty();
             }
         };
     }
 
     /**
+     * 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.
+     */
+    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));
+    }
+
+    /**
      * Creates light-weight view on given map with provided predicates. Resulting map will
      * only "have" keys for which all provided predicates, if any, evaluates to {@code true}.
      * Note that only wrapping map will be created and no duplication of data will occur.
@@ -1459,24 +1766,26 @@ public class GridFunc {
      * uses full iteration through the entry set.
      *
      * @param m Input map that serves as a base for the view.
-     * @param p Predicate.
+     * @param p Optional predicates. If predicates are not provided - all will be in the view.
      * @param <K> Type of the key.
      * @param <V> Type of the value.
      * @return Light-weight view on given map with provided predicate.
      */
     public static <K0, K extends K0, V0, V extends V0> Map<K, V> view(@Nullable final Map<K, V> m,
-        final IgnitePredicate<? super K> p) {
+        @Nullable final IgnitePredicate<? super K>... p) {
         if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
-        return isAlwaysTrue(p) ? m : new GridSerializableMap<K, V>() {
+        assert m != null;
+
+        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 p.apply(e.getKey());
+                    return isAll(e.getKey(), p);
                 }
             };
 
@@ -1485,7 +1794,7 @@ public class GridFunc {
                 return new GridSerializableSet<Map.Entry<K, V>>() {
                     @NotNull
                     @Override public Iterator<Entry<K, V>> iterator() {
-                        return identityIterator(m.entrySet(), ep);
+                        return iterator0(m.entrySet(), false, ep);
                     }
 
                     @Override public int size() {
@@ -1494,12 +1803,12 @@ public class GridFunc {
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean remove(Object o) {
-                        return ep.apply((Map.Entry<K, V>)o) && m.entrySet().remove(o);
+                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().remove(o);
                     }
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean contains(Object o) {
-                        return ep.apply((Map.Entry<K, V>)o) && m.entrySet().contains(o);
+                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
                     }
 
                     @Override public boolean isEmpty() {
@@ -1514,13 +1823,13 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Nullable @Override public V get(Object key) {
-                return p.apply((K)key) ? m.get(key) : null;
+                return isAll((K)key, p) ? m.get(key) : null;
             }
 
             @Nullable @Override public V put(K key, V val) {
                 V oldVal = get(key);
 
-                if (p.apply(key))
+                if (isAll(key, p))
                     m.put(key, val);
 
                 return oldVal;
@@ -1528,7 +1837,7 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Override public boolean containsKey(Object key) {
-                return p.apply((K)key) && m.containsKey(key);
+                return isAll((K)key, p) && m.containsKey(key);
             }
         };
     }
@@ -1542,26 +1851,38 @@ public class GridFunc {
      *
      * @param m Input map that serves as a base for the view.
      * @param trans Transformer for map value transformation.
+     * @param p Optional predicates. If predicates are not provided - all will be in the view.
      * @param <K> Type of the key.
      * @param <V> Type of the input map value.
      * @param <V1> Type of the output map value.
      * @return Light-weight view on given map with provided predicate and transformer.
      */
     public static <K0, K extends K0, V0, V extends V0, V1> Map<K, V1> viewReadOnly(@Nullable final Map<K, V> m,
-        final IgniteClosure<V, V1> trans) {
+        final IgniteClosure<V, V1> trans, @Nullable final IgnitePredicate<? super K>... p) {
         A.notNull(trans, "trans");
 
-        if (isEmpty(m))
+        if (isEmpty(m) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
+        assert m != null;
+
+        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 = identityIteratorReadOnly(m.entrySet());
+                            private Iterator<Entry<K, V>> it = iterator0(m.entrySet(), true, ep);
 
                             @Override public boolean hasNext() {
                                 return it.hasNext();
@@ -1592,7 +1913,7 @@ public class GridFunc {
                     }
 
                     @Override public int size() {
-                        return m.size();
+                        return hasPred ? F.size(m.keySet(), p) : m.size();
                     }
 
                     @SuppressWarnings({"unchecked"})
@@ -1602,25 +1923,27 @@ public class GridFunc {
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean contains(Object o) {
-                        return m.entrySet().contains(o);
+                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
                     }
 
                     @Override public boolean isEmpty() {
-                        return m.isEmpty();
+                        return hasPred ? !iterator().hasNext() : m.isEmpty();
                     }
                 };
             }
 
             @Override public boolean isEmpty() {
-                return m.isEmpty();
+                return hasPred ? entrySet().isEmpty() : m.isEmpty();
             }
 
             @SuppressWarnings({"unchecked"})
             @Nullable @Override public V1 get(Object key) {
-                V v = m.get(key);
+                if (isAll((K)key, p)) {
+                    V v = m.get(key);
 
-                if (v != null)
-                    return trans.apply(v);
+                    if (v != null)
+                        return trans.apply(v);
+                }
 
                 return null;
             }
@@ -1635,34 +1958,170 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Override public boolean containsKey(Object key) {
-                return m.containsKey(key);
+                return isAll((K)key, p) && m.containsKey(key);
             }
         };
     }
 
     /**
-     * Read-only map view of a collection.
+     * Read-only view on map that supports transformation of values and key filtering. Resulting map will
+     * only "have" keys for which all provided predicates, if any, evaluates to {@code true}.
+     * Note that only wrapping map will be created and no duplication of data will occur.
+     * Also note that if array of given predicates is not empty then method {@code size()}
+     * uses full iteration through the entry set.
+     *
+     * @param m Input map that serves as a base for the view.
+     * @param trans Transformer for map value transformation.
+     * @param p Optional predicates. If predicates are not provided - all will be in the view.
+     * @param <K> Type of the key.
+     * @param <V> Type of the input map value.
+     * @param <V1> Type of the output map value.
+     * @return Light-weight view on given map with provided predicate and transformer.
+     */
+    public static <K0, K extends K0, V0, V extends V0, V1> Map<K, V1> viewReadOnly(@Nullable final Map<K, V> m,
+        final IgniteBiClosure<K, V, V1> trans, @Nullable final IgnitePredicate<? super K>... p) {
+        A.notNull(trans, "trans");
+
+        if (isEmpty(m) || isAlwaysFalse(p))
+            return Collections.emptyMap();
+
+        assert m != null;
+
+        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);
+            }
+        };
+    }
+
+    /**
+     * Read-only map view of a collection. Resulting map is a lightweight view of an input collection,
+     * with filtered elements of an input collection as keys, and closure execution results
+     * as values. The map will only contain keys for which all provided predicates, if any, evaluate
+     * to {@code true}. Note that only wrapping map will be created and no duplication of data will occur.
+     * Also note that if array of given predicates is not empty then method {@code size()}
+     * uses full iteration through the entry set.
      *
      * @param c Input collection.
      * @param mapClo Mapping closure, that maps key to value.
+     * @param p Optional predicates to filter input collection. If predicates are not provided - all
+     *          elements will be in the view.
      * @param <K> Key type.
      * @param <V> Value type.
      * @return Light-weight view on given map with provided predicates and mapping.
      */
     @SuppressWarnings("TypeMayBeWeakened")
     public static <K0, K extends K0, V0, V extends V0> Map<K, V> viewAsMap(@Nullable final Set<K> c,
-        final IgniteClosure<? super K, V> mapClo) {
+        final IgniteClosure<? super K, V> mapClo, @Nullable final IgnitePredicate<? super K>... p) {
         A.notNull(mapClo, "trans");
 
-        if (isEmpty(c))
+        if (isEmpty(c) || isAlwaysFalse(p))
             return Collections.emptyMap();
 
+        assert c != null;
+
         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 = identityIteratorReadOnly(c);
+                            private Iterator<K> it = iterator0(c, true, ep);
 
                             @Override public boolean hasNext() {
                                 return it.hasNext();
@@ -1695,7 +2154,7 @@ public class GridFunc {
                     }
 
                     @Override public int size() {
-                        return c.size();
+                        return F.size(c, p);
                     }
 
                     @Override public boolean remove(Object o) {
@@ -1703,16 +2162,15 @@ public class GridFunc {
                     }
 
                     @Override public boolean isEmpty() {
-                        return c.isEmpty();
+                        return !iterator().hasNext();
                     }
                 };
             }
 
             @Override public boolean isEmpty() {
-                return c.isEmpty();
+                return entrySet().isEmpty();
             }
 
-            @SuppressWarnings("unchecked")
             @Nullable @Override public V get(Object key) {
                 if (containsKey(key))
                     return mapClo.apply((K)key);
@@ -1728,9 +2186,8 @@ public class GridFunc {
                 throw new UnsupportedOperationException("Remove is not supported for readonly collection view.");
             }
 
-            @SuppressWarnings("SuspiciousMethodCalls")
             @Override public boolean containsKey(Object key) {
-                return c.contains(key);
+                return isAll((K)key, p) && c.contains(key);
             }
         };
     }
@@ -1833,6 +2290,40 @@ public class GridFunc {
     }
 
     /**
+     * Utility map getter. This method analogous to {@link #addIfAbsent(Map, Object, Callable)}
+     * method but this one doesn't put the default value into the map when key is not found.
+     *
+     * @param map Map to get value from.
+     * @param key Map key (can be {@code null}).
+     * @param c Optional factory closure for the default value to be returned in
+     *      when {@code key} is not found. If closure is not provided - {@code null} will be returned.
+     * @param <K> Map key type.
+     * @param <V> Map value type.
+     * @return Value for the {@code key} or default value produced by {@code c} if key is not
+     *      found (or {@code null} if key is not found and closure is not provided).
+     * @throws GridClosureException Thrown in case when callable throws exception.
+     * @see #newLinkedList()
+     * @see #newList()
+     * @see #newSet()
+     * @see #newMap()
+     * @see #newAtomicLong()
+     * @see #newAtomicInt()
+     * @see #newAtomicRef()
+     * @see #newAtomicBoolean()
+     */
+    @Nullable public static <K, V> V returnIfAbsent(Map<? extends K, ? extends V> map, @Nullable K key,
+        @Nullable Callable<V> c) {
+        A.notNull(map, "map");
+
+        try {
+            return !map.containsKey(key) ? c == null ? null : c.call() : map.get(key);
+        }
+        catch (Exception e) {
+            throw wrap(e);
+        }
+    }
+
+    /**
      * Returns a factory closure that creates new {@link ConcurrentLinkedDeque8} instance.
      * Note that this method does not create a new closure but returns a static one.
      *
@@ -1846,6 +2337,82 @@ public class GridFunc {
     }
 
     /**
+     * Returns a factory closure that creates new {@link List} instance. Note that this
+     * method does not create a new closure but returns a static one.
+     *
+     * @param <T> Type parameters for the created {@link List}.
+     * @return Factory closure that creates new {@link List} instance every
+     *      time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> IgniteCallable<List<T>> newList() {
+        return (IgniteCallable<List<T>>)LIST_FACTORY;
+    }
+
+    /**
+     * Returns a factory closure that creates new {@link AtomicInteger} instance
+     * initialized to {@code zero}. Note that this method does not create a new
+     * closure but returns a static one.
+     *
+     * @return Factory closure that creates new {@link AtomicInteger} instance
+     *      initialized to {@code zero} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    public static IgniteCallable<AtomicInteger> newAtomicInt() {
+        return ATOMIC_INT_FACTORY;
+    }
+
+    /**
+     * Returns a factory closure that creates new {@link AtomicLong} instance
+     * initialized to {@code zero}. Note that this method does not create a new
+     * closure but returns a static one.
+     *
+     * @return Factory closure that creates new {@link AtomicLong} instance
+     *      initialized to {@code zero} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    public static IgniteCallable<AtomicLong> newAtomicLong() {
+        return ATOMIC_LONG_FACTORY;
+    }
+
+    /**
+     * Returns a factory closure that creates new {@link AtomicReference} instance
+     * initialized to {@code null}. Note that this method does not create a new closure
+     * but returns a static one.
+     *
+     * @param <T> Type of the atomic reference.
+     * @return Factory closure that creates new {@link AtomicReference} instance
+     *      initialized to {@code null} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> IgniteCallable<AtomicReference<T>> newAtomicRef() {
+        return (IgniteCallable<AtomicReference<T>>)ATOMIC_REF_FACTORY;
+    }
+
+    /**
+     * Returns a factory closure that creates new {@link AtomicBoolean} instance
+     * initialized to {@code false}. Note that this method does not create a new
+     * closure but returns a static one.
+     *
+     * @return Factory closure that creates new {@link AtomicBoolean} instance
+     *      initialized to {@code false} every time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    public static IgniteCallable<AtomicBoolean> newAtomicBoolean() {
+        return ATOMIC_BOOL_FACTORY;
+    }
+
+    /**
+     * Returns a factory closure that creates new {@link LinkedList} instance.
+     * Note that this method does not create a new closure but returns a static one.
+     *
+     * @param <T> Type parameters for the created {@link LinkedList}.
+     * @return Factory closure that creates new {@link LinkedList} instance every time its {@link
+     *         org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> IgniteCallable<LinkedList<T>> newLinkedList() {
+        return (IgniteCallable<LinkedList<T>>)LINKED_LIST_FACTORY;
+    }
+
+    /**
      * Returns a factory closure that creates new {@link Set} instance. Note that this
      * method does not create a new closure but returns a static one.
      *
@@ -1859,6 +2426,20 @@ public class GridFunc {
     }
 
     /**
+     * Returns a factory closure that creates new {@link Map} instance. Note
+     * that this method does not create a new closure but returns a static one.
+     *
+     * @param <K> Type of the key for the created {@link Map}.
+     * @param <V> Type of the value for the created {@link Map}.
+     * @return Factory closure that creates new {@link Map} instance every
+     *      time its {@link org.apache.ignite.lang.IgniteOutClosure#apply()} method is called.
+     */
+    @SuppressWarnings("unchecked")
+    public static <K, V> IgniteCallable<Map<K, V>> newMap() {
+        return (IgniteCallable<Map<K, V>>)MAP_FACTORY;
+    }
+
+    /**
      * Returns a factory closure that creates new {@link ConcurrentMap} instance.
      * Note that this method does not create a new closure but returns a static one.
      *
@@ -1885,18 +2466,6 @@ public class GridFunc {
     }
 
     /**
-     * Creates and returns iterator from given collection.
-     *
-     * @param c Input collection.
-     * @param <T> Type of the collection elements.
-     * @return Iterator from given collection and optional filtering predicate.
-     */
-    @SuppressWarnings({"unchecked"})
-    public static <T> GridIterator<T> identityIteratorReadOnly(Iterable<? extends T> c) {
-        return iteratorReadOnly(c, IDENTITY);
-    }
-
-    /**
      * Creates and returns iterator from given collection and optional filtering predicates.
      * Returned iterator will only have elements for which all given predicates evaluates to
      * {@code true} (if provided). Note that this method will not create new collection but
@@ -1904,29 +2473,16 @@ public class GridFunc {
      * evaluate to {@code true} for.
      *
      * @param c Input collection.
-     * @param p Optional filtering predicate.
+     * @param readOnly If {@code true}, then resulting iterator will not allow modifications
+     *      to the underlying collection.
+     * @param p Optional filtering predicates.
      * @param <T> Type of the collection elements.
      * @return Iterator from given collection and optional filtering predicate.
      */
     @SuppressWarnings({"unchecked"})
-    public static <T> GridIterator<T> identityIterator(Iterable<? extends T> c, IgnitePredicate<? super T> p) {
-        return iterator(c, IDENTITY, false, p);
-    }
-
-    /**
-     * Creates and returns transforming iterator from given collection.
-     *
-     * @param c Input collection.
-     * @param trans Transforming closure to convert from T1 to T2.
-     * @param <T1> Type of the collection elements.
-     * @param <T2> Type of returned elements.
-     * @return Iterator from given collection and optional filtering predicate.
-     */
-    public static <T1, T2> GridIterator<T2> iteratorReadOnly(final Iterable<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans) {
-        A.notNull(c, "c", trans, "trans");
-
-        return iterator(c.iterator(), trans, true);
+    public static <T> GridIterator<T> iterator0(Iterable<? extends T> c, boolean readOnly,
+        IgnitePredicate<? super T>... p) {
+        return F.iterator(c, IDENTITY, readOnly, p);
     }
 
     /**
@@ -1940,14 +2496,15 @@ public class GridFunc {
      * @param trans 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 p Filtering predicate.
+     * @param p Optional filtering predicates.
      * @param <T1> Type of the collection elements.
      * @param <T2> Type of returned elements.
      * @return Iterator from given collection and optional filtering predicate.
      */
     public static <T1, T2> GridIterator<T2> iterator(final Iterable<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans, final boolean readOnly, final IgnitePredicate<? super T1> p) {
-        A.notNull(c, "c", trans, "trans", p, "p");
+        final IgniteClosure<? super T1, T2> trans, final boolean readOnly,
+        @Nullable final IgnitePredicate<? super T1>... p) {
+        A.notNull(c, "c", trans, "trans");
 
         if (isAlwaysFalse(p))
             return F.emptyIterator();
@@ -1966,36 +2523,53 @@ public class GridFunc {
             private Iterator<? extends T1> iter = c.iterator();
 
             @Override public boolean hasNextX() {
-                if (!moved)
-                    return more;
+                if (isEmpty(p))
+                    return iter.hasNext();
                 else {
-                    more = false;
+                    if (!moved)
+                        return more;
+                    else {
+                        more = false;
+
+                        while (iter.hasNext()) {
+                            elem = iter.next();
 
-                    while (iter.hasNext()) {
-                        elem = iter.next();
+                            boolean isAll = true;
 
-                        if (p.apply(elem)) {
-                            more = true;
-                            moved = false;
+                            for (IgnitePredicate<? super T1> r : p)
+                                if (r != null && !r.apply(elem)) {
+                                    isAll = false;
 
-                            return true;
+                                    break;
+                                }
+
+                            if (isAll) {
+                                more = true;
+                                moved = false;
+
+                                return true;
+                            }
                         }
-                    }
 
-                    elem = null; // Give to GC.
+                        elem = null; // Give to GC.
 
-                    return false;
+                        return false;
+                    }
                 }
             }
 
             @Nullable @Override public T2 nextX() {
-                if (hasNext()) {
-                    moved = true;
+                if (isEmpty(p))
+                    return trans.apply(iter.next());
+                else {
+                    if (hasNext()) {
+                        moved = true;
 
-                    return trans.apply(elem);
+                        return trans.apply(elem);
+                    }
+                    else
+                        throw new NoSuchElementException();
                 }
-                else
-                    throw new NoSuchElementException();
             }
 
             @Override public void removeX() {
@@ -2012,22 +2586,80 @@ public class GridFunc {
      * @param trans 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 p Optional filtering predicates.
      * @return Iterator from given iterator and optional filtering predicate.
      */
-    public static <T1, T2> GridIterator<T2> iterator(final Iterator<? extends T1> c,
-        final IgniteClosure<? super T1, T2> trans, final boolean readOnly) {
+    public static <T1, T2> Iterator<T2> iterator(final Iterator<? extends T1> c,
+        final IgniteClosure<? super T1, T2> trans,
+        final boolean readOnly,
+        @Nullable final IgnitePredicate<? super T1>... p)
+    {
         A.notNull(c, "c", trans, "trans");
 
+        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() {
-                return iter.hasNext();
+                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() {
-                return trans.apply(iter.next());
+                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() {
@@ -2108,35 +2740,23 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate that evaluates to {@code true} if its free variable is not {@code null}.
+     * Gets predicate that evaluates to {@code true} if its free variable is {@code null}.
      *
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Predicate that evaluates to {@code true} if its free variable is not {@code null}.
+     * @return Predicate that evaluates to {@code true} if its free variable is {@code null}.
      */
-    @SuppressWarnings("unchecked")
-    public static <T> IgnitePredicate<T> notNull() {
-        return (IgnitePredicate<T>)IS_NOT_NULL;
+    public static <T> IgnitePredicate<T> isNull() {
+        return (IgnitePredicate<T>) IS_NULL;
     }
 
     /**
-     * Negates given predicate.
-     * <p>
-     * Gets predicate that evaluates to {@code true} if any of given predicates
-     * evaluates to {@code false}. If all predicates evaluate to {@code true} the
-     * result predicate will evaluate to {@code false}.
+     * Gets predicate that evaluates to {@code true} if its free variable is not {@code null}.
      *
-     * @param p Predicate to negate.
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
-     * @return Negated predicate.
+     * @return Predicate that evaluates to {@code true} if its free variable is not {@code null}.
      */
-    public static <T> IgnitePredicate<T> not(final IgnitePredicate<? super T> p) {
-        A.notNull(p, "p");
-
-        return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return !p.apply(t);
-            }
-        };
+    public static <T> IgnitePredicate<T> notNull() {
+        return (IgnitePredicate<T>) IS_NOT_NULL;
     }
 
     /**
@@ -2150,7 +2770,8 @@ public class GridFunc {
      * @param <T> Type of the free variable, i.e. the element the predicate is called on.
      * @return Negated predicate.
      */
-    public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>[] p) {
+    @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);
@@ -2193,13 +2814,30 @@ public class GridFunc {
     }
 
     /**
+     * Gets predicate that evaluates to {@code true} if its free variable is instance of the given class.
+     *
+     * @param cls Class to compare to.
+     * @param <T> Type of the free variable, i.e. the element the predicate is called on.
+     * @return Predicate that evaluates to {@code true} if its free variable is instance
+     *      of the given class.
+     */
+    public static <T> IgnitePredicate<T> instanceOf(final Class<?> cls) {
+        A.notNull(cls, "cls");
+
+        return new P1<T>() {
+            @Override public boolean apply(T t) {
+                return t != null && cls.isAssignableFrom(t.getClass());
+            }
+        };
+    }
+
+    /**
      * Gets first element from given collection or returns {@code null} if the collection is empty.
      *
      * @param c A collection.
      * @param <T> Type of the collection.
      * @return Collections' first element or {@code null} in case if the collection is empty.
      */
-    @SuppressWarnings("unchecked")
     public static <T> T first(@Nullable Iterable<? extends T> c) {
         if (c == null)
             return null;
@@ -2232,11 +2870,12 @@ public class GridFunc {
      * @param <T> Type of the collection.
      * @return Collections' first element or {@code null} in case if the collection is empty.
      */
-    @SuppressWarnings("unchecked")
     @Nullable public static <T> T last(@Nullable Iterable<? extends T> c) {
         if (c == null)
             return null;
 
+        assert c != null;
+
         if (c instanceof RandomAccess && c instanceof List) {
             List<T> l = (List<T>)c;
 
@@ -2321,6 +2960,8 @@ public class GridFunc {
             return F.alwaysTrue();
 
         if (F0.isAllNodePredicates(ps)) {
+            assert ps != null;
+
             Set<UUID> ids = new HashSet<>();
 
             for (IgnitePredicate<? super T> p : ps) {
@@ -2340,6 +2981,8 @@ public class GridFunc {
         else {
             return new P1<T>() {
                 @Override public boolean apply(T t) {
+                    assert ps != null;
+
                     for (IgnitePredicate<? super T> p : ps)
                         if (p != null && !p.apply(t))
                             return false;
@@ -2376,24 +3019,6 @@ public class GridFunc {
     }
 
     /**
-     * Gets predicate (not peer-deployable) that returns {@code true} if its free variable is contained
-     * in given collection.
-     *
-     * @param c Collection to check for containment.
-     * @param <T> Type of the free variable for the predicate and type of the
-     *      collection elements.
-     * @return Predicate (not peer-deployable) that returns {@code true} if its free variable is
-     *      contained in given collection.
-     */
-    public static <T> IgnitePredicate<T> in(@Nullable final Collection<? extends T> c) {
-        return isEmpty(c) ? GridFunc.<T>alwaysFalse() : new P1<T>() {
-            @Override public boolean apply(T t) {
-                return c.contains(t);
-            }
-        };
-    }
-
-    /**
      * Gets predicate that returns {@code true} if its free variable is not
      * contained in given collection.
      *
@@ -2406,6 +3031,8 @@ public class GridFunc {
     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) {
+                assert c != null;
+
                 return !c.contains(t);
             }
         };
@@ -2418,13 +3045,27 @@ public class GridFunc {
      */
     @SuppressWarnings("unchecked")
     public static <T, C extends Collection<T>> C addAll(C c, Iterable<? extends T> it) {
+        if (it == null)
+            return c;
+
+        if (it instanceof Collection<?>) {
+            c.addAll((Collection<? extends T>)it);
+
+            return c;
+        }
+
+        return addAll(c, it.iterator());
+    }
+
+    /**
+     * @param c Target collection.
+     * @param it Iterator to fetch.
+     * @return Modified target collection.
+     */
+    public static <T, C extends Collection<T>> C addAll(C c, Iterator<? extends T> it) {
         if (it != null) {
-            if (it instanceof Collection<?>)
-                c.addAll((Collection<? extends T>)it);
-            else {
-                for (T item : it)
-                    c.add(item);
-            }
+            while (it.hasNext())
+                c.add(it.next());
         }
 
         return c;
@@ -2501,7 +3142,14 @@ public class GridFunc {
      *      found (or {@code null} if key is not found and closure is not provided). Note that
      *      in case when key is not found the default value will be put into the map.
      * @throws GridClosureException Thrown in case when callable throws exception.
+     * @see #newLinkedList()
+     * @see #newList()
      * @see #newSet()
+     * @see #newMap()
+     * @see #newAtomicLong()
+     * @see #newAtomicInt()
+     * @see #newAtomicRef()
+     * @see #newAtomicBoolean()
      */
     @Nullable public static <K, V> V addIfAbsent(Map<? super K, V> map, @Nullable K key,
         @Nullable Callable<? extends V> c) {
@@ -2579,34 +3227,79 @@ public class GridFunc {
      *
      * @param c Collection to call closure over.
      * @param f Side-effect only closure to call over the collection.
+     * @param p Optional set of predicates. Only if collection element evaluates
+     *      to {@code true} for given predicates the closure will be applied to it.
+     *      If no predicates provided - closure will be applied to all collection
+     *      elements.
      * @param <X> Type of the free variable for the closure and type of the
      *      collection elements.
      */
-    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f) {
-        A.notNull(c, "c", f, "f");
+    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f,
+        @Nullable IgnitePredicate<? super X>... p) {
+        A.notNull(c, "c", f, "f");
+
+        for (X x : c)
+            if (isAll(x, p))
+                f.apply(x);
+    }
+
+    /**
+     * Calls given {@code side-effect only} closure over the each element of the provided array.
+     *
+     * @param c Array to call closure over.
+     * @param f Side-effect only closure to call over the array.
+     * @param p Optional set of predicates. Only if collection element evaluates
+     *      to {@code true} for given predicates the closure will be applied to it.
+     *      If no predicates provided - closure will be applied to all collection
+     *      elements.
+     * @param <X> Type of the free variable for the closure and type of the array
+     *      elements.
+     */
+    @SuppressWarnings("RedundantTypeArguments")
+    public static <X> void forEach(X[] c, IgniteInClosure<? super X> f, @Nullable IgnitePredicate<? super X>... p) {
+        A.notNull(c, "c", f, "f");
+
+        F.<X>forEach(asList(c), f, p);
+    }
+
+    /**
+     * Adds (copies) to given collection all elements in <tt>'from'</tt> array.
+     *
+     * @param to Collection to copy to.
+     * @param from Array to copy from.
+     * @param <T> Type of the free variable for the predicate and type of the collection elements.
+     * @return Collection to copy to.
+     */
+    public static <T> Collection<T> copy(Collection<T> to, T... from) {
+        A.notNull(to, "to", from, "from");
 
-        for (X x : c)
-            f.apply(x);
+        copy(to, asList(from));
+
+        return to;
     }
 
     /**
-     * Calls given {@code side-effect only} closure over the each element of the provided
-     * collection.
+     * Adds (copies) to given collection using provided predicates. Element is copied if all
+     * predicates evaluate to {@code true}.
      *
-     * @param c Collection to call closure over.
-     * @param f Side-effect only closure to call over the collection.
-     * @param p Optional predicate. Only if collection element evaluates
-     *      to {@code true} for given predicate the closure will be applied to it.
-     * @param <X> Type of the free variable for the closure and type of the
-     *      collection elements.
+     * @param to Collection to copy to.
+     * @param from Collection to copy from.
+     * @param p Optional set of predicates to use for filtration.
+     * @param <T> Type of the free variable for the predicate and type of the collection elements.
+     * @return Collection to copy to.
      */
-    public static <X> void forEach(Iterable<? extends X> c, IgniteInClosure<? super X> f,
-        IgnitePredicate<? super X> p) {
-        A.notNull(c, "c", f, "f", p, "f");
+    public static <T> Collection<T> copy(Collection<T> to, Iterable<? extends T> from,
+        @Nullable IgnitePredicate<? super T>... p) {
+        A.notNull(to, "to", from, "from");
 
-        for (X x : c)
-            if (p.apply(x))
-                f.apply(x);
+        if (!isAlwaysFalse(p)) {
+            for (T t : from) {
+                if (isAll(t, p))
+                    to.add(t);
+            }
+        }
+
+        return to;
     }
 
     /**
@@ -2643,6 +3336,21 @@ public class GridFunc {
     }
 
     /**
+     * Transforms an array to read only collection using provided closure.
+     *
+     * @param c Initial array to transform.
+     * @param f Closure to use for transformation.
+     * @param <X> Type of the free variable for the closure and type of the array elements.
+     * @param <Y> Type of the closure's return value.
+     * @return Transformed read only collection.
+     */
+    public static <X, Y> Collection<Y> transform(X[] c, IgniteClosure<? super X, Y> f) {
+        A.notNull(c, "c", f, "f");
+
+        return viewReadOnly(asList(c), f);
+    }
+
+    /**
      * Tests if all provided predicates evaluate to {@code true} for given value. Note that
      * evaluation will be short-circuit when first predicate evaluated to {@code false} is found.
      *
@@ -2653,7 +3361,7 @@ public class GridFunc {
      * @return Returns {@code true} if given set of predicates is {@code null}, is empty, or all predicates
      *      evaluate to {@code true} for given value, {@code false} otherwise.
      */
-    public static <T> boolean isAll(@Nullable T t, @Nullable IgnitePredicate<? super T>[] p) {
+    public static <T> boolean isAll(@Nullable T t, @Nullable IgnitePredicate<? super T>... p) {
         if (p != null)
             for (IgnitePredicate<? super T> r : p)
                 if (r != null && !r.apply(t))
@@ -2663,6 +3371,27 @@ public class GridFunc {
     }
 
     /**
+     * Tests if any of provided predicates evaluate to {@code true} for given value. Note
+     * that evaluation will be short-circuit when first predicate evaluated to {@code true}
+     * is found.
+     *
+     * @param t Value to test.
+     * @param p Optional set of predicates to use for evaluation.
+     * @param <T> Type of the value and free variable of the predicates.
+     * @return Returns {@code true} if any of predicates evaluates to {@code true} for given
+     *      value, {@code false} otherwise. Returns {@code false} if given set of predicates
+     *      is {@code null} or empty.
+     */
+    public static <T> boolean isAny(@Nullable T t, @Nullable IgnitePredicate<? super T>... p) {
+        if (p != null)
+            for (IgnitePredicate<? super T> r : p)
+                if (r != null && r.apply(t))
+                    return true;
+
+        return false;
+    }
+
+    /**
      * Creates an absolute (no-arg) closure that does nothing.
      *
      * @return Absolute (no-arg) closure that does nothing.
@@ -2682,12 +3411,14 @@ public class GridFunc {
      * @return First element in given collection for which predicate evaluates to
      *      {@code true} - or {@code null} if such element cannot be found.
      */
-    @Nullable public static <V> V find(Iterable<? extends V> c, @Nullable V dfltVal, IgnitePredicate<? super V> p) {
+    @SafeVarargs
+    @Nullable public static <V> V find(Iterable<? extends V> c, @Nullable V dfltVal,
+        @Nullable IgnitePredicate<? super V>... p) {
         A.notNull(c, "c");
 
-        if (!isAlwaysFalse(p)) {
+        if (!isEmpty(p) && !isAlwaysFalse(p)) {
             for (V v : c) {
-                if (p.apply(v))
+                if (isAny(v, p))
                     return v;
             }
         }
@@ -2696,6 +3427,35 @@ public class GridFunc {
     }
 
     /**
+     * Finds, transforms and returns first element in given collection for which any of
+     * the provided predicates evaluates to {@code true}.
+     *
+     * @param c Input collection.
+     * @param dfltVal Default value to return when no element is found.
+     * @param f Transforming closure.
+     * @param p Optional set of finder predicates.
+     * @param <V> Type of the collection elements.
+     * @return First element in given collection for which predicate evaluates to
+     *      {@code true} - or {@code null} if such element cannot be found.
+     */
+    public static <V, Y> Y find(Iterable<? extends V> c, @Nullable Y dfltVal, IgniteClosure<? super V, Y> f,
+        @Nullable IgnitePredicate<? super V>... p) {
+        A.notNull(c, "c", f, "f");
+
+        if (isAlwaysTrue(p) && c.iterator().hasNext())
+            return f.apply(c.iterator().next());
+
+        if (!isEmpty(p) && !isAlwaysFalse(p)) {
+            for (V v : c) {
+                if (isAny(v, p))
+                    return f.apply(v);
+            }
+        }
+
+        return dfltVal;
+    }
+
+    /**
      * Checks if collection {@code c1} contains any elements from collection {@code c2}.
      *
      * @param c1 Collection to check for containment. If {@code null} - this method returns {@code false}.
@@ -2722,7 +3482,7 @@ public class GridFunc {
      * @return {@code true} if collection {@code c1} contains at least one element from collection
      *      {@code c2}.
      */
-    public static <T> boolean containsAny(@Nullable Collection<? extends T> c1, @Nullable T[] c2) {
+    public static <T> boolean containsAny(@Nullable Collection<? extends T> c1, @Nullable T... c2) {
         if (c1 != null && !c1.isEmpty() && c2 != null && c2.length > 0)
             for (T t : c2)
                 if (c1.contains(t))
@@ -2766,6 +3526,35 @@ public class GridFunc {
     }
 
     /**
+     * Partitions input collection in two: first containing elements for which given
+     * predicate evaluates to {@code true} - and second containing the elements for which
+     * predicate evaluates to {@code false}.
+     *
+     * @param c Input collection.
+     * @param p Partitioning predicate.
+     * @param <V> Type of the collection elements.
+     * @return Tuple of two collections: first containing elements for which given predicate
+     *      evaluates to {@code true} - and second containing the elements for which predicate
+     *      evaluates to {@code false}.
+     */
+    public static <V> IgniteBiTuple<Collection<V>, Collection<V>> partition(Iterable<? extends V> c,
+        IgnitePredicate<? super V> p) {
+        A.notNull(c, "c", p, "p");
+
+        Collection<V> c1 = new LinkedList<>();
+        Collection<V> c2 = new LinkedList<>();
+
+        for (V v : c) {
+            if (p.apply(v))
+                c1.add(v);
+            else
+                c2.add(v);
+        }
+
+        return t(c1, c2);
+    }
+
+    /**
      * Checks for existence of the element in input collection for which all provided predicates
      * evaluate to {@code true}.
      *
@@ -2775,16 +3564,18 @@ public class GridFunc {
      * @return {@code true} if input collection contains element for which all the provided
      *      predicates evaluates to {@code true} - otherwise returns {@code false}.
      */
-    public static <V> boolean exist(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
+    public static <V> boolean exist(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
         A.notNull(c, "c");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
+        else if (isEmpty(p))
+            return true;
         else
             for (V v : c)
-                if (p.apply(v))
+                if (isAll(v, p))
                     return true;
 
         return false;
@@ -2801,16 +3592,16 @@ public class GridFunc {
      * @return Returns {@code true} if all given predicates evaluate to {@code true} for
      *      all elements. Returns {@code false} otherwise.
      */
-    public static <V> boolean forAll(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
+    public static <V> boolean forAll(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
         A.notNull(c, "c");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
-        else {
+        else if (!isEmpty(p)) {
             for (V v : c) {
-                if (!p.apply(v))
+                if (!isAll(v, p))
                     return false;
             }
         }
@@ -2830,18 +3621,17 @@ public class GridFunc {
      *      entries. Returns {@code false} otherwise.
      */
     public static <K1, K extends K1, V1, V extends V1> boolean forAll(Map<K, V> m,
-        IgnitePredicate<? super Map.Entry<K, V>> p) {
+        @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
         A.notNull(m, "m");
 
         if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
-        else {
+        else if (!isEmpty(p))
             for (Map.Entry<K, V> e : m.entrySet())
-                if (!p.apply(e))
+                if (!isAll(e, p))
                     return false;
-        }
 
         return true;
     }
@@ -2858,16 +3648,20 @@ public class GridFunc {
      * @return Returns {@code true} if all given predicates evaluate to {@code true} for
      *      at least one element. Returns {@code false} otherwise.
      */
-    public static <V> boolean forAny(Iterable<? extends V> c, IgnitePredicate<? super V> p) {
+    public static <V> boolean forAny(Iterable<? extends V> c, @Nullable IgnitePredicate<? super V>... p) {
         A.notNull(c, "c");
 
-        if (isAlwaysFalse(p))
+        if (!c.iterator().hasNext())
+            return false;
+        else if (isEmpty(p))
+            return true;
+        else if (isAlwaysFalse(p))
             return false;
         else if (isAlwaysTrue(p))
             return true;
         else {
             for (V v : c)
-                if (p.apply(v))
+                if (isAll(v, p))
                     return true;
 
             return false;
@@ -2897,17 +3691,22 @@ public class GridFunc {
      *
      * @param c Input collection.
      * @param b Optional first folding pair element.
-     * @param fs Optional folding closure.
+     * @param fs Optional set of folding closures.
      * @param <D> Type of the input collection elements and type of the free variable for the closure.
      * @param <B> Type of the folding value and return type of the closure.
      * @return Value representing folded collection.
      */
     @Nullable public static <D, B> B fold(Iterable<? extends D> c, @Nullable B b,
-        IgniteBiClosure<? super D, ? super B, B> fs) {
+        @Nullable IgniteBiClosure<? super D, ? super B, B>... fs) {
         A.notNull(c, "c");
 
-        for (D e : c)
-            b = fs.apply(e, b);
+        if (!isEmpty(fs))
+            for (D e : c) {
+                assert fs != null;
+
+                for (IgniteBiClosure<? super D, ? super B, B> f : fs)
+                    b = f.apply(e, b);
+            }
 

<TRUNCATED>

[03/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: c0cfc6a784ab94430b730d200d37788b70dc930b
Parents: b534c42 bbdb202
Author: Anton Vinogradov <av...@apache.org>
Authored: Tue Dec 22 11:54:01 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Tue Dec 22 11:54:01 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |  44 +++-
 .../internal/binary/BinaryClassDescriptor.java  |  56 ++++-
 .../ignite/internal/binary/BinaryUtils.java     |  11 +
 .../processors/cache/IgniteCacheProxy.java      |   3 +-
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../cache/VisorCacheQueryConfiguration.java     |  11 +
 .../cache/VisorCacheStoreConfiguration.java     |  13 +-
 .../internal/visor/query/VisorQueryJob.java     |   6 +
 .../binary/BinaryMarshallerSelfTest.java        | 110 +++++++++
 .../processors/query/h2/IgniteH2Indexing.java   | 118 ++++++---
 .../processors/query/h2/sql/GridSqlQuery.java   |   3 +
 .../query/h2/sql/GridSqlQuerySplitter.java      | 113 +++++----
 .../query/IgniteSqlSchemaIndexingTest.java      | 240 +++++++++++++++++++
 .../query/IgniteSqlSplitterSelfTest.java        |  52 ++++
 .../query/h2/sql/GridQueryParsingTest.java      |   9 +-
 .../IgniteBinaryCacheQueryTestSuite.java        |   3 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 .../commands/cache/VisorCacheCommand.scala      |  14 +-
 .../config/benchmark-multicast.properties       |   2 +-
 19 files changed, 709 insertions(+), 107 deletions(-)
----------------------------------------------------------------------



[06/50] [abbrv] ignite git commit: 1.5.1.final-SNAPSHOT

Posted by vo...@apache.org.
1.5.1.final-SNAPSHOT


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

Branch: refs/heads/ignite-2234
Commit: a88e96474c2c09a963ab47fe9be1f950d68964c0
Parents: 487071f
Author: Ignite Teamcity <ig...@apache.org>
Authored: Tue Dec 22 19:48:17 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Tue Dec 22 19:48:17 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/common/configure.ac                      | 2 +-
 modules/platforms/cpp/core-test/configure.ac                   | 2 +-
 modules/platforms/cpp/core/configure.ac                        | 2 +-
 modules/platforms/cpp/examples/configure.ac                    | 2 +-
 modules/platforms/cpp/ignite/configure.ac                      | 2 +-
 .../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 6 +++---
 .../Properties/AssemblyInfo.cs                                 | 6 +++---
 .../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 6 +++---
 .../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs       | 6 +++---
 .../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs  | 6 +++---
 .../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 6 +++---
 .../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs       | 6 +++---
 12 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/configure.ac b/modules/platforms/cpp/common/configure.ac
index c81873d..2772926 100644
--- a/modules/platforms/cpp/common/configure.ac
+++ b/modules/platforms/cpp/common/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite JNI bridge for C++], [1.5.0.7794], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.5.1.7796], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/configure.ac b/modules/platforms/cpp/core-test/configure.ac
index 5918135..318bac0 100644
--- a/modules/platforms/cpp/core-test/configure.ac
+++ b/modules/platforms/cpp/core-test/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Test], [1.5.0.7794], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Test], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/configure.ac b/modules/platforms/cpp/core/configure.ac
index 7f36009..e37a463 100644
--- a/modules/platforms/cpp/core/configure.ac
+++ b/modules/platforms/cpp/core/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.5.0.7794], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index c9aa6b7..57f4090 100644
--- a/modules/platforms/cpp/examples/configure.ac
+++ b/modules/platforms/cpp/examples/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Ingnite C++ examples],[1.5.0.7794],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
+AC_INIT([Ingnite C++ examples],[1.5.1.7796],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/cpp/ignite/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/configure.ac b/modules/platforms/cpp/ignite/configure.ac
index 94a5eaf..3806b83 100644
--- a/modules/platforms/cpp/ignite/configure.ac
+++ b/modules/platforms/cpp/ignite/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Runner], [1.5.0.7794], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Runner], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index d7c2416..a7452e3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("8fae8395-7e91-411a-a78f-44d6d3fed0fc")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index cebf14f..f2d50b0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,6 +45,6 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index b994c4b..f95efd2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 43f011e..94f6071 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,9 +33,9 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]
 
 [assembly: CLSCompliant(true)]
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index b2c2a17..21271e2 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index 66b0b53..aa3bf8c 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
 
 [assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/a88e9647/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 8d31149..300521d 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Reflection;
 
 [assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
 
-[assembly: AssemblyVersion("1.5.0.7794")]
-[assembly: AssemblyFileVersion("1.5.0.7794")]
-[assembly: AssemblyInformationalVersion("1.5.0.final")]
+[assembly: AssemblyVersion("1.5.1.7796")]
+[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyInformationalVersion("1.5.1.final")]


[04/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Conflicts:
	examples/pom.xml
	examples/schema-import/pom.xml
	modules/aop/pom.xml
	modules/apache-license-gen/pom.xml
	modules/aws/pom.xml
	modules/camel/pom.xml
	modules/clients/pom.xml
	modules/cloud/pom.xml
	modules/codegen/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/ignite.properties
	modules/extdata/p2p/pom.xml
	modules/extdata/uri/modules/uri-dependency/pom.xml
	modules/extdata/uri/pom.xml
	modules/flume/pom.xml
	modules/gce/pom.xml
	modules/geospatial/pom.xml
	modules/hadoop/pom.xml
	modules/hibernate/pom.xml
	modules/indexing/pom.xml
	modules/jcl/pom.xml
	modules/jms11/pom.xml
	modules/jta/pom.xml
	modules/kafka/pom.xml
	modules/log4j/pom.xml
	modules/log4j2/pom.xml
	modules/mesos/pom.xml
	modules/mqtt/pom.xml
	modules/osgi-karaf/pom.xml
	modules/osgi-paxlogging/pom.xml
	modules/osgi/pom.xml
	modules/platforms/cpp/common/configure.ac
	modules/platforms/cpp/core-test/configure.ac
	modules/platforms/cpp/core/configure.ac
	modules/platforms/cpp/examples/configure.ac
	modules/platforms/cpp/ignite/configure.ac
	modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
	modules/rest-http/pom.xml
	modules/scalar-2.10/pom.xml
	modules/scalar/pom.xml
	modules/schedule/pom.xml
	modules/schema-import/pom.xml
	modules/slf4j/pom.xml
	modules/spark-2.10/pom.xml
	modules/spark/pom.xml
	modules/spring/pom.xml
	modules/ssh/pom.xml
	modules/tools/pom.xml
	modules/twitter/pom.xml
	modules/urideploy/pom.xml
	modules/visor-console-2.10/pom.xml
	modules/visor-console/pom.xml
	modules/visor-plugins/pom.xml
	modules/web/pom.xml
	modules/yardstick/pom.xml
	modules/yarn/pom.xml
	modules/zookeeper/pom.xml
	pom.xml

Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Conflicts:
	benchmarks/cache-comparison/pom.xml
	benchmarks/filesystem/hadoop1/pom.xml
	benchmarks/filesystem/hadoop2/pom.xml
	benchmarks/mongo/pom.xml
	benchmarks/risk-analytics/pom.xml
	benchmarks/serialization/pom.xml
	benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
	examples/pom.xml
	modules/clients/pom.xml
	modules/codegen/pom.xml
	modules/compatibility/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/gridgain.properties
	modules/diagnostic/pom.xml
	modules/dr-demo/pom.xml
	modules/license-gen/pom.xml
	modules/mongo-sniffer/pom.xml
	modules/mongo-visor/pom.xml
	modules/mongo/pom.xml
	modules/platforms/cpp/core-test/configure.ac
	modules/platforms/cpp/core/configure.ac
	modules/platforms/cpp/examples/configure.ac
	modules/platforms/dotnet/examples/GridGainExamples/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/GridGainExamplesDll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-examples-test/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-dll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain/Properties/AssemblyInfo.cs
	modules/tools/pom.xml
	modules/visor-console/pom.xml
	modules/visor-demo/pom.xml
	modules/visor-tester-plugin/pom.xml
	modules/visor-tester/pom.xml
	modules/visor/pom.xml
	modules/yardstick/dotnet/Properties/AssemblyInfo.cs
	modules/yardstick/pom.xml
	parent/pom.xml
	pilots/chronotrack/pom.xml
	pilots/ctb/pom.xml
	pilots/dsi/pom.xml
	pilots/ionic/pom.xml
	pilots/sb/pom.xml
	pilots/sony/pom.xml
	pilots/wellsfargo/pom.xml
	pilots/worldpay/pom.xml
	pom.xml


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

Branch: refs/heads/ignite-2234
Commit: 55645c1bcca21d03f2789f97bbdc3658216ee529
Parents: c0cfc6a b6dab09
Author: Anton Vinogradov <av...@apache.org>
Authored: Tue Dec 22 19:26:52 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Tue Dec 22 19:26:52 2015 +0300

----------------------------------------------------------------------
 assembly/dependencies-fabric-lgpl.xml           |   7 +
 assembly/dependencies-fabric.xml                |   7 +
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../ignite/internal/IgniteVersionUtils.java     |   5 +-
 .../internal/binary/GridBinaryMarshaller.java   |  10 ++
 .../binary/CacheObjectBinaryProcessorImpl.java  |   3 +
 .../ignite/lang/IgniteProductVersion.java       |   2 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../product/GridProductVersionSelfTest.java     |  22 ++-
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |   2 +-
 ...teCacheFullTextQueryNodeJoiningSelfTest.java | 145 +++++++++++++++++++
 modules/jcl/pom.xml                             |   2 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 modules/osgi-karaf/pom.xml                      |   2 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |   2 +-
 modules/platforms/cpp/common/configure.ac       |   2 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   2 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 .../config/benchmark-multicast.properties       |   6 +-
 modules/yardstick/pom.xml                       |   2 +-
 .../cache/IgnitePutTxImplicitBenchmark.java     |  52 +++++++
 .../cache/IgnitePutTxOffHeapBenchmark.java      |   2 +-
 .../IgnitePutTxOffHeapValuesBenchmark.java      |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 pom.xml                                         |   4 +-
 76 files changed, 336 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index c29d05e,859620c..d7c2416
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index 0e5dd87,1fc5582..cebf14f
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 311fa79,bd3237c..b994c4b
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index e7d8ccd,f7e2f86..43f011e
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index cd6f9d4,ab59db5..b2c2a17
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index 5e1b163,e9c35d3..66b0b53
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.

http://git-wip-us.apache.org/repos/asf/ignite/blob/55645c1b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 50c1195,5d251b7..8d31149
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
   * 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.


[24/50] [abbrv] ignite git commit: Merge branch 'ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge branch 'ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: 8e6b365eb873cf4fce9efd61ac9f75648c957c12
Parents: d62b905 f97dc9f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 28 17:34:11 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 28 17:34:11 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  3 +
 RELEASE_NOTES.txt                               |  2 +
 assembly/release-fabric-base.xml                |  6 ++
 modules/platforms/cpp/DEVNOTES.txt              | 59 ++++++++++++++++++
 modules/platforms/cpp/README.txt                | 64 +++++---------------
 modules/platforms/cpp/project/vs/ignite.sln     |  6 +-
 modules/platforms/cpp/project/vs/ignite.slnrel  | 10 +++
 .../platforms/cpp/project/vs/ignite_x86.slnrel  | 10 +++
 parent/pom.xml                                  |  2 +-
 9 files changed, 108 insertions(+), 54 deletions(-)
----------------------------------------------------------------------



[20/50] [abbrv] ignite git commit: IGNITE-2306: CPP: Added standalone node project to published solutions.

Posted by vo...@apache.org.
IGNITE-2306: CPP: Added standalone node project to published solutions.


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

Branch: refs/heads/ignite-2234
Commit: f023c051b46811eece46b97fa040bee07ce474d3
Parents: ed8f9fc
Author: isapego <is...@gridgain.com>
Authored: Mon Dec 28 16:17:05 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 28 16:17:05 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/project/vs/ignite.sln        |  6 ++----
 modules/platforms/cpp/project/vs/ignite.slnrel     | 10 ++++++++++
 modules/platforms/cpp/project/vs/ignite_x86.slnrel | 10 ++++++++++
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f023c051/modules/platforms/cpp/project/vs/ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/project/vs/ignite.sln b/modules/platforms/cpp/project/vs/ignite.sln
index c573606..8b561e6 100644
--- a/modules/platforms/cpp/project/vs/ignite.sln
+++ b/modules/platforms/cpp/project/vs/ignite.sln
@@ -1,8 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\project\vs\common.vcxproj", "{4F7E4917-4612-4B96-9838-025711ADE391}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"

http://git-wip-us.apache.org/repos/asf/ignite/blob/f023c051/modules/platforms/cpp/project/vs/ignite.slnrel
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/project/vs/ignite.slnrel b/modules/platforms/cpp/project/vs/ignite.slnrel
index 7456097..8b7ad35 100644
--- a/modules/platforms/cpp/project/vs/ignite.slnrel
+++ b/modules/platforms/cpp/project/vs/ignite.slnrel
@@ -5,6 +5,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\proj
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ignite", "..\..\ignite\project\vs\ignite.vcxproj", "{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Release|x64 = Release|x64
@@ -26,6 +28,14 @@ Global
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.ActiveCfg = Debug|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.Build.0 = Debug|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.ActiveCfg = Debug|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.Build.0 = Debug|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.ActiveCfg = Release|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.Build.0 = Release|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.ActiveCfg = Release|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

http://git-wip-us.apache.org/repos/asf/ignite/blob/f023c051/modules/platforms/cpp/project/vs/ignite_x86.slnrel
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/project/vs/ignite_x86.slnrel b/modules/platforms/cpp/project/vs/ignite_x86.slnrel
index b716b49..59c5434 100644
--- a/modules/platforms/cpp/project/vs/ignite_x86.slnrel
+++ b/modules/platforms/cpp/project/vs/ignite_x86.slnrel
@@ -5,6 +5,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\..\common\proj
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\vs\core.vcxproj", "{E2DEA693-F2EA-43C2-A813-053378F6E4DB}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ignite", "..\..\ignite\project\vs\ignite.vcxproj", "{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Release|Win32 = Release|Win32
@@ -26,6 +28,14 @@ Global
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|Win32.Build.0 = Release|Win32
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.ActiveCfg = Release|x64
 		{E2DEA693-F2EA-43C2-A813-053378F6E4DB}.Release|x64.Build.0 = Release|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.ActiveCfg = Debug|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.Build.0 = Debug|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.ActiveCfg = Debug|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.Build.0 = Debug|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.ActiveCfg = Release|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.Build.0 = Release|Win32
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.ActiveCfg = Release|x64
+		{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE


[27/50] [abbrv] ignite git commit: IGNITE-2288: Changed F.first(Iterable) to use index-based lookup for Lists.

Posted by vo...@apache.org.
IGNITE-2288: Changed F.first(Iterable) to use index-based lookup for Lists.


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

Branch: refs/heads/ignite-2234
Commit: 4a1a80c273d0e62589314af1dcadbc5c438d616f
Parents: 03ad6aa
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Tue Dec 29 11:20:29 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Dec 29 11:20:29 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/internal/util/lang/GridFunc.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1a80c2/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 8eeca6b..0678657 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
@@ -2842,6 +2842,9 @@ public class GridFunc {
         if (c == null)
             return null;
 
+        if (c instanceof List)
+            return first((List<? extends T>)c);
+
         Iterator<? extends T> it = c.iterator();
 
         return it.hasNext() ? it.next() : null;


[07/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2


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

Branch: refs/heads/ignite-2234
Commit: fad8b7a5a25788193522554b47b3d425c4ff1a4f
Parents: a88e964 fe14099
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Dec 24 12:34:30 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Dec 24 12:34:30 2015 +0300

----------------------------------------------------------------------
 README.txt                                      |   4 +-
 .../internal/binary/BinaryObjectImpl.java       |   2 +-
 .../managers/communication/GridIoManager.java   |  39 +-
 .../processors/cache/GridCacheAdapter.java      |  47 ++-
 .../processors/cache/GridCacheProxyImpl.java    |  29 ++
 .../cache/GridCacheSharedContext.java           |  10 +-
 .../processors/cache/IgniteCacheProxy.java      |  35 ++
 .../processors/cache/IgniteInternalCache.java   |  26 ++
 .../binary/CacheObjectBinaryProcessorImpl.java  |   4 +-
 .../distributed/dht/GridDhtLockFuture.java      |   2 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  95 +++--
 .../dht/atomic/GridNearAtomicUpdateFuture.java  | 150 ++++---
 .../colocated/GridDhtColocatedLockFuture.java   |  11 +-
 .../distributed/near/GridNearLockFuture.java    |  11 +-
 ...arOptimisticSerializableTxPrepareFuture.java |   5 +-
 .../near/GridNearOptimisticTxPrepareFuture.java |   5 +-
 ...ridNearOptimisticTxPrepareFutureAdapter.java |  12 +-
 .../query/GridCacheDistributedQueryManager.java |   6 +-
 .../transactions/IgniteTxLocalAdapter.java      |   2 +
 .../cache/transactions/IgniteTxManager.java     |  61 ++-
 .../datastreamer/DataStreamProcessor.java       |  12 +-
 .../processors/query/GridQueryProcessor.java    |   5 +
 .../ignite/internal/util/lang/GridFunc.java     |   1 +
 .../internal/visor/util/VisorTaskUtils.java     | 122 +++++-
 .../test/config/websession/example-cache.xml    |   9 +-
 ...niteClientReconnectFailoverAbstractTest.java |   3 +-
 .../binary/BinaryMarshallerSelfTest.java        |  87 ++--
 .../cache/GridCacheAbstractFullApiSelfTest.java |  22 +-
 .../cache/GridCacheAbstractSelfTest.java        |   3 +-
 ...iteCacheScanPredicateDeploymentSelfTest.java | 114 +++++
 ...yMetadataUpdateChangingTopologySelfTest.java |   7 +-
 ...niteBinaryMetadataUpdateNodeRestartTest.java | 411 +++++++++++++++++++
 .../distributed/IgniteCacheManyClientsTest.java |   2 +
 ...ContinuousQueryFailoverAbstractSelfTest.java | 128 +++---
 ...ridCacheContinuousQueryAbstractSelfTest.java |   3 +
 .../service/ClosureServiceClientsNodesTest.java |  22 +-
 .../GridServiceProcessorStopSelfTest.java       |  21 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |  21 +
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java |  14 +-
 .../testframework/GridSpiTestContext.java       |  18 +-
 .../testsuites/IgniteCacheTestSuite3.java       |   2 +
 .../p2p/CacheDeploymentAlwaysTruePredicate.java |  29 ++
 .../ignite/tests/p2p/cache/PersonWrapper.java   | 121 ++++++
 .../processors/query/h2/IgniteH2Indexing.java   |   2 +-
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  |  16 +-
 ...eBinaryWrappedObjectFieldsQuerySelfTest.java |  28 ++
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   2 +-
 .../IgniteBinaryCacheQueryTestSuite.java        |   4 +
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +
 .../cache/websession/WebSessionFilter.java      |  82 ++--
 .../cache/websession/WebSessionListener.java    |  25 +-
 .../internal/websession/WebSessionSelfTest.java |   2 -
 52 files changed, 1511 insertions(+), 387 deletions(-)
----------------------------------------------------------------------



[38/50] [abbrv] ignite git commit: IGNITE-2330: Simplified GridFunc.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
index b999e2a..e5d247a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple3.java
@@ -34,7 +34,6 @@ import org.jetbrains.annotations.Nullable;
  * 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#t3()
  * @see GridFunc#t(Object, Object, Object)
  */
 public class GridTuple3<V1, V2, V3> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
index c95a859..d1e69b5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple4.java
@@ -34,7 +34,6 @@ import org.jetbrains.annotations.Nullable;
  * 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#t4()
  * @see GridFunc#t(Object, Object, Object, Object)
  */
 public class GridTuple4<V1, V2, V3, V4> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
index 9790f48..7d25996 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple5.java
@@ -34,7 +34,6 @@ import org.jetbrains.annotations.Nullable;
  * 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#t5()
  * @see GridFunc#t(Object, Object, Object, Object, Object)
  */
 public class GridTuple5<V1, V2, V3, V4, V5> implements Iterable<Object>, Externalizable, Cloneable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
index 044944b..c904587 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridTuple6.java
@@ -34,7 +34,6 @@ import org.jetbrains.annotations.Nullable;
  * 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#t5()
  * @see GridFunc#t(Object, Object, Object, Object, Object)
  */
 public class GridTuple6<V1, V2, V3, V4, V5, V6> implements Iterable<Object>, Externalizable,

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/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 225366a..58e18aa 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...)
  */
 public class GridTupleV implements Iterable<Object>, Externalizable, Cloneable {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
index 5c6bb9a..44ca067 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java
@@ -186,7 +186,7 @@ public final class IgniteUuid implements Comparable<IgniteUuid>, Iterable<Ignite
 
     /** {@inheritDoc} */
     @Override public GridIterator<IgniteUuid> iterator() {
-        return F.iterator(Collections.singleton(this), F.<IgniteUuid>identity(), true);
+        return F.identityIteratorReadOnly(Collections.singleton(this));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
index c7c635e..56a627a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
@@ -216,6 +216,7 @@ public class MemoryEventStorageSpi extends IgniteSpiAdapter implements EventStor
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override public <T extends Event> Collection<T> localEvents(IgnitePredicate<T> p) {
         A.notNull(p, "p");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
index 59a3eca..1e868b7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
@@ -335,7 +336,8 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
                             map = new HashMap<>();
                         }
 
-                        map.put(new ObjectKey(String.valueOf(i)), F.rand(vals));
+                        map.put(new ObjectKey(String.valueOf(i)),
+                            vals[ThreadLocalRandom.current().nextInt(vals.length)]);
                     }
 
                     if (!map.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
index cb24e54..52737e7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
@@ -757,7 +757,7 @@ public abstract class GridCacheEventAbstractTest extends GridCacheAbstractSelfTe
             if (TEST_INFO)
                 X.println("Cache event: " + evt.shortDisplay());
 
-            AtomicInteger cntr = F.addIfAbsent(cntrs, evt.type(), F.newAtomicInt());
+            AtomicInteger cntr = F.addIfAbsent(cntrs, evt.type(), new AtomicInteger());
 
             assert cntr != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
index 1aae999..3482fd6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
@@ -517,12 +517,16 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes
          * @param shmemIds Shared memory IDs string.
          */
         public void shmemIds(String shmemIds) {
-            this.shmemIds = (shmemIds == null) ? null :
-                F.transform(shmemIds.split(","), new C1<String, Integer>() {
-                    @Override public Integer apply(String s) {
-                        return Long.valueOf(s).intValue();
-                    }
-                });
+            if (shmemIds == null)
+                this.shmemIds = null;
+            else {
+                String[] tokens = shmemIds.split(",");
+
+                this.shmemIds = new ArrayList<>(tokens.length);
+
+                for (String token : tokens)
+                    this.shmemIds.add(Long.valueOf(token).intValue());
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
index 37e7afe..353367e 100644
--- a/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/lang/GridBasicPerformanceTest.java
@@ -748,8 +748,14 @@ public class GridBasicPerformanceTest {
         for (int i = 0; i < MAX; i++) {
             if (sort)
                 Arrays.binarySearch(arr, ThreadLocalRandom8.current().nextInt(lim));
-            else
-                F.contains(arr, ThreadLocalRandom8.current().nextInt(lim));
+            else {
+                int val = ThreadLocalRandom8.current().nextInt(lim);
+
+                for (long arrItem : arr) {
+                    if (arrItem == val)
+                        break;
+                }
+            }
         }
 
         long time =  System.currentTimeMillis() - start;

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java
deleted file mode 100644
index 5afd75f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/lang/GridFuncPerformanceTest.java
+++ /dev/null
@@ -1,102 +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.lang;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.apache.ignite.internal.util.lang.GridIterator;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.apache.ignite.testframework.junits.common.GridCommonTest;
-
-/**
- * GridFunc performance test.
- */
-@GridCommonTest(group = "Lang")
-public class GridFuncPerformanceTest extends GridCommonAbstractTest {
-    /**
-     *  Creates test.
-     */
-    public GridFuncPerformanceTest() {
-        super(/*start grid*/false);
-    }
-
-    /**
-     *
-     */
-    public void testTransformingIteratorPerformance() {
-        // Warmup.
-        testBody();
-        testBody();
-        testBody();
-
-        long r1 = testBody();
-        long r2 = testBody();
-        long r3 = testBody();
-
-        double r = (r1 + r2 + r3) / 3.f;
-
-        System.out.println("Average result is: " + Math.round(r) + "msec.");
-    }
-
-    /**
-     *
-     * @return Duration of the test.
-     */
-    @SuppressWarnings({"UnusedDeclaration"})
-    private long testBody() {
-        int MAX = 20000000;
-
-        Collection<Integer> l = new ArrayList<>(MAX);
-
-        for (int i = 0; i < MAX / 10; i++)
-            l.add(i);
-
-        IgniteClosure<Integer, Integer> c = new IgniteClosure<Integer, Integer>() {
-            @Override public Integer apply(Integer e) {
-                return e;
-            }
-        };
-
-        IgnitePredicate<Integer> p1 = new IgnitePredicate<Integer>() {
-            @Override public boolean apply(Integer e) {
-                return e % 2 == 0;
-            }
-        };
-        IgnitePredicate<Integer> p2 = new IgnitePredicate<Integer>() {
-            @Override public boolean apply(Integer e) {
-                return e % 2 != 0;
-            }
-        };
-
-        GridIterator<Integer> iter = F.iterator(l, c, true, p1, p2);
-
-        long n = 0;
-
-        long start = System.currentTimeMillis();
-
-        for (Integer i : iter)
-            n += i;
-
-        long duration = System.currentTimeMillis() - start;
-
-        System.out.println("Duration: " + duration + "msec.");
-
-        return duration;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java b/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
index 5d517a4..10b140e 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtest/GridLoadTestStatistics.java
@@ -107,7 +107,7 @@ public class GridLoadTestStatistics {
                     AtomicInteger cnt;
 
                     synchronized (nodeCnts) {
-                        cnt = F.addIfAbsent(nodeCnts, id, F.newAtomicInt());
+                        cnt = F.addIfAbsent(nodeCnts, id, new AtomicInteger());
                     }
 
                     assert cnt != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/80579253/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 28adeee..9582df0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -24,10 +24,10 @@ import java.util.Iterator;
 import java.util.NavigableMap;
 import java.util.concurrent.ConcurrentNavigableMap;
 import java.util.concurrent.ConcurrentSkipListMap;
-import org.apache.ignite.internal.util.GridEmptyIterator;
 import org.apache.ignite.internal.util.offheap.unsafe.GridOffHeapSnapTreeMap;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeGuard;
 import org.apache.ignite.internal.util.snaptree.SnapTreeMap;
+import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.indexing.IndexingQueryFilter;
@@ -319,7 +319,7 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
             comparable(last, 1));
 
         if (range == null)
-            return new GridEmptyIterator<>();
+            return F.emptyIterator();
 
         return filter(range.values().iterator());
     }


[13/50] [abbrv] ignite git commit: IGNITE-2296

Posted by vo...@apache.org.
IGNITE-2296


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

Branch: refs/heads/ignite-2234
Commit: fe44a566079504038627a8d2a4bf74b28e1dbb60
Parents: dd0a8d3
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 13:41:01 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 13:41:01 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/rest/protocols/http/jetty/rest.html | 2 +-
 modules/scalar-2.10/pom.xml                                        | 2 +-
 modules/scalar/pom.xml                                             | 2 +-
 parent/pom.xml                                                     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fe44a566/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/rest.html
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/rest.html b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/rest.html
index a487921..f78d26a 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/rest.html
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/rest.html
@@ -55,7 +55,7 @@
     <br>
     <br>
     <center>
-        <a class="img_link" href="https://apache.org/projects/ignite.html" title="Apache Software Foundation">
+        <a class="img_link" href="https://ignite.apache.org" title="Apache Software Foundation">
             <img src="http://ignite.apache.org/images/logo3.png" alt="Ignite - In-Memory Data Fabric">
         </a>
         <p>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe44a566/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 0cc030d..62c65f9 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -158,7 +158,7 @@
                                             <!--<td>-->
                                                 <!--<nobr>Ignite&#153; - Scalar DSL, ver. <strong>${project.version}</strong></nobr>-->
                                                 <!--<br>-->
-                                                <!--<a target=_blank href="https://apache.org/projects/ignite.html"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>-->
+                                                <!--<a target=_blank href="https://ignite.apache.org"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>-->
                                             <!--</td>-->
                                         <!--</tr>-->
                                         <!--</table>-->

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe44a566/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 8a503e4..c5886ae 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -143,7 +143,7 @@
                                             <td>
                                                 <nobr>Ignite&#153; - Scalar DSL, ver. <strong>${project.version}</strong></nobr>
                                                 <br>
-                                                <a target=_blank href="https://apache.org/projects/ignite.html"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>
+                                                <a target=_blank href="https://ignite.apache.org"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>
                                             </td>
                                         </tr>
                                         </table>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe44a566/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f665d40..b7b417b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -448,7 +448,7 @@
                                                 <tbody style="padding: 0; margin: 0">
                                                     <tr style="padding: 0; margin: 0">
                                                         <td>
-                                                            <a target=_blank href="https://apache.org/projects/ignite.html"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>
+                                                            <a target=_blank href="https://ignite.apache.org"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a>
                                                         </td>
                                                     </tr>
                                                 </tbody>


[22/50] [abbrv] ignite git commit: Add Camel Streamer and OSGi to release notes.

Posted by vo...@apache.org.
Add Camel Streamer and OSGi to release notes.


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

Branch: refs/heads/ignite-2234
Commit: 156e7879eeff34ec7ee5256dac6adb91c9b4fc9b
Parents: 46b8f01
Author: Raul Kripalani <ra...@apache.org>
Authored: Mon Dec 28 13:30:44 2015 +0000
Committer: Raul Kripalani <ra...@apache.org>
Committed: Mon Dec 28 13:30:53 2015 +0000

----------------------------------------------------------------------
 RELEASE_NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/156e7879/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index b0822c9..2e9625e 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -11,6 +11,8 @@ Apache Ignite In-Memory Data Fabric 1.5
 * Added MQTT Streamer.
 * Added Twitter Streamer.
 * Added Ignite Sink (integration with Apache Flume).
+* Added Apache Camel Streamer.
+* Added OSGi support.
 * Fixed optimistic serializable transactions: implemented "deadlock-free" locking algorithm.
 * Fixed failover for continuous queries.
 * Fixed compilation and runtime errors under OpenJDK and IBM JDK.


[18/50] [abbrv] ignite git commit: IGNITE-2305: Splited C++ README into README and DEVNOTES.

Posted by vo...@apache.org.
IGNITE-2305: Splited C++ README into README and DEVNOTES.

Signed-off-by: Anton Vinogradov <av...@apache.org>


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

Branch: refs/heads/ignite-2234
Commit: cdda4b524eb4cf600b0da367b738603ef8a287db
Parents: 23d7e25
Author: isapego <is...@gridgain.com>
Authored: Mon Dec 28 14:56:25 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 15:50:40 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/DEVNOTES.txt | 84 +++++++++++++++++++++++++++++++++
 modules/platforms/cpp/README.txt   | 82 ++------------------------------
 2 files changed, 87 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cdda4b52/modules/platforms/cpp/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/DEVNOTES.txt b/modules/platforms/cpp/DEVNOTES.txt
new file mode 100644
index 0000000..c97d04c
--- /dev/null
+++ b/modules/platforms/cpp/DEVNOTES.txt
@@ -0,0 +1,84 @@
+Apache Ignite C++ Build Instructions
+====================================
+
+Building on Linux With Autotools
+----------------------------------
+
+Common Requirements:
+
+ * GCC, g++, autotools, automake, and libtool must be installed
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Build Apache Ignite C++ helper "common" library:
+     * Navigate to the directory $IGNITE_HOME/platforms/cpp/common
+     * Execute the following commands one by one:
+         * libtoolize
+         * aclocal
+         * autoheader
+         * automake --add-missing
+         * autoreconf
+         * ./configure
+         * make
+         * make install
+ * Build Apache Ignite C++ library:
+     * Navigate to the directory $IGNITE_HOME/platforms/cpp/core
+     * Execute the following commands one by one:
+         * libtoolize
+         * aclocal
+         * autoheader
+         * automake --add-missing
+         * autoreconf
+         * ./configure
+         * make
+         * make install
+
+NOTE: "make install" command may require superuser privileges. In this case it must be
+executed as "sudo make install".
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Once both libraries are built and installed, required headers are placed in the
+   "/usr/local/include/ignite" directory.
+ * Apache Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
+   Add this directory to headers search path: "-I${JAVA_HOME}/include".
+ * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
+ * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
+   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
+
+
+Building on Windows with Visual Studio (tm)
+----------------------------------
+
+Common Requirements:
+
+ * Microsoft Visual Studio (tm) 2010 or later
+ * Windows SDK 7.1
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Open and build %IGNITE_HOME%\platforms\cpp\project\vs\ignite.sln (or ignite_86.sln if you are running
+   32-bit platform).
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Update Include Directories in Project Properties with paths to:
+   * $(IGNITE_HOME)\platforms\cpp\core\include
+   * $(IGNITE_HOME)\platforms\cpp\core\os\win\include
+   * $(IGNITE_HOME)\platforms\cpp\common\include
+   * $(IGNITE_HOME)\platforms\cpp\common\os\win\include
+   * $(JAVA_HOME)\include
+   * $(JAVA_HOME)\include\win32
+ * Update Library Directories with path to the built binaries
+ * Update Linker\Input\Additional Dependencies in Project Properties with path to
+   * ignite.common.lib
+   * ignite.core.lib
+ * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
+   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
+   your project with help of PostBuild events.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cdda4b52/modules/platforms/cpp/README.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/README.txt b/modules/platforms/cpp/README.txt
index 7053964..74dec60 100644
--- a/modules/platforms/cpp/README.txt
+++ b/modules/platforms/cpp/README.txt
@@ -18,84 +18,8 @@ Support for the following will be added in next releases:
 
 Full source code is provided. Users should build the library for intended platform.
 
-Building on Linux With Autotools
-----------------------------------
+Output files list:
 
-Common Requirements:
+ * ignite.exe - executable to start standalone Ignite C++ node.
+ * ignite.core.dll - Ignite C++ API library.
 
- * GCC, g++, autotools, automake, and libtool must be installed
- * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
- * JAVA_HOME environment variable must be set pointing to Java installation directory.
-
-Building the library:
-
- * Build Apache Ignite C++ helper "common" library:
-     * Navigate to the directory $IGNITE_HOME/platforms/cpp/common
-     * Execute the following commands one by one:
-         * libtoolize
-         * aclocal
-         * autoheader
-         * automake --add-missing
-         * autoreconf
-         * ./configure
-         * make
-         * make install
- * Build Apache Ignite C++ library:
-     * Navigate to the directory $IGNITE_HOME/platforms/cpp/core
-     * Execute the following commands one by one:
-         * libtoolize
-         * aclocal
-         * autoheader
-         * automake --add-missing
-         * autoreconf
-         * ./configure
-         * make
-         * make install
-
-NOTE: "make install" command may require superuser privileges. In this case it must be
-executed as "sudo make install".
-
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Once both libraries are built and installed, required headers are placed in the
-   "/usr/local/include/ignite" directory.
- * Apache Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
-   Add this directory to headers search path: "-I${JAVA_HOME}/include".
- * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
- * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
-   $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
-
-
-Building on Windows with Visual Studio (tm)
-----------------------------------
-
-Common Requirements:
-
- * Microsoft Visual Studio (tm) 2010 or later
- * Windows SDK 7.1
- * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
- * JAVA_HOME environment variable must be set pointing to Java installation directory.
-
-Building the library:
-
- * Open and build %IGNITE_HOME%\platforms\cpp\project\vs\ignite.sln (or ignite_86.sln if you are running
-   32-bit platform).
-
-Development:
-
- * IGNITE_HOME environment variable must be set to Ignite installation directory.
- * Update Include Directories in Project Properties with paths to:
-   * $(IGNITE_HOME)\platforms\cpp\core\include
-   * $(IGNITE_HOME)\platforms\cpp\core\os\win\include
-   * $(IGNITE_HOME)\platforms\cpp\common\include
-   * $(IGNITE_HOME)\platforms\cpp\common\os\win\include
-   * $(JAVA_HOME)\include
-   * $(JAVA_HOME)\include\win32
- * Update Library Directories with path to the built binaries
- * Update Linker\Input\Additional Dependencies in Project Properties with path to
-   * ignite.common.lib
-   * ignite.core.lib
- * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
-   to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
-   your project with help of PostBuild events.


[31/50] [abbrv] ignite git commit: Minor fix.

Posted by vo...@apache.org.
Minor fix.


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

Branch: refs/heads/ignite-2234
Commit: ce2a29b073b7934f2c5a04e6a076f4f07eed4ccc
Parents: 2613b95
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Dec 29 15:50:39 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Dec 29 15:50:39 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/version/GridCachePlainVersionedEntry.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ce2a29b0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
index c0eb4db..e1da1c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
@@ -111,7 +111,7 @@ public class GridCachePlainVersionedEntry<K, V> implements GridCacheVersionedEnt
 
     /** {@inheritDoc} */
     @Override public long globalTime() {
-        return ver.globalTime();
+        return isStartVer ? 0L : ver.globalTime();
     }
 
     /** {@inheritDoc} */


[05/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Conflicts:
	examples/pom.xml
	examples/schema-import/pom.xml
	modules/aop/pom.xml
	modules/apache-license-gen/pom.xml
	modules/aws/pom.xml
	modules/camel/pom.xml
	modules/clients/pom.xml
	modules/cloud/pom.xml
	modules/codegen/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/ignite.properties
	modules/extdata/p2p/pom.xml
	modules/extdata/uri/modules/uri-dependency/pom.xml
	modules/extdata/uri/pom.xml
	modules/flume/pom.xml
	modules/gce/pom.xml
	modules/geospatial/pom.xml
	modules/hadoop/pom.xml
	modules/hibernate/pom.xml
	modules/indexing/pom.xml
	modules/jcl/pom.xml
	modules/jms11/pom.xml
	modules/jta/pom.xml
	modules/kafka/pom.xml
	modules/log4j/pom.xml
	modules/log4j2/pom.xml
	modules/mesos/pom.xml
	modules/mqtt/pom.xml
	modules/osgi-karaf/pom.xml
	modules/osgi-paxlogging/pom.xml
	modules/osgi/pom.xml
	modules/platforms/cpp/common/configure.ac
	modules/platforms/cpp/core-test/configure.ac
	modules/platforms/cpp/core/configure.ac
	modules/platforms/cpp/examples/configure.ac
	modules/platforms/cpp/ignite/configure.ac
	modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
	modules/rest-http/pom.xml
	modules/scalar-2.10/pom.xml
	modules/scalar/pom.xml
	modules/schedule/pom.xml
	modules/schema-import/pom.xml
	modules/slf4j/pom.xml
	modules/spark-2.10/pom.xml
	modules/spark/pom.xml
	modules/spring/pom.xml
	modules/ssh/pom.xml
	modules/tools/pom.xml
	modules/twitter/pom.xml
	modules/urideploy/pom.xml
	modules/visor-console-2.10/pom.xml
	modules/visor-console/pom.xml
	modules/visor-plugins/pom.xml
	modules/web/pom.xml
	modules/yardstick/pom.xml
	modules/yarn/pom.xml
	modules/zookeeper/pom.xml
	pom.xml

Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1.5.1-2

Conflicts:
	benchmarks/cache-comparison/pom.xml
	benchmarks/filesystem/hadoop1/pom.xml
	benchmarks/filesystem/hadoop2/pom.xml
	benchmarks/mongo/pom.xml
	benchmarks/risk-analytics/pom.xml
	benchmarks/serialization/pom.xml
	benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
	examples/pom.xml
	modules/clients/pom.xml
	modules/codegen/pom.xml
	modules/compatibility/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/gridgain.properties
	modules/diagnostic/pom.xml
	modules/dr-demo/pom.xml
	modules/license-gen/pom.xml
	modules/mongo-sniffer/pom.xml
	modules/mongo-visor/pom.xml
	modules/mongo/pom.xml
	modules/platforms/cpp/core-test/configure.ac
	modules/platforms/cpp/core/configure.ac
	modules/platforms/cpp/examples/configure.ac
	modules/platforms/dotnet/examples/GridGainExamples/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/examples/GridGainExamplesDll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-examples-test/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-dll/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain-test/Properties/AssemblyInfo.cs
	modules/platforms/dotnet/gridgain/Properties/AssemblyInfo.cs
	modules/tools/pom.xml
	modules/visor-console/pom.xml
	modules/visor-demo/pom.xml
	modules/visor-tester-plugin/pom.xml
	modules/visor-tester/pom.xml
	modules/visor/pom.xml
	modules/yardstick/dotnet/Properties/AssemblyInfo.cs
	modules/yardstick/pom.xml
	parent/pom.xml
	pilots/chronotrack/pom.xml
	pilots/ctb/pom.xml
	pilots/dsi/pom.xml
	pilots/ionic/pom.xml
	pilots/sb/pom.xml
	pilots/sony/pom.xml
	pilots/wellsfargo/pom.xml
	pilots/worldpay/pom.xml
	pom.xml


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

Branch: refs/heads/ignite-2234
Commit: 487071fc5c1a3f59edf72d65e6a51ee90786e3de
Parents: 55645c1
Author: Anton Vinogradov <av...@apache.org>
Authored: Tue Dec 22 19:27:02 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Tue Dec 22 19:27:02 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                   |  2 +-
 examples/schema-import/pom.xml                     |  2 +-
 modules/aop/pom.xml                                |  4 ++--
 modules/apache-license-gen/pom.xml                 |  2 +-
 modules/aws/pom.xml                                |  2 +-
 modules/camel/pom.xml                              |  2 +-
 modules/clients/pom.xml                            |  2 +-
 modules/cloud/pom.xml                              |  2 +-
 modules/codegen/pom.xml                            |  2 +-
 modules/core/pom.xml                               |  2 +-
 modules/core/src/main/resources/ignite.properties  |  2 +-
 modules/extdata/p2p/pom.xml                        |  2 +-
 modules/extdata/uri/modules/uri-dependency/pom.xml |  2 +-
 modules/extdata/uri/pom.xml                        |  2 +-
 modules/flume/pom.xml                              |  2 +-
 modules/gce/pom.xml                                |  2 +-
 modules/geospatial/pom.xml                         | 10 +++++-----
 modules/hadoop/pom.xml                             |  2 +-
 modules/hibernate/pom.xml                          |  2 +-
 modules/indexing/pom.xml                           | 10 +++++-----
 modules/jcl/pom.xml                                |  4 ++--
 modules/jms11/pom.xml                              |  2 +-
 modules/jta/pom.xml                                |  2 +-
 modules/kafka/pom.xml                              |  2 +-
 modules/log4j/pom.xml                              |  2 +-
 modules/log4j2/pom.xml                             |  4 ++--
 modules/mesos/pom.xml                              |  2 +-
 modules/mqtt/pom.xml                               |  2 +-
 modules/osgi-karaf/pom.xml                         |  6 +++---
 modules/osgi-paxlogging/pom.xml                    |  2 +-
 modules/osgi/pom.xml                               | 10 +++++-----
 modules/rest-http/pom.xml                          |  2 +-
 modules/scalar-2.10/pom.xml                        |  2 +-
 modules/scalar/pom.xml                             |  2 +-
 modules/schedule/pom.xml                           |  4 ++--
 modules/schema-import/pom.xml                      |  2 +-
 modules/slf4j/pom.xml                              |  2 +-
 modules/spark-2.10/pom.xml                         |  2 +-
 modules/spark/pom.xml                              |  2 +-
 modules/spring/pom.xml                             |  4 ++--
 modules/ssh/pom.xml                                |  2 +-
 modules/tools/pom.xml                              |  2 +-
 modules/twitter/pom.xml                            |  2 +-
 modules/urideploy/pom.xml                          |  2 +-
 modules/visor-console-2.10/pom.xml                 |  2 +-
 modules/visor-console/pom.xml                      |  2 +-
 modules/visor-plugins/pom.xml                      |  2 +-
 modules/web/pom.xml                                |  4 ++--
 modules/yardstick/pom.xml                          |  2 +-
 modules/yarn/pom.xml                               |  2 +-
 modules/zookeeper/pom.xml                          |  2 +-
 pom.xml                                            |  2 +-
 52 files changed, 72 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 5b8c36a..41ad2b8 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/examples/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 6abff1a..175ae1d 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -35,7 +35,7 @@
     </properties>
 
     <artifactId>ignite-schema-import-demo</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 375628f..5b16aa2 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -107,7 +107,7 @@
                 </excludes>
             </testResource>
         </testResources>
-        
+
         <plugins>
             <!-- Generate the OSGi MANIFEST.MF for this bundle. -->
             <plugin>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index d49a4f0..e31d434 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>ignite-apache-license-gen</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <build>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 16a25d8..efd3b36 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/camel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/camel/pom.xml b/modules/camel/pom.xml
index 0e0b535..ca8cb29 100644
--- a/modules/camel/pom.xml
+++ b/modules/camel/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-camel</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 1f4555f..cd5abb1 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 20df4b9..b4a84c3 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
     </parent>
 
     <artifactId>ignite-cloud</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 50dbbc1..e5b1d05 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index f09f099..b07a754 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <repositories>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 6210489..05d5253 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-ignite.version=1.5.0.final-SNAPSHOT
+ignite.version=1.5.1.final-SNAPSHOT
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index bfca85a..c682da5 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-p2p</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 53bf0b2..91718cf 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
     <artifactId>ignite-extdata-uri-dep</artifactId>
     <packaging>jar</packaging>
 
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <modelVersion>4.0.0</modelVersion>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index c775a8d..7442aad 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/flume/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flume/pom.xml b/modules/flume/pom.xml
index 4b3eb49..63ba1eb 100644
--- a/modules/flume/pom.xml
+++ b/modules/flume/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-flume</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index a725a8b..ad25b33 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-gce</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index cfa9065..6ccef90 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -85,9 +85,9 @@
 
     <build>
         <plugins>
-            <!-- Generate the OSGi MANIFEST.MF for this bundle. 
-                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in 
-                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-indexing, thus 
+            <!-- Generate the OSGi MANIFEST.MF for this bundle.
+                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in
+                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-indexing, thus
                  leading to a split package situation in OSGi.
             -->
             <plugin>
@@ -101,5 +101,5 @@
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 0cd553d..a31df33 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 1eaf6f2..b20bcb5 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 246462d..e681cdf 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -109,9 +109,9 @@
                 </executions>
             </plugin>
 
-            <!-- Generate the OSGi MANIFEST.MF for this bundle. 
-                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in 
-                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-geospatial, thus 
+            <!-- Generate the OSGi MANIFEST.MF for this bundle.
+                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in
+                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-geospatial, thus
                  leading to a split package situation in OSGi. It also contains an internal processor.
             -->
             <plugin>
@@ -125,5 +125,5 @@
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 1efb50d..e7285d2 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -65,5 +65,5 @@
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
index 793ae23..fd0bbca 100644
--- a/modules/jms11/pom.xml
+++ b/modules/jms11/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jms11</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index d7a5666..586f16c 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 85a2605..f18e038 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index ae8ab8c..75fbbae 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 115a21d..e677e86 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j2</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -71,5 +71,5 @@
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 0c5286e..8d96496 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mesos</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mqtt/pom.xml b/modules/mqtt/pom.xml
index 54f29c3..09319b8 100644
--- a/modules/mqtt/pom.xml
+++ b/modules/mqtt/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mqtt</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/osgi-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-karaf/pom.xml b/modules/osgi-karaf/pom.xml
index 11fcd38..da24d87 100644
--- a/modules/osgi-karaf/pom.xml
+++ b/modules/osgi-karaf/pom.xml
@@ -7,9 +7,9 @@
   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.
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi-karaf</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <build>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/osgi-paxlogging/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-paxlogging/pom.xml b/modules/osgi-paxlogging/pom.xml
index f2531d7..cbd7f5a 100644
--- a/modules/osgi-paxlogging/pom.xml
+++ b/modules/osgi-paxlogging/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi-paxlogging</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi/pom.xml b/modules/osgi/pom.xml
index 6348e4c..1353707 100644
--- a/modules/osgi/pom.xml
+++ b/modules/osgi/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -113,9 +113,9 @@
                 </executions>
             </plugin>
 
-            <!-- Generate the OSGi MANIFEST.MF for this bundle. 
-                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in 
-                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-geospatial, thus 
+            <!-- Generate the OSGi MANIFEST.MF for this bundle.
+                 This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in
+                 the org.apache.ignite.internal.processors.query.h2.opt in the same manner as ignite-geospatial, thus
                  leading to a split package situation in OSGi. It also contains an internal processor.
             -->
             <plugin>
@@ -166,5 +166,5 @@
 
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 4523d3b..2810a78 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-rest-http</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 0cc030d..42be6b6 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar_2.10</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 8a503e4..b0d1ee4 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 1abf75e..506a800 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>
@@ -85,7 +85,7 @@
 
     <build>
         <plugins>
-            <!-- Generate the OSGi MANIFEST.MF for this fragment. It is a fragment because it contains internal processors 
+            <!-- Generate the OSGi MANIFEST.MF for this fragment. It is a fragment because it contains internal processors
                  that would be looked up by ignite-core. -->
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 97b1d3a..48369e3 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schema-import</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 65c1e2b..a7c1ffe 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index bfbd711..5fdeb0a 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark_2.10</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index aefd4b8..8dd6257 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index e6c0d7f..18db32c 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -137,7 +137,7 @@
         </testResources>
 
         <plugins>
-            <!-- Generate the OSGi MANIFEST.MF for this bundle. 
+            <!-- Generate the OSGi MANIFEST.MF for this bundle.
                  This bundle is a fragment attached to the ignite-core bundle, as it contains and exports classes in the org.apache.ignite
                  leading to a split package situation in OSGi.
             -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 348e9ad..fdf0ee7 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 35d6237..3363623 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/twitter/pom.xml
----------------------------------------------------------------------
diff --git a/modules/twitter/pom.xml b/modules/twitter/pom.xml
index a98ad20..654b897 100644
--- a/modules/twitter/pom.xml
+++ b/modules/twitter/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-twitter</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 5c39e54..75a8fd7 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index 7b73bb4..d9934b9 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console_2.10</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 126de56..2644da7 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 8a38515..fdc1b2b 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-plugins</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index ee90a5f..214f1ce 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>
@@ -99,5 +99,5 @@
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 357d21c..22d6ff7 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index bf89a6a..564fd11 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yarn</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/modules/zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml
index 96fb1fc..75cf61e 100644
--- a/modules/zookeeper/pom.xml
+++ b/modules/zookeeper/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-zookeeper</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/487071fc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4bdad1e..8426dac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>apache-ignite</artifactId>
-    <version>1.5.0.final-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[08/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5'

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5'


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

Branch: refs/heads/ignite-2234
Commit: 36261adfc87ae8c0e356b2add0160282f4164398
Parents: 0766ad7 debe34d
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Dec 24 13:56:45 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Dec 24 13:56:45 2015 +0300

----------------------------------------------------------------------
 README.txt                                      |   4 +-
 RELEASE_NOTES.txt                               |   1 +
 assembly/dependencies-fabric-lgpl.xml           |   7 +
 assembly/dependencies-fabric.xml                |   7 +
 assembly/release-fabric-base.xml                |   4 +-
 bin/ignitevisorcmd.bat                          |   1 +
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 .../hibernate/CacheHibernateStoreExample.java   |   8 +
 .../datagrid/store/hibernate/Person.hbm.xml     |   6 +-
 .../datagrid/store/hibernate/hibernate.cfg.xml  |   7 +-
 ...ComputeClientBinaryTaskExecutionExample.java |   4 +-
 .../CacheClientBinaryPutGetExample.java         |  12 +-
 .../datagrid/CacheClientBinaryQueryExample.java |  17 +-
 .../store/auto/CacheBinaryAutoStoreExample.java |   9 +-
 .../datagrid/CacheEntryProcessorExample.java    | 157 ++++++
 .../examples/datagrid/CacheQueryExample.java    |  15 +-
 .../starschema/CacheStarSchemaExample.java      |   9 +-
 .../store/dummy/CacheDummyPersonStore.java      | 113 -----
 .../store/dummy/CacheDummyStoreExample.java     | 133 -----
 .../datagrid/store/dummy/package-info.java      |  22 -
 .../store/jdbc/CacheJdbcPersonStore.java        |  43 +-
 .../store/jdbc/CacheJdbcStoreExample.java       |  24 +-
 .../store/spring/CacheSpringPersonStore.java    |  29 +-
 .../store/spring/CacheSpringStoreExample.java   |  12 +-
 .../datagrid/store/spring/package-info.java     |   2 +-
 .../apache/ignite/examples/model/Address.java   |  72 +++
 .../apache/ignite/examples/model/Employee.java  |  93 ++++
 .../ignite/examples/model/EmployeeKey.java      |  93 ++++
 .../ignite/examples/model/Organization.java     |  85 +++-
 .../ignite/examples/model/OrganizationType.java |  32 ++
 .../apache/ignite/examples/model/Person.java    |   2 +-
 .../ignite/examples/model/binary/Address.java   |  72 ---
 .../ignite/examples/model/binary/Employee.java  |  93 ----
 .../examples/model/binary/EmployeeKey.java      |  93 ----
 .../examples/model/binary/Organization.java     |  93 ----
 .../examples/model/binary/OrganizationType.java |  32 --
 .../ignite/examples/model/package-info.java     |  23 +
 .../streaming/StreamVisitorExample.java         |  40 +-
 .../datagrid/CacheEntryProcessorExample.java    | 147 ++++++
 .../ScalarCacheEntryProcessorExample.scala      | 125 +++++
 .../examples/ScalarSnowflakeSchemaExample.scala |  31 +-
 .../ignite/examples/CacheExamplesSelfTest.java  |  18 +-
 .../java8/examples/CacheExamplesSelfTest.java   |   8 +
 .../tests/examples/ScalarExamplesSelfTest.scala |   5 +
 modules/aop/pom.xml                             |   2 +-
 .../apache/ignite/gridify/AbstractAopTest.java  |  32 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |  62 ++-
 .../ClientAbstractConnectivitySelfTest.java     |   2 +-
 .../JettyRestProcessorAbstractSelfTest.java     |  25 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   7 +-
 .../src/main/java/org/apache/ignite/Ignite.java |  19 +
 .../java/org/apache/ignite/IgniteCache.java     |   8 +-
 .../org/apache/ignite/binary/BinaryObject.java  |  15 +
 .../binary/BinaryReflectiveSerializer.java      |  33 ++
 .../ignite/binary/BinaryTypeConfiguration.java  |  20 +-
 .../org/apache/ignite/cache/CacheManager.java   |   4 +-
 .../ignite/cache/affinity/AffinityKey.java      |   2 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |   2 +-
 .../configuration/CacheConfiguration.java       |  63 ++-
 .../apache/ignite/internal/IgniteKernal.java    |  36 +-
 .../ignite/internal/IgniteVersionUtils.java     |   5 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  51 +-
 .../internal/binary/BinaryClassDescriptor.java  | 181 ++++---
 .../ignite/internal/binary/BinaryContext.java   | 123 ++++-
 .../internal/binary/BinaryEnumObjectImpl.java   |   7 +
 .../internal/binary/BinaryFieldAccessor.java    |   3 -
 .../ignite/internal/binary/BinaryMetadata.java  |  91 +++-
 .../internal/binary/BinaryObjectExImpl.java     |   7 +
 .../internal/binary/BinaryObjectImpl.java       |  20 +-
 .../binary/BinaryObjectOffheapImpl.java         |   7 +
 .../ignite/internal/binary/BinarySchema.java    |  28 +
 .../ignite/internal/binary/BinaryUtils.java     |  79 ++-
 .../ignite/internal/binary/BinaryWriteMode.java |   4 +-
 .../internal/binary/GridBinaryMarshaller.java   |  10 +
 .../connection/GridClientNioTcpConnection.java  |  17 +-
 .../internal/cluster/ClusterGroupAdapter.java   |  10 +-
 .../managers/communication/GridIoManager.java   |  39 +-
 .../discovery/GridDiscoveryManager.java         |   4 +-
 .../processors/cache/CacheEntryImpl.java        |   6 +-
 .../processors/cache/CacheEntryImplEx.java      |  17 +-
 .../processors/cache/CacheObjectAdapter.java    |   3 +
 .../processors/cache/GridCacheAdapter.java      |  56 +-
 .../processors/cache/GridCacheProcessor.java    |  15 +-
 .../processors/cache/GridCacheProxyImpl.java    |  29 ++
 .../cache/GridCacheSharedContext.java           |  18 +-
 .../processors/cache/GridCacheUtils.java        |  18 +-
 .../processors/cache/IgniteCacheProxy.java      |  43 +-
 .../processors/cache/IgniteInternalCache.java   |  26 +
 .../cache/binary/BinaryMetadataKey.java         |   2 +-
 .../binary/CacheObjectBinaryProcessorImpl.java  |  12 +-
 .../CacheDataStructuresManager.java             |   5 +-
 .../dht/CacheDistributedGetFutureAdapter.java   |   2 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   7 +-
 .../distributed/dht/GridDhtLockFuture.java      |   2 +-
 .../dht/GridPartitionedGetFuture.java           |  15 +-
 .../dht/GridPartitionedSingleGetFuture.java     |  29 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   8 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |  10 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  | 192 ++++---
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  25 +
 .../colocated/GridDhtColocatedLockFuture.java   |  11 +-
 .../GridDhtPartitionsExchangeFuture.java        |  20 +-
 .../dht/preloader/GridDhtPreloader.java         |  31 +-
 .../distributed/near/GridNearAtomicCache.java   |   3 +
 .../distributed/near/GridNearGetFuture.java     |  17 +-
 .../distributed/near/GridNearLockFuture.java    |  39 +-
 ...arOptimisticSerializableTxPrepareFuture.java |   5 +-
 .../near/GridNearOptimisticTxPrepareFuture.java |   5 +-
 ...ridNearOptimisticTxPrepareFutureAdapter.java |  22 +-
 .../query/GridCacheDistributedQueryManager.java |   6 +-
 .../cache/query/GridCacheQueryManager.java      |   8 +-
 .../cache/query/GridCacheQueryRequest.java      |  12 +-
 .../cache/store/CacheOsStoreManager.java        |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  25 +-
 .../cache/transactions/IgniteTxManager.java     |  65 ++-
 .../datastreamer/DataStreamProcessor.java       |  12 +-
 .../datastreamer/DataStreamerUpdateJob.java     |   2 +-
 .../PlatformDotNetConfigurationClosure.java     |   4 +-
 .../processors/query/GridQueryProcessor.java    | 219 ++++++--
 .../client/message/GridClientCacheBean.java     | 139 +++++
 .../rest/client/message/GridClientNodeBean.java |  70 +--
 .../top/GridTopologyCommandHandler.java         |  38 +-
 .../service/GridServiceProcessor.java           |  30 +-
 .../processors/task/GridTaskWorker.java         |   8 +-
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../ignite/internal/util/lang/GridFunc.java     |   1 +
 .../internal/util/lang/GridNodePredicate.java   |  13 +-
 .../ignite/internal/util/nio/GridNioServer.java |  11 +-
 .../util/nio/GridSelectorNioSessionImpl.java    |   7 +
 .../cache/VisorCacheQueryConfiguration.java     |  11 +
 .../cache/VisorCacheStoreConfiguration.java     |  13 +-
 .../internal/visor/query/VisorQueryJob.java     |  10 +-
 .../internal/visor/util/VisorTaskUtils.java     | 122 ++++-
 .../ignite/lang/IgniteProductVersion.java       |   2 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  50 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |   4 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  42 +-
 .../TcpDiscoveryMulticastIpFinder.java          | 118 +++--
 .../resources/META-INF/classnames.properties    |  68 ++-
 .../core/src/main/resources/ignite.properties   |   3 +-
 .../test/config/websession/example-cache.xml    |   9 +-
 .../ignite/IgniteCacheAffinitySelfTest.java     |   7 -
 .../fair/FairAffinityDynamicCacheSelfTest.java  |  17 +-
 .../ignite/internal/ClusterGroupSelfTest.java   |  32 +-
 .../IgniteClientReconnectCacheTest.java         |  33 +-
 ...niteClientReconnectFailoverAbstractTest.java |   3 +-
 .../ignite/internal/TaskNodeRestartTest.java    | 230 +++++++++
 .../binary/BinaryFieldsAbstractSelfTest.java    |   4 +-
 .../BinaryFooterOffsetsAbstractSelfTest.java    |   3 +-
 .../binary/BinaryMarshallerSelfTest.java        | 261 ++++++----
 .../binary/BinaryObjectBuilderSelfTest.java     |  10 +-
 ...GridBinaryMarshallerCtxDisabledSelfTest.java |   3 +-
 .../binary/GridBinaryWildcardsSelfTest.java     |  19 +-
 .../CacheSerializableTransactionsTest.java      |  16 +
 .../cache/CacheStopAndDestroySelfTest.java      |   2 +
 .../cache/CrossCacheTxRandomOperationsTest.java |   2 -
 .../cache/GridCacheAbstractFullApiSelfTest.java |  55 +-
 .../cache/GridCacheAbstractSelfTest.java        |   3 +-
 .../GridCacheOnCopyFlagAbstractSelfTest.java    |  33 +-
 ...IgniteCacheAtomicPutAllFailoverSelfTest.java |   1 +
 ...IgniteCacheBinaryEntryProcessorSelfTest.java | 255 ++++++++++
 .../IgniteCacheBinaryObjectsScanSelfTest.java   | 137 +++++
 .../cache/IgniteCacheNearLockValueSelfTest.java |  11 +-
 .../cache/IgniteCachePutAllRestartTest.java     |   2 +-
 ...iteCacheScanPredicateDeploymentSelfTest.java | 114 +++++
 .../cache/IgniteCacheSerializationSelfTest.java | 112 ++++
 .../IgniteCacheStoreValueAbstractTest.java      |   2 +-
 .../IgniteStartCacheInTransactionSelfTest.java  |  47 +-
 ...gniteTopologyValidatorAbstractCacheTest.java |  18 +-
 ...iteTopologyValidatorAbstractTxCacheTest.java |   1 -
 .../IgniteTxExceptionAbstractSelfTest.java      |  59 ++-
 .../GridBinaryCacheEntryMemorySizeSelfTest.java |   3 +-
 .../GridCacheBinaryStoreAbstractSelfTest.java   |   2 +-
 ...ntNodeBinaryObjectMetadataMultinodeTest.java |   8 +-
 .../GridCacheQueueApiSelfAbstractTest.java      |  86 ++--
 .../CacheGetInsideLockChangingTopologyTest.java | 477 +++++++++++++++++
 .../CacheTryLockMultithreadedTest.java          | 116 +++++
 .../GridCacheAbstractNodeRestartSelfTest.java   |  25 +-
 ...yMetadataUpdateChangingTopologySelfTest.java | 104 ++--
 ...niteBinaryMetadataUpdateNodeRestartTest.java | 411 +++++++++++++++
 .../distributed/IgniteCacheManyClientsTest.java |   2 +
 .../IgniteCacheSizeFailoverTest.java            |   4 +-
 ...gniteAtomicLongChangingTopologySelfTest.java |   8 +-
 ...omicMultiNodeP2PDisabledFullApiSelfTest.java |   5 -
 ...ledFairAffinityMultiNodeFullApiSelfTest.java |   5 -
 .../near/GridCacheNearTxExceptionSelfTest.java  |  20 -
 .../near/NearCacheSyncUpdateTest.java           | 167 ++++++
 .../GridCacheRebalancingSyncSelfTest.java       |  12 +-
 .../random/RandomEvictionPolicySelfTest.java    |   4 +-
 .../BinaryAtomicCacheLocalEntriesSelfTest.java  |  30 ++
 .../BinaryTxCacheLocalEntriesSelfTest.java      |  84 +++
 ...ContinuousQueryFailoverAbstractSelfTest.java | 296 ++++++-----
 ...ridCacheContinuousQueryAbstractSelfTest.java |   3 +
 .../service/ClosureServiceClientsNodesTest.java |  22 +-
 .../GridServiceProcessorProxySelfTest.java      |   3 +-
 .../GridServiceProcessorStopSelfTest.java       |  35 +-
 .../ServicePredicateAccessCacheTest.java        | 155 ++++++
 .../product/GridProductVersionSelfTest.java     |  22 +-
 .../IgniteMessagingWithClientTest.java          |   2 -
 .../GridSessionCheckpointAbstractSelfTest.java  |  33 +-
 .../session/GridSessionCheckpointSelfTest.java  |   3 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |  21 +
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |  33 +-
 ...CommunicationRecoveryAckClosureSelfTest.java |  39 +-
 .../tcp/TcpClientDiscoverySpiMulticastTest.java |  97 +++-
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java |  32 +-
 .../TcpDiscoveryIpFinderAbstractSelfTest.java   |   2 +-
 .../TcpDiscoveryMulticastIpFinderSelfTest.java  |  31 +-
 .../testframework/GridSpiTestContext.java       |  18 +-
 .../testframework/junits/GridAbstractTest.java  |  10 +-
 .../ignite/testframework/junits/IgniteMock.java |   3 +-
 .../junits/IgniteTestResources.java             |   4 +-
 .../IgniteBinaryObjectsTestSuite.java           |  23 +-
 .../IgniteCacheFailoverTestSuite3.java          |   2 +
 .../IgniteCacheRestartTestSuite2.java           |   3 +
 .../testsuites/IgniteCacheTestSuite2.java       |   2 +
 .../testsuites/IgniteCacheTestSuite3.java       |   2 +
 .../testsuites/IgniteComputeGridTestSuite.java  |   2 +
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 .../IgniteSpiDiscoverySelfTestSuite.java        |   6 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../p2p/CacheDeploymentAlwaysTruePredicate.java |  29 ++
 .../ignite/tests/p2p/cache/PersonWrapper.java   | 121 +++++
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |   2 +-
 .../processors/query/h2/IgniteH2Indexing.java   | 118 +++--
 .../processors/query/h2/sql/GridSqlQuery.java   |   3 +
 .../query/h2/sql/GridSqlQuerySplitter.java      | 113 +++--
 .../cache/BinarySerializationQuerySelfTest.java | 416 +++++++++++++++
 ...onQueryWithReflectiveSerializerSelfTest.java |  28 +
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  |  71 ++-
 ...eBinaryWrappedObjectFieldsQuerySelfTest.java |  28 +
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |  68 ++-
 .../cache/IgniteCacheAbstractQuerySelfTest.java | 300 +++++++----
 ...teCacheFullTextQueryNodeJoiningSelfTest.java | 145 ++++++
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |   4 +-
 .../IgniteCacheReplicatedQuerySelfTest.java     |  10 +-
 .../local/IgniteCacheLocalQuerySelfTest.java    |   2 +-
 .../query/IgniteSqlSchemaIndexingTest.java      | 240 +++++++++
 .../query/IgniteSqlSplitterSelfTest.java        |  59 ++-
 .../query/h2/sql/GridQueryParsingTest.java      |   9 +-
 .../IgniteBinaryCacheQueryTestSuite.java        | 126 ++++-
 .../IgniteCacheQuerySelfTestSuite.java          |   6 +
 modules/jcl/pom.xml                             |   2 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 .../stream/mqtt/IgniteMqttStreamerTest.java     |  33 +-
 modules/osgi-karaf/pom.xml                      |   2 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |   2 +-
 modules/platforms/cpp/common/configure.ac       |   2 +-
 .../common/include/ignite/common/concurrent.h   |   2 +-
 .../cpp/common/include/ignite/common/utils.h    |   1 -
 .../cpp/common/os/win/src/concurrent_os.cpp     |  26 +-
 modules/platforms/cpp/common/src/java.cpp       |  28 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 .../platforms/cpp/core-test/src/cache_test.cpp  |   4 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 .../cpp/core/include/ignite/binary/binary.h     |   5 +
 .../core/include/ignite/binary/binary_consts.h  |   5 +
 .../include/ignite/binary/binary_containers.h   |   5 +
 .../include/ignite/binary/binary_raw_reader.h   |   5 +
 .../include/ignite/binary/binary_raw_writer.h   |   5 +
 .../core/include/ignite/binary/binary_reader.h  |   5 +
 .../core/include/ignite/binary/binary_type.h    |  21 +-
 .../core/include/ignite/binary/binary_writer.h  |   5 +
 .../cpp/core/include/ignite/cache/cache.h       |  17 +-
 .../cpp/core/include/ignite/cache/cache_entry.h |   5 +
 .../core/include/ignite/cache/cache_peek_mode.h |   5 +
 .../cpp/core/include/ignite/cache/query/query.h |   5 +
 .../include/ignite/cache/query/query_argument.h |   6 +
 .../include/ignite/cache/query/query_cursor.h   |   5 +
 .../ignite/cache/query/query_fields_cursor.h    |   5 +
 .../ignite/cache/query/query_fields_row.h       |   5 +
 .../include/ignite/cache/query/query_scan.h     |  33 +-
 .../core/include/ignite/cache/query/query_sql.h |   5 +
 .../ignite/cache/query/query_sql_fields.h       |   5 +
 .../include/ignite/cache/query/query_text.h     |  43 +-
 .../platforms/cpp/core/include/ignite/guid.h    |   5 +
 .../platforms/cpp/core/include/ignite/ignite.h  |   5 +
 .../core/include/ignite/ignite_configuration.h  |   5 +
 .../cpp/core/include/ignite/ignite_error.h      |   5 +
 .../cpp/core/include/ignite/ignition.h          |  42 +-
 .../core/include/ignite/impl/cache/cache_impl.h |   6 +-
 .../cpp/core/include/ignite/impl/operations.h   |   8 +-
 modules/platforms/cpp/core/namespaces.dox       |  53 ++
 modules/platforms/cpp/cpp.dxg                   |   8 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 .../Properties/AssemblyInfo.cs                  |   5 +-
 .../Properties/AssemblyInfo.cs                  |   5 +-
 .../native-client-test-cache-parallel-store.xml |   2 +-
 .../Config/native-client-test-cache-store.xml   |   6 +-
 .../Examples/ExamplesTest.cs                    |   4 +-
 .../Properties/AssemblyInfo.cs                  |   5 +-
 .../Services/ServicesTest.cs                    |  23 +-
 .../Apache.Ignite.Core.csproj                   |  19 +
 .../Binary/IBinaryRawReader.cs                  |   4 +-
 .../Apache.Ignite.Core/Binary/IBinaryReader.cs  |  25 +-
 .../Apache.Ignite.Core/Binary/Package-Info.cs   |  26 +
 .../Cache/Event/Package-Info.cs                 |  26 +
 .../Cache/Expiry/Package-Info.cs                |  26 +
 .../Apache.Ignite.Core/Cache/Package-Info.cs    |  26 +
 .../Cache/Query/Continuous/Package-Info.cs      |  26 +
 .../Cache/Query/Package-Info.cs                 |  26 +
 .../Cache/Store/Package-Info.cs                 |  26 +
 .../Apache.Ignite.Core/Cluster/Package-Info.cs  |  26 +
 .../Apache.Ignite.Core/Common/Package-Info.cs   |  26 +
 .../Apache.Ignite.Core/Compute/IComputeTask.cs  |  11 +-
 .../Apache.Ignite.Core/Compute/Package-Info.cs  |  26 +
 .../DataStructures/Package-Info.cs              |  26 +
 .../Datastream/Package-Info.cs                  |  26 +
 .../Apache.Ignite.Core/Events/Package-Info.cs   |  26 +
 .../Impl/Binary/BinaryReader.cs                 |  13 +-
 .../Impl/Binary/BinaryUtils.cs                  |   4 +-
 .../Lifecycle/Package-Info.cs                   |  26 +
 .../Messaging/Package-Info.cs                   |  26 +
 .../dotnet/Apache.Ignite.Core/Package-Info.cs   |  36 ++
 .../Properties/AssemblyInfo.cs                  |   5 +-
 .../Apache.Ignite.Core/Resource/Package-Info.cs |  26 +
 .../Apache.Ignite.Core/Services/Package-Info.cs |  26 +
 .../Transactions/Package-Info.cs                |  26 +
 modules/platforms/dotnet/Apache.Ignite.dxg      |   4 +-
 modules/platforms/dotnet/Apache.Ignite.sln      |   1 +
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   5 +-
 .../Apache.Ignite.Examples.csproj               |   1 -
 .../Compute/ClosureExample.cs                   |   2 +-
 .../Compute/TaskExample.cs                      |   2 +-
 .../Datagrid/ContinuousQueryExample.cs          |   2 +-
 .../Datagrid/CrossPlatformExample.cs            | 205 --------
 .../Datagrid/DataStreamerExample.cs             |   2 +-
 .../Datagrid/PutGetExample.cs                   |   2 +-
 .../Datagrid/QueryExample.cs                    |   2 +-
 .../Datagrid/StoreExample.cs                    |   2 +-
 .../Datagrid/TransactionExample.cs              |   2 +-
 .../Events/EventsExample.cs                     |   2 +-
 .../Messaging/MessagingExample.cs               |   6 +-
 .../Properties/AssemblyInfo.cs                  |   5 +-
 .../Services/ServicesExample.cs                 |   2 +-
 .../Properties/AssemblyInfo.cs                  |   5 +-
 modules/platforms/dotnet/header.html            |  27 +
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 .../scala/org/apache/ignite/scalar/scalar.scala |  11 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 .../ignite/schema/generator/CodeGenerator.java  |   7 +-
 .../schema/test/AbstractSchemaImportTest.java   |  18 +
 .../org/apache/ignite/schema/test/model/Tst.txt | 506 +++++++++++++++++++
 .../apache/ignite/schema/test/model/TstKey.txt  |  96 ++++
 .../schema/test/model/ignite-type-metadata.xml  | 180 +++++++
 .../test/parser/DbMetadataParserTest.java       |  17 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   2 +-
 .../java/org/apache/ignite/IgniteSpring.java    |   4 +-
 .../ignite/internal/GridFactorySelfTest.java    |  16 +
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 .../commands/cache/VisorCacheCommand.scala      |  14 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 .../cache/websession/WebSessionFilter.java      |  82 +--
 .../cache/websession/WebSessionListener.java    |  25 +-
 .../internal/websession/WebSessionSelfTest.java |   2 -
 .../config/benchmark-multicast.properties       |   6 +-
 modules/yardstick/pom.xml                       |   2 +-
 .../cache/IgnitePutGetBatchBenchmark.java       |  60 +++
 .../cache/IgnitePutGetTxBatchBenchmark.java     |  86 ++++
 .../cache/IgnitePutTxImplicitBenchmark.java     |  52 ++
 .../cache/IgnitePutTxOffHeapBenchmark.java      |   2 +-
 .../IgnitePutTxOffHeapValuesBenchmark.java      |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 parent/pom.xml                                  |   1 +
 pom.xml                                         |  44 +-
 399 files changed, 10312 insertions(+), 2874 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/36261adf/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------


[33/50] [abbrv] ignite git commit: # master - added rdf file.

Posted by vo...@apache.org.
# master - added rdf file.


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

Branch: refs/heads/ignite-2234
Commit: e661f17289c872bf34e40dc4a6001666aec1ca0b
Parents: 13e408e
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Tue Dec 29 13:49:08 2015 -0800
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Tue Dec 29 13:49:08 2015 -0800

----------------------------------------------------------------------
 doap_Ignite.rdf | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e661f172/doap_Ignite.rdf
----------------------------------------------------------------------
diff --git a/doap_Ignite.rdf b/doap_Ignite.rdf
new file mode 100644
index 0000000..fb51a15
--- /dev/null
+++ b/doap_Ignite.rdf
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl"?>
+<rdf:RDF xml:lang="en"
+         xmlns="http://usefulinc.com/ns/doap#" 
+         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
+         xmlns:asfext="http://projects.apache.org/ns/asfext#"
+         xmlns:foaf="http://xmlns.com/foaf/0.1/">
+<!--
+    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.
+-->
+  <Project rdf:about="http://ignite.apache.org">
+    <created>2014-10-01</created>
+    <license rdf:resource="http://spdx.org/licenses/Apache-2.0" />
+    <name>Apache Ignite</name>
+    <homepage rdf:resource="http://ignite.apache.org" />
+    <asfext:pmc rdf:resource="http://ignite.apache.org" />
+    <shortdesc>Apache Ignite is an In-Memory Data Fabric providing in-memory data caching, partitioning, processing, and querying components.</shortdesc>
+    <description>Apache Ignite In-Memory Data Fabric is designed to deliver uncompromised performance for a wide set of in-memory computing use cases from high performance computing, to the industry most advanced data grid, in-memory SQL, in-memory file system, streaming, and more.</description>
+    <bug-database rdf:resource="https://issues.apache.org/jira/browse/IGNITE" />
+    <mailing-list rdf:resource="https://ignite.apache.org/community/resources.html#mail-lists" />
+    <download-page rdf:resource="https://ignite.apache.org/download" />
+
+    <programming-language>Java</programming-language>
+    <programming-language>C#</programming-language>
+    <programming-language>C++</programming-language>
+    <programming-language>Node.JS</programming-language>
+    <programming-language>SQL</programming-language>
+    <programming-language>JDBC</programming-language>
+    <programming-language>ODBC</programming-language>
+
+    <category rdf:resource="http://projects.apache.org/category/big-data" />
+    <category rdf:resource="http://projects.apache.org/category/network-server" />
+    <category rdf:resource="http://projects.apache.org/category/network-client" />
+
+    <repository>
+      <GitRepository>
+        <location rdf:resource="https://git-wip-us.apache.org/repos/asf/ignite"/>
+        <browse rdf:resource="https://git-wip-us.apache.org/repos/asf/ignite"/>
+      </GitRepository>
+    </repository>
+    <maintainer>
+      <foaf:Person>
+        <foaf:name>Dmitriy Setrakyan</foaf:name>
+          <foaf:mbox rdf:resource="mailto:dsetrakyan@apache.org"/>
+      </foaf:Person>
+    </maintainer>
+    <asfext:implements><asfext:Standard>
+      <asfext:title>JCACHE - Java Temporary Caching API</asfext:title>
+      <asfext:body>JCP</asfext:body>
+      <asfext:id>107</asfext:id>
+      <asfext:url rdf:resource="https://jcp.org/en/jsr/detail?id=107"/>
+    </asfext:Standard></asfext:implements>
+  </Project>
+</rdf:RDF>


[49/50] [abbrv] ignite git commit: Merge branch 'ignite-1.5.1-2'

Posted by vo...@apache.org.
Merge branch 'ignite-1.5.1-2'


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

Branch: refs/heads/ignite-2234
Commit: 10012b4ef96f2ae727dc27c28185938d016ab9e3
Parents: 8ed73b4 cca90c7
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jan 5 11:03:06 2016 +0400
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jan 5 11:03:06 2016 +0400

----------------------------------------------------------------------
 assembly/release-fabric-base.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[26/50] [abbrv] ignite git commit: IGNITE-2258: IGFS: now default path modes could be optionally disabled using FileSystemConfiguration.isInitializeDefaultPathModes() property.

Posted by vo...@apache.org.
IGNITE-2258: IGFS: now default path modes could be optionally disabled using FileSystemConfiguration.isInitializeDefaultPathModes() property.


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

Branch: refs/heads/ignite-2234
Commit: 03ad6aa821f34eee42504d1a78c9256f7521330a
Parents: d9d5eea
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Dec 29 09:31:58 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Dec 29 09:31:58 2015 +0300

----------------------------------------------------------------------
 .../configuration/FileSystemConfiguration.java  |  54 ++++-
 .../internal/processors/igfs/IgfsImpl.java      |  12 +-
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    |   7 +
 ...condaryFileSystemInitializationSelfTest.java | 214 +++++++++++++++++++
 .../testsuites/IgniteHadoopTestSuite.java       |   2 +
 5 files changed, 278 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/03ad6aa8/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index 888f927..3a9e55e 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -80,6 +80,9 @@ public class FileSystemConfiguration {
     /** Default IPC endpoint enabled flag. */
     public static final boolean DFLT_IPC_ENDPOINT_ENABLED = true;
 
+    /** Default value of whether to initialize default path modes. */
+    public static final boolean DFLT_INIT_DFLT_PATH_MODES = true;
+
     /** IGFS instance name. */
     private String name;
 
@@ -158,6 +161,9 @@ public class FileSystemConfiguration {
     /** Maximum range length. */
     private long maxTaskRangeLen;
 
+    /** Whether to initialize default path modes. */
+    private boolean initDfltPathModes = DFLT_INIT_DFLT_PATH_MODES;
+
     /**
      * Constructs default configuration.
      */
@@ -189,6 +195,7 @@ public class FileSystemConfiguration {
         fragmentizerThrottlingBlockLen = cfg.getFragmentizerThrottlingBlockLength();
         fragmentizerThrottlingDelay = cfg.getFragmentizerThrottlingDelay();
         secondaryFs = cfg.getSecondaryFileSystem();
+        initDfltPathModes = cfg.isInitializeDefaultPathsModes();
         ipcEndpointCfg = cfg.getIpcEndpointConfiguration();
         ipcEndpointEnabled = cfg.isIpcEndpointEnabled();
         maxSpace = cfg.getMaxSpaceSize();
@@ -507,7 +514,7 @@ public class FileSystemConfiguration {
      * Sets the secondary file system. Secondary file system is provided for pass-through, write-through,
      * and read-through purposes.
      *
-     * @param fileSystem
+     * @param fileSystem Secondary file system.
      */
     public void setSecondaryFileSystem(IgfsSecondaryFileSystem fileSystem) {
         secondaryFs = fileSystem;
@@ -519,13 +526,14 @@ public class FileSystemConfiguration {
      * If path doesn't correspond to any specified prefix or mappings are not provided, then
      * {@link #getDefaultMode()} is used.
      * <p>
-     * Several folders under {@code '/apache/ignite'} folder have predefined mappings which cannot be overridden.
-     * <li>{@code /apache/ignite/primary} and all it's sub-folders will always work in {@code PRIMARY} mode.</li>
+     * If {@link #isInitializeDefaultPathsModes()} is set to {@code true}, the following path modes will be created
+     * by default:
+     * <li>{@code /ignite/primary} and all it's sub-folders will always work in {@code PRIMARY} mode.</li>
      * <p>
      * And in case secondary file system URI is provided:
-     * <li>{@code /apache/ignite/proxy} and all it's sub-folders will always work in {@code PROXY} mode.</li>
-     * <li>{@code /apache/ignite/sync} and all it's sub-folders will always work in {@code DUAL_SYNC} mode.</li>
-     * <li>{@code /apache/ignite/async} and all it's sub-folders will always work in {@code DUAL_ASYNC} mode.</li>
+     * <li>{@code /ignite/proxy} and all it's sub-folders will always work in {@code PROXY} mode.</li>
+     * <li>{@code /ignite/sync} and all it's sub-folders will always work in {@code DUAL_SYNC} mode.</li>
+     * <li>{@code /ignite/async} and all it's sub-folders will always work in {@code DUAL_ASYNC} mode.</li>
      *
      * @return Map of paths to {@code IGFS} modes.
      */
@@ -788,6 +796,40 @@ public class FileSystemConfiguration {
         this.maxTaskRangeLen = maxTaskRangeLen;
     }
 
+    /**
+     * Get whether to initialize default path modes.
+     * <p>
+     * When set to {@code true} Ignite will automatically create the following path modes:
+     * <ul>
+     *     <li>{@code /ignite/primary} - will work in {@link IgfsMode#PRIMARY} mode;</li>
+     *     <li>{@code /ignite/sync} - will work in {@link IgfsMode#DUAL_SYNC} mode (only if secondary file system
+     *         is set);</li>
+     *     <li>{@code /ignite/async} - will work in {@link IgfsMode#DUAL_ASYNC} mode (only if secondary file system
+     *         is set);</li>
+     *     <li>{@code /ignite/proxy} - will work in {@link IgfsMode#PROXY} mode (only if secondary file system
+     *         is set).</li>
+     * </ul>
+     * See {@link #getPathModes()} for more information about path modes.
+     * <p>
+     * Defaults to {@link #DFLT_INIT_DFLT_PATH_MODES}.
+     *
+     * @return {@code True} if default path modes will be initialized.
+     */
+    public boolean isInitializeDefaultPathsModes() {
+        return initDfltPathModes;
+    }
+
+    /**
+     * Set whether to initialize default path modes.
+     * <p>
+     * See {@link #isInitializeDefaultPathsModes()} for more information.
+     *
+     * @param initDfltPathModes Whether to initialize default path modes.
+     */
+    public void setInitializeDefaultPathsModes(boolean initDfltPathModes) {
+        this.initDfltPathModes = initDfltPathModes;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(FileSystemConfiguration.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ad6aa8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 0d5cda3..8534513 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -215,12 +215,14 @@ public final class IgfsImpl implements IgfsEx {
         Map<String, IgfsMode> cfgModes = new LinkedHashMap<>();
         Map<String, IgfsMode> dfltModes = new LinkedHashMap<>(4, 1.0f);
 
-        dfltModes.put("/ignite/primary", PRIMARY);
+        if (cfg.isInitializeDefaultPathsModes()) {
+            dfltModes.put("/ignite/primary", PRIMARY);
 
-        if (secondaryFs != null) {
-            dfltModes.put("/ignite/proxy", PROXY);
-            dfltModes.put("/ignite/sync", DUAL_SYNC);
-            dfltModes.put("/ignite/async", DUAL_ASYNC);
+            if (secondaryFs != null) {
+                dfltModes.put("/ignite/proxy", PROXY);
+                dfltModes.put("/ignite/sync", DUAL_SYNC);
+                dfltModes.put("/ignite/async", DUAL_ASYNC);
+            }
         }
 
         cfgModes.putAll(dfltModes);

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ad6aa8/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
index 778792a..5dce67f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
@@ -1100,6 +1100,13 @@ public class IgniteHadoopFileSystem extends FileSystem {
     }
 
     /**
+     * @return {@code true} If secondary file system is initialized.
+     */
+    public boolean hasSecondaryFileSystem() {
+        return secondaryFs != null;
+    }
+
+    /**
      * Convert the given path to path acceptable by the primary file system.
      *
      * @param path Path.

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ad6aa8/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
new file mode 100644
index 0000000..511c4bb
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
@@ -0,0 +1,214 @@
+/*
+ * 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.igfs;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
+import org.apache.ignite.internal.processors.igfs.IgfsCommonAbstractTest;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+
+import java.net.URI;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+import static org.apache.ignite.igfs.IgfsMode.PRIMARY;
+
+/**
+ * Ensures correct modes resolution for SECONDARY paths.
+ */
+public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest extends IgfsCommonAbstractTest {
+    /** File system. */
+    private IgniteHadoopFileSystem fs;
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        U.closeQuiet(fs);
+
+        fs = null;
+
+        G.stopAll(true);
+    }
+
+    /**
+     * Perform initial startup.
+     *
+     * @param initDfltPathModes WHether to initialize default path modes.
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings({"NullableProblems", "unchecked"})
+    private void startUp(boolean initDfltPathModes) throws Exception {
+        startUpSecondary();
+
+        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+        igfsCfg.setDataCacheName("partitioned");
+        igfsCfg.setMetaCacheName("replicated");
+        igfsCfg.setName("igfs");
+        igfsCfg.setBlockSize(512 * 1024);
+        igfsCfg.setInitializeDefaultPathsModes(initDfltPathModes);
+
+        IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
+
+        endpointCfg.setType(IgfsIpcEndpointType.TCP);
+        endpointCfg.setPort(10500);
+
+        igfsCfg.setIpcEndpointConfiguration(endpointCfg);
+
+        igfsCfg.setManagementPort(-1);
+        igfsCfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(
+            "igfs://igfs-secondary:igfs-grid-secondary@127.0.0.1:11500/",
+            "modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml"));
+
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setNearConfiguration(null);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        cacheCfg.setBackups(0);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName("igfs-grid");
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+        cfg.setFileSystemConfiguration(igfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+
+        G.start(cfg);
+
+        Configuration fsCfg = new Configuration();
+
+        fsCfg.addResource(U.resolveIgniteUrl("modules/core/src/test/config/hadoop/core-site-loopback.xml"));
+
+        fsCfg.setBoolean("fs.igfs.impl.disable.cache", true);
+
+        fs = (IgniteHadoopFileSystem)FileSystem.get(new URI("igfs://igfs:igfs-grid@/"), fsCfg);
+    }
+
+    /**
+     * Startup secondary file system.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("unchecked")
+    private void startUpSecondary() throws Exception {
+        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+        igfsCfg.setDataCacheName("partitioned");
+        igfsCfg.setMetaCacheName("replicated");
+        igfsCfg.setName("igfs-secondary");
+        igfsCfg.setBlockSize(512 * 1024);
+        igfsCfg.setDefaultMode(PRIMARY);
+
+        IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
+
+        endpointCfg.setType(IgfsIpcEndpointType.TCP);
+        endpointCfg.setPort(11500);
+
+        igfsCfg.setIpcEndpointConfiguration(endpointCfg);
+
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setNearConfiguration(null);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        cacheCfg.setBackups(0);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName("igfs-grid-secondary");
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+        cfg.setFileSystemConfiguration(igfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+
+        G.start(cfg);
+    }
+
+    /**
+     * Test scenario when defaults are initialized.
+     *
+     * @throws Exception If failed.
+     */
+    public void testDefaultsInitialized() throws Exception {
+        check(true);
+    }
+
+    /**
+     * Test scenario when defaults are not initialized.
+     *
+     * @throws Exception If failed.
+     */
+    public void testDefaultsNotInitialized() throws Exception {
+        check(false);
+    }
+
+    /**
+     * Actual check.
+     *
+     * @param initDfltPathModes Whether to initialize default path modes.
+     * @throws Exception If failed.
+     */
+    private void check(boolean initDfltPathModes) throws Exception {
+        startUp(initDfltPathModes);
+
+        assertEquals(initDfltPathModes, fs.hasSecondaryFileSystem());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ad6aa8/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 0216f4b..6641bc8 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -52,6 +52,7 @@ import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalDualAsyncSel
 import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalDualSyncSelfTest;
 import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalPrimarySelfTest;
 import org.apache.ignite.igfs.IgniteHadoopFileSystemLoopbackExternalSecondarySelfTest;
+import org.apache.ignite.igfs.IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest;
 import org.apache.ignite.igfs.IgniteHadoopFileSystemSecondaryModeSelfTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopCommandLineTest;
 import org.apache.ignite.internal.processors.hadoop.HadoopDefaultMapReducePlannerSelfTest;
@@ -112,6 +113,7 @@ public class IgniteHadoopTestSuite extends TestSuite {
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest.class.getName())));
 
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemSecondaryModeSelfTest.class.getName())));
+        suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.class.getName())));
 
         suite.addTest(new TestSuite(ldr.loadClass(IgniteHadoopFileSystemClientSelfTest.class.getName())));
 


[15/50] [abbrv] ignite git commit: 1.5.1.final-SNAPSHOT

Posted by vo...@apache.org.
1.5.1.final-SNAPSHOT


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

Branch: refs/heads/ignite-2234
Commit: bbac649e89733775b02ba9af201638c59f6d373b
Parents: 7049f52
Author: Ignite Teamcity <ig...@apache.org>
Authored: Mon Dec 28 14:39:17 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Mon Dec 28 14:39:17 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/common/configure.ac                        | 2 +-
 modules/platforms/cpp/core-test/configure.ac                     | 2 +-
 modules/platforms/cpp/core/configure.ac                          | 2 +-
 modules/platforms/cpp/examples/configure.ac                      | 2 +-
 modules/platforms/cpp/ignite/configure.ac                        | 2 +-
 .../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs   | 4 ++--
 .../Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs  | 4 ++--
 .../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs   | 4 ++--
 .../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs         | 4 ++--
 .../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs    | 4 ++--
 .../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs   | 4 ++--
 .../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs         | 4 ++--
 12 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/configure.ac b/modules/platforms/cpp/common/configure.ac
index 2772926..87d5fbc 100644
--- a/modules/platforms/cpp/common/configure.ac
+++ b/modules/platforms/cpp/common/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite JNI bridge for C++], [1.5.1.7796], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.5.1.7927], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/configure.ac b/modules/platforms/cpp/core-test/configure.ac
index 318bac0..e07e478 100644
--- a/modules/platforms/cpp/core-test/configure.ac
+++ b/modules/platforms/cpp/core-test/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Test], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Test], [1.5.1.7927], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/configure.ac b/modules/platforms/cpp/core/configure.ac
index e37a463..ae157eb 100644
--- a/modules/platforms/cpp/core/configure.ac
+++ b/modules/platforms/cpp/core/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.5.1.7927], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index 57f4090..b19a650 100644
--- a/modules/platforms/cpp/examples/configure.ac
+++ b/modules/platforms/cpp/examples/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Ingnite C++ examples],[1.5.1.7796],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
+AC_INIT([Ingnite C++ examples],[1.5.1.7927],[dec@ignite.apache.org],[ignite-examples],[ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/cpp/ignite/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/configure.ac b/modules/platforms/cpp/ignite/configure.ac
index 3806b83..d0bb018 100644
--- a/modules/platforms/cpp/ignite/configure.ac
+++ b/modules/platforms/cpp/ignite/configure.ac
@@ -19,7 +19,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Runner], [1.5.1.7796], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Runner], [1.5.1.7927], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
 AC_CONFIG_SRCDIR(src)
 
 AC_CANONICAL_SYSTEM

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index a7452e3..382329a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("8fae8395-7e91-411a-a78f-44d6d3fed0fc")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index f2d50b0..e0a1ef1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,6 +45,6 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index f95efd2..6ead979 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 94f6071..0b6f277 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]
 
 [assembly: CLSCompliant(true)]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 21271e2..57c1fcc 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
 
 [assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index aa3bf8c..79908a1 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
 
 [assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/bbac649e/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 300521d..41808b0 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Reflection;
 
 [assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
 
-[assembly: AssemblyVersion("1.5.1.7796")]
-[assembly: AssemblyFileVersion("1.5.1.7796")]
+[assembly: AssemblyVersion("1.5.1.7927")]
+[assembly: AssemblyFileVersion("1.5.1.7927")]
 [assembly: AssemblyInformationalVersion("1.5.1.final")]


[14/50] [abbrv] ignite git commit: IGNITE-2305

Posted by vo...@apache.org.
IGNITE-2305


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

Branch: refs/heads/ignite-2234
Commit: 23d7e2515056b3c37b8922b6cfca4cb18d86aaf7
Parents: fe44a56
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Dec 28 14:01:43 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Dec 28 14:01:43 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                               |  8 ++++++++
 modules/platforms/dotnet/Apache.Ignite.sln |  5 +++--
 modules/platforms/dotnet/DEVNOTES.txt      | 18 ++++++++++++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/23d7e251/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index 784be96..ee982e4 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -12,6 +12,14 @@ With LGPL dependencies:
 With LGPL dependencies and Scala 2.10:
   mvn clean package -DskipTests -Prelease,lgpl -Dignite.edition=fabric-lgpl -Dscala-2.10
 
+With Apache Ignite.NET:
+  Build Apache Ignite.NET as described at modules/platforms/dotnet/DEVNOTES.txt.
+
+  Then build Ignite Fabric with Apache Ignite.NET:
+  mvn clean package -DskipTests -DclientDocs
+
+  Note that 'doxygen' should be installed before running this command.
+
 Look for apache-ignite-fabric-<version>-bin.zip in ./target/bin directory.
 
 NOTE: JDK version should be 1.7.0-* or >= 1.8.0-u40.

http://git-wip-us.apache.org/repos/asf/ignite/blob/23d7e251/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index 5c6ce05..164f388 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -1,5 +1,4 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
+Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core", "Apache.Ignite.Core\Apache.Ignite.Core.csproj", "{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}"
 EndProject
@@ -26,10 +25,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		Apache.Ignite.FxCop = Apache.Ignite.FxCop
 		Apache.Ignite.sln.DotSettings = Apache.Ignite.sln.DotSettings
 		build.bat = build.bat
+		DEVNOTES.txt = DEVNOTES.txt
 		examples\Config\example-cache-query.xml = examples\Config\example-cache-query.xml
 		examples\Config\example-cache-store.xml = examples\Config\example-cache-store.xml
 		examples\Config\example-cache.xml = examples\Config\example-cache.xml
 		examples\Config\example-compute.xml = examples\Config\example-compute.xml
+		README.txt = README.txt
 	EndProjectSection
 EndProject
 Global

http://git-wip-us.apache.org/repos/asf/ignite/blob/23d7e251/modules/platforms/dotnet/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/DEVNOTES.txt b/modules/platforms/dotnet/DEVNOTES.txt
new file mode 100644
index 0000000..5650283
--- /dev/null
+++ b/modules/platforms/dotnet/DEVNOTES.txt
@@ -0,0 +1,18 @@
+Apache Ignite.NET Build Instructions
+====================================
+
+Requirements:
+* Windows (XP and up), Windows Server (2008 and up)
+* Oracle JDK 7 and above
+* .NET Framework 4.0
+* Visual Studio 2010 (later versions require upgrading "common" C++ project, see below)
+* JAVA_HOME environment variable set to the corresponding JDK (x64 or x86).
+
+Building binaries:
+  msbuild Apache.Ignite.sln /p:Configuration=Release /p:Platform=x64
+Resulting binaries will be in Apache.Ignite\bin folder
+
+Building in later versions of Visual Studio:
+* Open Apache.Ignite.sln in Visual Studio
+* You will be prompted to "Update VC++ Compiler and Libraries", click "Update"
+* OR, right-click "common" project in the Solution Explorer and select "Upgrade VC++ Compiler and Libraries"
\ No newline at end of file


[36/50] [abbrv] ignite git commit: IGNITE-2228: .NET: Compute futures could be cancelled.

Posted by vo...@apache.org.
IGNITE-2228: .NET: Compute futures could be cancelled.


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

Branch: refs/heads/ignite-2234
Commit: 24a78f5de27908f608cf53915064164d25c0f633
Parents: e661f17
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Dec 30 13:51:32 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 30 13:51:32 2015 +0300

----------------------------------------------------------------------
 .../platform/PlatformAbstractTarget.java        |  17 +-
 .../processors/platform/PlatformTarget.java     |  22 ++
 .../platform/compute/PlatformCompute.java       |  34 ++-
 .../platform/utils/PlatformFutureUtils.java     | 119 +++++++---
 .../platform/utils/PlatformListenable.java      |  47 ++++
 .../cpp/common/include/ignite/common/exports.h  |   7 +-
 .../cpp/common/include/ignite/common/java.h     |  13 +-
 .../platforms/cpp/common/project/vs/module.def  |   6 +-
 modules/platforms/cpp/common/src/exports.cpp    |  20 +-
 modules/platforms/cpp/common/src/java.cpp       |  70 +++++-
 .../Compute/ComputeApiTest.cs                   |  20 ++
 .../Apache.Ignite.Core.csproj                   |   2 +
 .../Common/IgniteFutureCancelledException.cs    |  65 ++++++
 .../Apache.Ignite.Core/Compute/ICompute.cs      | 233 +++++++++++++++++++
 .../Impl/Common/CancelledTask.cs                |  47 ++++
 .../Apache.Ignite.Core/Impl/Common/Future.cs    |  74 +++++-
 .../Apache.Ignite.Core/Impl/Compute/Compute.cs  | 157 ++++++++++++-
 .../Impl/Compute/ComputeImpl.cs                 |  15 +-
 .../Apache.Ignite.Core/Impl/ExceptionUtils.cs   |   4 +
 .../Apache.Ignite.Core/Impl/PlatformTarget.cs   |  52 +++++
 .../Impl/Unmanaged/IgniteJniNativeMethods.cs    |  16 +-
 .../Impl/Unmanaged/UnmanagedUtils.cs            |  31 ++-
 22 files changed, 995 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
index 34a2cca..7ffceef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
@@ -24,7 +24,7 @@ import org.apache.ignite.internal.binary.BinaryRawReaderEx;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
 import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
 import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
-import org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils;
+import org.apache.ignite.internal.processors.platform.utils.*;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.lang.IgniteFuture;
 import org.jetbrains.annotations.Nullable;
@@ -184,12 +184,23 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
 
     /** {@inheritDoc} */
     @Override public void listenFuture(final long futId, int typ) throws Exception {
-        PlatformFutureUtils.listen(platformCtx, currentFutureWrapped(), futId, typ, null, this);
+        listenFutureAndGet(futId, typ);
     }
 
     /** {@inheritDoc} */
     @Override public void listenFutureForOperation(final long futId, int typ, int opId) throws Exception {
-        PlatformFutureUtils.listen(platformCtx, currentFutureWrapped(), futId, typ, futureWriter(opId), this);
+        listenFutureForOperationAndGet(futId, typ, opId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public PlatformListenable listenFutureAndGet(final long futId, int typ) throws Exception {
+        return PlatformFutureUtils.listen(platformCtx, currentFutureWrapped(), futId, typ, null, this);
+    }
+
+    /** {@inheritDoc} */
+    @Override public PlatformListenable listenFutureForOperationAndGet(final long futId, int typ, int opId)
+            throws Exception {
+        return PlatformFutureUtils.listen(platformCtx, currentFutureWrapped(), futId, typ, futureWriter(opId), this);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
index bf657d1..1ebf700 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.platform;
 
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.platform.utils.*;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -113,4 +114,25 @@ public interface PlatformTarget {
      */
     @SuppressWarnings("UnusedDeclaration")
     public void listenFutureForOperation(final long futId, int typ, int opId) throws Exception;
+
+    /**
+     * Start listening for the future.
+     *
+     * @param futId Future ID.
+     * @param typ Result type.
+     * @throws IgniteCheckedException In case of failure.
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    public PlatformListenable listenFutureAndGet(final long futId, int typ) throws Exception;
+
+    /**
+     * Start listening for the future for specific operation type.
+     *
+     * @param futId Future ID.
+     * @param typ Result type.
+     * @param opId Operation ID required to pick correct result writer.
+     * @throws IgniteCheckedException In case of failure.
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    public PlatformListenable listenFutureForOperationAndGet(final long futId, int typ, int opId) throws Exception;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
index 9ef6b5e..1dad126 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
@@ -30,6 +30,7 @@ import org.apache.ignite.internal.binary.BinaryRawReaderEx;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
 import org.apache.ignite.internal.processors.platform.PlatformAbstractTarget;
 import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.utils.*;
 import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteInClosure;
@@ -75,36 +76,31 @@ public class PlatformCompute extends PlatformAbstractTarget {
     }
 
     /** {@inheritDoc} */
-    @Override protected long processInStreamOutLong(int type, BinaryRawReaderEx reader) throws IgniteCheckedException {
+    @Override protected Object processInStreamOutObject(int type, BinaryRawReaderEx reader)
+        throws IgniteCheckedException {
         switch (type) {
             case OP_UNICAST:
-                processClosures(reader.readLong(), reader, false, false);
-
-                return TRUE;
+                return processClosures(reader.readLong(), reader, false, false);
 
             case OP_BROADCAST:
-                processClosures(reader.readLong(), reader, true, false);
-
-                return TRUE;
+                return processClosures(reader.readLong(), reader, true, false);
 
             case OP_AFFINITY:
-                processClosures(reader.readLong(), reader, false, true);
-
-                return TRUE;
+                return processClosures(reader.readLong(), reader, false, true);
 
             default:
-                return super.processInStreamOutLong(type, reader);
+                return super.processInStreamOutObject(type, reader);
         }
     }
 
     /**
      * Process closure execution request.
-     *
-     * @param taskPtr Task pointer.
+     *  @param taskPtr Task pointer.
      * @param reader Reader.
      * @param broadcast broadcast flag.
      */
-    private void processClosures(long taskPtr, BinaryRawReaderEx reader, boolean broadcast, boolean affinity) {
+    private PlatformListenable processClosures(long taskPtr, BinaryRawReaderEx reader, boolean broadcast,
+        boolean affinity) {
         PlatformAbstractTask task;
 
         int size = reader.readInt();
@@ -155,7 +151,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
 
         platformCtx.kernalContext().task().setThreadContext(TC_SUBGRID, compute.clusterGroup().nodes());
 
-        executeNative0(task);
+        return executeNative0(task);
     }
 
     /**
@@ -194,10 +190,10 @@ public class PlatformCompute extends PlatformAbstractTarget {
      * @param taskPtr Pointer to the task.
      * @param topVer Topology version.
      */
-    public void executeNative(long taskPtr, long topVer) {
+    public PlatformListenable executeNative(long taskPtr, long topVer) {
         final PlatformFullTask task = new PlatformFullTask(platformCtx, compute, taskPtr, topVer);
 
-        executeNative0(task);
+        return executeNative0(task);
     }
 
     /**
@@ -231,7 +227,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
      *
      * @param task Task.
      */
-    private void executeNative0(final PlatformAbstractTask task) {
+    private PlatformListenable executeNative0(final PlatformAbstractTask task) {
         IgniteInternalFuture fut = compute.executeAsync(task, null);
 
         fut.listen(new IgniteInClosure<IgniteInternalFuture>() {
@@ -248,6 +244,8 @@ public class PlatformCompute extends PlatformAbstractTarget {
                 }
             }
         });
+
+        return PlatformFutureUtils.getListenable(fut);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformFutureUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformFutureUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformFutureUtils.java
index e6f28c9..7a86201 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformFutureUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformFutureUtils.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.platform.utils;
 
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
 import org.apache.ignite.internal.processors.platform.PlatformAbstractTarget;
@@ -67,10 +68,15 @@ public class PlatformFutureUtils {
      * @param fut Java future.
      * @param futPtr Native future pointer.
      * @param typ Expected return type.
+     * @return Resulting listenable.
      */
-    public static void listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr, final int typ,
-        PlatformAbstractTarget target) {
-        listen(ctx, new InternalFutureListenable(fut), futPtr, typ, null, target);
+    public static PlatformListenable listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr,
+        final int typ, PlatformAbstractTarget target) {
+        PlatformListenable listenable = getListenable(fut);
+
+        listen(ctx, listenable, futPtr, typ, null, target);
+
+        return listenable;
     }
     /**
      * Listen future.
@@ -79,10 +85,15 @@ public class PlatformFutureUtils {
      * @param fut Java future.
      * @param futPtr Native future pointer.
      * @param typ Expected return type.
+     * @return Resulting listenable.
      */
-    public static void listen(final PlatformContext ctx, IgniteFuture fut, final long futPtr, final int typ,
-        PlatformAbstractTarget target) {
-        listen(ctx, new FutureListenable(fut), futPtr, typ, null, target);
+    public static PlatformListenable listen(final PlatformContext ctx, IgniteFuture fut, final long futPtr,
+        final int typ, PlatformAbstractTarget target) {
+        PlatformListenable listenable = getListenable(fut);
+
+        listen(ctx, listenable, futPtr, typ, null, target);
+
+        return listenable;
     }
 
     /**
@@ -93,10 +104,15 @@ public class PlatformFutureUtils {
      * @param futPtr Native future pointer.
      * @param typ Expected return type.
      * @param writer Writer.
+     * @return Resulting listenable.
      */
-    public static void listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr, final int typ,
-        Writer writer, PlatformAbstractTarget target) {
-        listen(ctx, new InternalFutureListenable(fut), futPtr, typ, writer, target);
+    public static PlatformListenable listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr,
+        final int typ, Writer writer, PlatformAbstractTarget target) {
+        PlatformListenable listenable = getListenable(fut);
+
+        listen(ctx, listenable, futPtr, typ, writer, target);
+
+        return listenable;
     }
 
     /**
@@ -107,10 +123,15 @@ public class PlatformFutureUtils {
      * @param futPtr Native future pointer.
      * @param typ Expected return type.
      * @param writer Writer.
+     * @return Resulting listenable.
      */
-    public static void listen(final PlatformContext ctx, IgniteFuture fut, final long futPtr, final int typ,
-        Writer writer, PlatformAbstractTarget target) {
-        listen(ctx, new FutureListenable(fut), futPtr, typ, writer, target);
+    public static PlatformListenable listen(final PlatformContext ctx, IgniteFuture fut, final long futPtr,
+        final int typ, Writer writer, PlatformAbstractTarget target) {
+        PlatformListenable listenable = getListenable(fut);
+
+        listen(ctx, listenable, futPtr, typ, writer, target);
+
+        return listenable;
     }
 
     /**
@@ -120,10 +141,35 @@ public class PlatformFutureUtils {
      * @param fut Java future.
      * @param futPtr Native future pointer.
      * @param writer Writer.
+     * @return Resulting listenable.
+     */
+    public static PlatformListenable listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr,
+        Writer writer, PlatformAbstractTarget target) {
+        PlatformListenable listenable = getListenable(fut);
+
+        listen(ctx, listenable, futPtr, TYP_OBJ, writer, target);
+
+        return listenable;
+    }
+
+    /**
+     * Gets the listenable.
+     *
+     * @param fut Future.
+     * @return Platform listenable.
      */
-    public static void listen(final PlatformContext ctx, IgniteInternalFuture fut, final long futPtr, Writer writer,
-        PlatformAbstractTarget target) {
-        listen(ctx, new InternalFutureListenable(fut), futPtr, TYP_OBJ, writer, target);
+    public static PlatformListenable getListenable(IgniteInternalFuture fut) {
+        return new InternalFutureListenable(fut);
+    }
+
+    /**
+     * Gets the listenable.
+     *
+     * @param fut Future.
+     * @return Platform listenable.
+     */
+    public static PlatformListenable getListenable(IgniteFuture fut) {
+        return new FutureListenable(fut);
     }
 
     /**
@@ -136,8 +182,8 @@ public class PlatformFutureUtils {
      * @param writer Optional writer.
      */
     @SuppressWarnings("unchecked")
-    private static void listen(final PlatformContext ctx, Listenable listenable, final long futPtr, final int typ,
-        @Nullable final Writer writer, final PlatformAbstractTarget target) {
+    private static void listen(final PlatformContext ctx, PlatformListenable listenable, final long futPtr, final
+        int typ, @Nullable final Writer writer, final PlatformAbstractTarget target) {
         final PlatformCallbackGateway gate = ctx.gateway();
 
         listenable.listen(new IgniteBiInClosure<Object, Throwable>() {
@@ -312,21 +358,9 @@ public class PlatformFutureUtils {
     }
 
     /**
-     * Listenable entry.
-     */
-    private static interface Listenable {
-        /**
-         * Listen.
-         *
-         * @param lsnr Listener.
-         */
-        public void listen(IgniteBiInClosure<Object, Throwable> lsnr);
-    }
-
-    /**
      * Listenable around Ignite future.
      */
-    private static class FutureListenable implements Listenable {
+    private static class FutureListenable implements PlatformListenable {
         /** Future. */
         private final IgniteFuture fut;
 
@@ -358,12 +392,22 @@ public class PlatformFutureUtils {
                 }
             });
         }
+
+        /** {@inheritDoc} */
+        @Override public boolean cancel() {
+            return fut.cancel();
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isCancelled() {
+            return fut.isCancelled();
+        }
     }
 
     /**
      * Listenable around Ignite future.
      */
-    private static class InternalFutureListenable implements Listenable {
+    private static class InternalFutureListenable implements PlatformListenable {
         /** Future. */
         private final IgniteInternalFuture fut;
 
@@ -392,6 +436,15 @@ public class PlatformFutureUtils {
                 }
             });
         }
-    }
 
-}
+        /** {@inheritDoc} */
+        @Override public boolean cancel() throws IgniteCheckedException {
+            return fut.cancel();
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isCancelled() {
+            return fut.isCancelled();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformListenable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformListenable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformListenable.java
new file mode 100644
index 0000000..223590d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformListenable.java
@@ -0,0 +1,47 @@
+/*
+ * 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.processors.platform.utils;
+
+import org.apache.ignite.*;
+import org.apache.ignite.lang.*;
+
+/**
+ * Platform listenable.
+ */
+public interface PlatformListenable {
+    /**
+     * Listen.
+     *
+     * @param lsnr Listener.
+     */
+    public void listen(IgniteBiInClosure<Object, Throwable> lsnr);
+
+    /**
+     * Cancel this instance.
+     *
+     * @return True if canceled.
+     */
+    public boolean cancel() throws IgniteCheckedException;
+
+    /**
+     * Returns true if this listenable was canceled before completion.
+     *
+     * @return True if this listenable was canceled before completion.
+     */
+    public boolean isCancelled();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/cpp/common/include/ignite/common/exports.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/include/ignite/common/exports.h b/modules/platforms/cpp/common/include/ignite/common/exports.h
index 23b9665..3eb775d 100644
--- a/modules/platforms/cpp/common/include/ignite/common/exports.h
+++ b/modules/platforms/cpp/common/include/ignite/common/exports.h
@@ -55,6 +55,8 @@ extern "C" {
     void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType);
     void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ);
     void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId);
+    void* IGNITE_CALL IgniteTargetListenFutureAndGet(gcj::JniContext* ctx, void* obj, long long futId, int typ);
+    void* IGNITE_CALL IgniteTargetListenFutureForOperationAndGet(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId);
 
     int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj);
 
@@ -80,7 +82,7 @@ extern "C" {
 
     void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj);
     void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout);
-    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer);
+    void* IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer);
 
     void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj);
     void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj);
@@ -153,6 +155,9 @@ extern "C" {
     long long IGNITE_CALL IgniteAtomicLongCompareAndSetAndGet(gcj::JniContext* ctx, void* obj, long long expVal, long long newVal);
     bool IGNITE_CALL IgniteAtomicLongIsClosed(gcj::JniContext* ctx, void* obj);
     void IGNITE_CALL IgniteAtomicLongClose(gcj::JniContext* ctx, void* obj);
+
+    bool IGNITE_CALL IgniteListenableCancel(gcj::JniContext* ctx, void* obj);
+    bool IGNITE_CALL IgniteListenableIsCancelled(gcj::JniContext* ctx, void* obj);
 }
 
 #endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/cpp/common/include/ignite/common/java.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/include/ignite/common/java.h b/modules/platforms/cpp/common/include/ignite/common/java.h
index 7a2165c..e629c77 100644
--- a/modules/platforms/cpp/common/include/ignite/common/java.h
+++ b/modules/platforms/cpp/common/include/ignite/common/java.h
@@ -318,6 +318,8 @@ namespace ignite
                 jmethodID m_PlatformTarget_inObjectStreamOutStream;
                 jmethodID m_PlatformTarget_listenFuture;
                 jmethodID m_PlatformTarget_listenFutureForOperation;
+                jmethodID m_PlatformTarget_listenFutureAndGet;
+                jmethodID m_PlatformTarget_listenFutureForOperationAndGet;
 
                 jclass c_PlatformTransactions;
                 jmethodID m_PlatformTransactions_txStart;
@@ -347,6 +349,10 @@ namespace ignite
                 jmethodID m_PlatformAtomicLong_isClosed;
                 jmethodID m_PlatformAtomicLong_close;
 
+                jclass c_PlatformListenable;
+                jmethodID m_PlatformListenable_cancel;
+                jmethodID m_PlatformListenable_isCancelled;
+
                 /**
                  * Constructor.
                  */
@@ -501,6 +507,8 @@ namespace ignite
                 jobject TargetOutObject(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
                 void TargetListenFuture(jobject obj, long long futId, int typ);
                 void TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId);
+                void* TargetListenFutureAndGet(jobject obj, long long futId, int typ);
+                void* TargetListenFutureForOperationAndGet(jobject obj, long long futId, int typ, int opId);
                 
                 int AffinityPartitions(jobject obj);
 
@@ -526,7 +534,7 @@ namespace ignite
 
                 void ComputeWithNoFailover(jobject obj);
                 void ComputeWithTimeout(jobject obj, long long timeout);
-                void ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer);
+                void* ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer);
 
                 void ContinuousQueryClose(jobject obj);
                 jobject ContinuousQueryGetInitialQueryCursor(jobject obj);
@@ -589,6 +597,9 @@ namespace ignite
                 bool AtomicLongIsClosed(jobject obj);
                 void AtomicLongClose(jobject obj);
 
+                bool ListenableCancel(jobject obj);
+                bool ListenableIsCancelled(jobject obj);
+
                 jobject Acquire(jobject obj);
 
                 void DestroyJvm();

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/cpp/common/project/vs/module.def
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/project/vs/module.def b/modules/platforms/cpp/common/project/vs/module.def
index 99cec2d..3d166bd 100644
--- a/modules/platforms/cpp/common/project/vs/module.def
+++ b/modules/platforms/cpp/common/project/vs/module.def
@@ -108,4 +108,8 @@ IgniteAtomicLongGetAndDecrement @105
 IgniteAtomicLongGetAndSet @106
 IgniteAtomicLongCompareAndSetAndGet @107
 IgniteAtomicLongIsClosed @108
-IgniteAtomicLongClose @109
\ No newline at end of file
+IgniteAtomicLongClose @109
+IgniteListenableCancel @110
+IgniteListenableIsCancelled @111
+IgniteTargetListenFutureAndGet @112
+IgniteTargetListenFutureForOperationAndGet @113
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/cpp/common/src/exports.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/src/exports.cpp b/modules/platforms/cpp/common/src/exports.cpp
index 327719e..08425a4 100644
--- a/modules/platforms/cpp/common/src/exports.cpp
+++ b/modules/platforms/cpp/common/src/exports.cpp
@@ -138,6 +138,14 @@ extern "C" {
         ctx->TargetListenFutureForOperation(static_cast<jobject>(obj), futId, typ, opId);
     }
 
+    void* IGNITE_CALL IgniteTargetListenFutureAndGet(gcj::JniContext* ctx, void* obj, long long futId, int typ) {
+        return ctx->TargetListenFutureAndGet(static_cast<jobject>(obj), futId, typ);
+    }
+
+    void* IGNITE_CALL IgniteTargetListenFutureForOperationAndGet(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId) {
+        return ctx->TargetListenFutureForOperationAndGet(static_cast<jobject>(obj), futId, typ, opId);
+    }
+
     int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj) {
         return ctx->AffinityPartitions(static_cast<jobject>(obj));
     }
@@ -219,8 +227,8 @@ extern "C" {
         ctx->ComputeWithTimeout(static_cast<jobject>(obj), timeout);
     }
 
-    void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer) {
-        ctx->ComputeExecuteNative(static_cast<jobject>(obj), taskPtr, topVer);
+    void* IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer) {
+        return ctx->ComputeExecuteNative(static_cast<jobject>(obj), taskPtr, topVer);
     }
 
     void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj) {
@@ -458,4 +466,12 @@ extern "C" {
     void IGNITE_CALL IgniteAtomicLongClose(gcj::JniContext* ctx, void* obj) {
         return ctx->AtomicLongClose(static_cast<jobject>(obj));
     }
+    
+    bool IGNITE_CALL IgniteListenableCancel(gcj::JniContext* ctx, void* obj) {
+        return ctx->ListenableCancel(static_cast<jobject>(obj));
+    }
+
+    bool IGNITE_CALL IgniteListenableIsCancelled(gcj::JniContext* ctx, void* obj) {
+        return ctx->ListenableIsCancelled(static_cast<jobject>(obj));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/cpp/common/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/src/java.cpp b/modules/platforms/cpp/common/src/java.cpp
index 64f5d9c..63deba5 100644
--- a/modules/platforms/cpp/common/src/java.cpp
+++ b/modules/platforms/cpp/common/src/java.cpp
@@ -211,6 +211,8 @@ namespace ignite
             JniMethod M_PLATFORM_TARGET_OUT_OBJECT = JniMethod("outObject", "(I)Ljava/lang/Object;", false);
             JniMethod M_PLATFORM_TARGET_LISTEN_FUTURE = JniMethod("listenFuture", "(JI)V", false);
             JniMethod M_PLATFORM_TARGET_LISTEN_FOR_OPERATION = JniMethod("listenFutureForOperation", "(JII)V", false);
+            JniMethod M_PLATFORM_TARGET_LISTEN_FUTURE_AND_GET = JniMethod("listenFutureAndGet", "(JI)Lorg/apache/ignite/internal/processors/platform/utils/PlatformListenable;", false);
+            JniMethod M_PLATFORM_TARGET_LISTEN_FOR_OPERATION_AND_GET = JniMethod("listenFutureForOperationAndGet", "(JII)Lorg/apache/ignite/internal/processors/platform/utils/PlatformListenable;", false);
 
             const char* C_PLATFORM_CLUSTER_GRP = "org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup";
             JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OTHERS = JniMethod("forOthers", "(Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;)Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
@@ -227,7 +229,7 @@ namespace ignite
             const char* C_PLATFORM_COMPUTE = "org/apache/ignite/internal/processors/platform/compute/PlatformCompute";
             JniMethod M_PLATFORM_COMPUTE_WITH_NO_FAILOVER = JniMethod("withNoFailover", "()V", false);
             JniMethod M_PLATFORM_COMPUTE_WITH_TIMEOUT = JniMethod("withTimeout", "(J)V", false);
-            JniMethod M_PLATFORM_COMPUTE_EXECUTE_NATIVE = JniMethod("executeNative", "(JJ)V", false);
+            JniMethod M_PLATFORM_COMPUTE_EXECUTE_NATIVE = JniMethod("executeNative", "(JJ)Lorg/apache/ignite/internal/processors/platform/utils/PlatformListenable;", false);
 
             const char* C_PLATFORM_CACHE = "org/apache/ignite/internal/processors/platform/cache/PlatformCache";
             JniMethod M_PLATFORM_CACHE_WITH_SKIP_STORE = JniMethod("withSkipStore", "()Lorg/apache/ignite/internal/processors/platform/cache/PlatformCache;", false);
@@ -390,6 +392,10 @@ namespace ignite
             JniMethod M_PLATFORM_ATOMIC_LONG_IS_CLOSED = JniMethod("isClosed", "()Z", false);
             JniMethod M_PLATFORM_ATOMIC_LONG_CLOSE = JniMethod("close", "()V", false);
 
+            const char* C_PLATFORM_LISTENABLE = "org/apache/ignite/internal/processors/platform/utils/PlatformListenable";
+            JniMethod M_PLATFORM_LISTENABLE_CANCEL = JniMethod("cancel", "()Z", false);
+            JniMethod M_PLATFORM_LISTENABLE_IS_CANCELED = JniMethod("isCancelled", "()Z", false);
+
             /* STATIC STATE. */
             gcc::CriticalSection JVM_LOCK;
             JniJvm JVM;
@@ -650,6 +656,8 @@ namespace ignite
                 m_PlatformTarget_inObjectStreamOutStream = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_IN_OBJECT_STREAM_OUT_STREAM);
                 m_PlatformTarget_listenFuture = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FUTURE);
                 m_PlatformTarget_listenFutureForOperation = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FOR_OPERATION);
+                m_PlatformTarget_listenFutureAndGet = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FUTURE_AND_GET);
+                m_PlatformTarget_listenFutureForOperationAndGet = FindMethod(env, c_PlatformTarget, M_PLATFORM_TARGET_LISTEN_FOR_OPERATION_AND_GET);
 
                 c_PlatformTransactions = FindClass(env, C_PLATFORM_TRANSACTIONS);
                 m_PlatformTransactions_txStart = FindMethod(env, c_PlatformTransactions, M_PLATFORM_TRANSACTIONS_TX_START);
@@ -666,7 +674,7 @@ namespace ignite
                 m_PlatformUtils_reallocate = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_REALLOC);
                 m_PlatformUtils_errData = FindMethod(env, c_PlatformUtils, M_PLATFORM_UTILS_ERR_DATA);
 
-                jclass c_PlatformAtomicLong = FindClass(env, C_PLATFORM_ATOMIC_LONG);
+                c_PlatformAtomicLong = FindClass(env, C_PLATFORM_ATOMIC_LONG);
                 m_PlatformAtomicLong_get = FindMethod(env, c_PlatformAtomicLong, M_PLATFORM_ATOMIC_LONG_GET);
                 m_PlatformAtomicLong_incrementAndGet = FindMethod(env, c_PlatformAtomicLong, M_PLATFORM_ATOMIC_LONG_INCREMENT_AND_GET);
                 m_PlatformAtomicLong_getAndIncrement = FindMethod(env, c_PlatformAtomicLong, M_PLATFORM_ATOMIC_LONG_GET_AND_INCREMENT);
@@ -679,6 +687,10 @@ namespace ignite
                 m_PlatformAtomicLong_isClosed = FindMethod(env, c_PlatformAtomicLong, M_PLATFORM_ATOMIC_LONG_IS_CLOSED);
                 m_PlatformAtomicLong_close = FindMethod(env, c_PlatformAtomicLong, M_PLATFORM_ATOMIC_LONG_CLOSE);
 
+                c_PlatformListenable = FindClass(env, C_PLATFORM_LISTENABLE);
+                m_PlatformListenable_cancel = FindMethod(env, c_PlatformListenable, M_PLATFORM_LISTENABLE_CANCEL);                    
+                m_PlatformListenable_isCancelled = FindMethod(env, c_PlatformListenable, M_PLATFORM_LISTENABLE_IS_CANCELED);
+
                 // Find utility classes which are not used from context, but are still required in other places.
                 CheckClass(env, C_PLATFORM_NO_CALLBACK_EXCEPTION);
             }
@@ -1322,6 +1334,28 @@ namespace ignite
                 ExceptionCheck(env);
             }
 
+            void* JniContext::TargetListenFutureAndGet(jobject obj, long long futId, int typ) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj,
+                    jvm->GetMembers().m_PlatformTarget_listenFutureAndGet, futId, typ);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
+            void* JniContext::TargetListenFutureForOperationAndGet(jobject obj, long long futId, int typ, int opId) {
+                JNIEnv* env = Attach();
+
+                jobject res = env->CallObjectMethod(obj,
+                    jvm->GetMembers().m_PlatformTarget_listenFutureForOperationAndGet, futId, typ, opId);
+
+                ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
+            }
+
             int JniContext::AffinityPartitions(jobject obj) {
                 JNIEnv* env = Attach();
 
@@ -1517,12 +1551,15 @@ namespace ignite
                 ExceptionCheck(env);
             }
 
-            void JniContext::ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer) {
+            void* JniContext::ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer) {
                 JNIEnv* env = Attach();
 
-                env->CallVoidMethod(obj, jvm->GetMembers().m_PlatformCompute_executeNative, taskPtr, topVer);
+                jobject res = env->CallObjectMethod(obj,
+                    jvm->GetMembers().m_PlatformCompute_executeNative, taskPtr, topVer);
 
                 ExceptionCheck(env);
+
+                return LocalToGlobal(env, res);
             }
 
             void JniContext::ContinuousQueryClose(jobject obj) {
@@ -1536,7 +1573,8 @@ namespace ignite
             jobject JniContext::ContinuousQueryGetInitialQueryCursor(jobject obj) {
                 JNIEnv* env = Attach();
 
-                jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformContinuousQuery_getInitialQueryCursor);
+                jobject res = env->CallObjectMethod(obj,
+                    jvm->GetMembers().m_PlatformContinuousQuery_getInitialQueryCursor);
 
                 ExceptionCheck(env);
 
@@ -2037,6 +2075,28 @@ namespace ignite
                 ExceptionCheck(env);
             }
 
+            bool JniContext::ListenableCancel(jobject obj)
+            {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformListenable_cancel);
+
+                ExceptionCheck(env);
+
+                return res != 0;;
+            }
+
+            bool JniContext::ListenableIsCancelled(jobject obj)
+            {
+                JNIEnv* env = Attach();
+
+                jboolean res = env->CallBooleanMethod(obj, jvm->GetMembers().m_PlatformListenable_isCancelled);
+
+                ExceptionCheck(env);
+
+                return res != 0;;
+            }
+
 			jobject JniContext::Acquire(jobject obj)
             {
                 if (obj) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
index 87b7f9d..fe7d78f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
@@ -1005,6 +1005,25 @@ namespace Apache.Ignite.Core.Tests.Compute
         }
 
         /// <summary>
+        /// Tests single action run.
+        /// </summary>
+        [Test]
+        public void TestRunActionAsyncCancel()
+        {
+            using (var cts = new CancellationTokenSource())
+            {
+                // Cancel while executing
+                var task = _grid1.GetCompute().RunAsync(new ComputeAction(), cts.Token);
+                cts.Cancel();
+                Assert.IsTrue(task.IsCanceled);
+
+                // Use cancelled token
+                task = _grid1.GetCompute().RunAsync(new ComputeAction(), cts.Token);
+                Assert.IsTrue(task.IsCanceled);
+            }
+        }
+
+        /// <summary>
         /// Tests multiple actions run.
         /// </summary>
         [Test]
@@ -1274,6 +1293,7 @@ namespace Apache.Ignite.Core.Tests.Compute
 
         public void Invoke()
         {
+            Thread.Sleep(10);
             Interlocked.Increment(ref InvokeCount);
             LastNodeId = _grid.GetCluster().GetLocalNode().Id;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index f758863..12404be 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -104,6 +104,7 @@
     <Compile Include="Cluster\IClusterNodeFilter.cs" />
     <Compile Include="Cluster\Package-Info.cs" />
     <Compile Include="Common\IgniteException.cs" />
+    <Compile Include="Common\IgniteFutureCancelledException.cs" />
     <Compile Include="Common\IgniteGuid.cs" />
     <Compile Include="Common\Package-Info.cs" />
     <Compile Include="Compute\ComputeExecutionRejectedException.cs" />
@@ -187,6 +188,7 @@
     <Compile Include="Impl\Collections\MultiValueDictionary.cs" />
     <Compile Include="Impl\Collections\ReadOnlyCollection.cs" />
     <Compile Include="Impl\Collections\ReadOnlyDictionary.cs" />
+    <Compile Include="Impl\Common\CancelledTask.cs" />
     <Compile Include="Impl\Common\Classpath.cs" />
     <Compile Include="Impl\Common\CopyOnWriteConcurrentDictionary.cs" />
     <Compile Include="Impl\Common\DelegateConverter.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteFutureCancelledException.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteFutureCancelledException.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteFutureCancelledException.cs
new file mode 100644
index 0000000..02433ce
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteFutureCancelledException.cs
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Common
+{
+    using System;
+    using System.Runtime.Serialization;
+
+    /// <summary>
+    /// Indicates future cancellation within Ignite.
+    /// </summary>
+    public class IgniteFutureCancelledException : IgniteException
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="IgniteFutureCancelledException"/> class.
+        /// </summary>
+        public IgniteFutureCancelledException()
+        {
+            // No-op.
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="IgniteFutureCancelledException"/> class.
+        /// </summary>
+        /// <param name="message">The message that describes the error.</param>
+        public IgniteFutureCancelledException(string message) : base(message)
+        {
+            // No-op.
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="IgniteFutureCancelledException"/> class.
+        /// </summary>
+        /// <param name="message">The message.</param>
+        /// <param name="cause">The cause.</param>
+        public IgniteFutureCancelledException(string message, Exception cause) : base(message, cause)
+        {
+            // No-op.
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="IgniteFutureCancelledException"/> class.
+        /// </summary>
+        /// <param name="info">Serialization information.</param>
+        /// <param name="ctx">Streaming context.</param>
+        protected IgniteFutureCancelledException(SerializationInfo info, StreamingContext ctx) : base(info, ctx)
+        {
+            // No-op.
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
index d818153..a677f39 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
@@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Compute
 {
     using System;
     using System.Collections.Generic;
+    using System.Threading;
     using System.Threading.Tasks;
     using Apache.Ignite.Core.Cluster;
 
@@ -98,6 +99,19 @@ namespace Apache.Ignite.Core.Compute
         Task<TRes> ExecuteJavaTaskAsync<TRes>(string taskName, object taskArg);
 
         /// <summary>
+        /// Executes given Java task on the grid projection. If task for given name has not been deployed yet,
+        /// then 'taskName' will be used as task class name to auto-deploy the task.
+        /// </summary>
+        /// <typeparam name="TRes">Type of task result.</typeparam>
+        /// <param name="taskName">Java task name</param>
+        /// <param name="taskArg">Optional argument of task execution, can be null.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Task result.
+        /// </returns>
+        Task<TRes> ExecuteJavaTaskAsync<TRes>(string taskName, object taskArg, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes given task on the grid projection. For step-by-step explanation of task execution process
         /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
         /// </summary>
@@ -123,6 +137,22 @@ namespace Apache.Ignite.Core.Compute
 
         /// <summary>
         /// Executes given task on the grid projection. For step-by-step explanation of task execution process
+        /// refer to <see cref="IComputeTask{A,T,R}" /> documentation.
+        /// </summary>
+        /// <typeparam name="TArg">Argument type.</typeparam>
+        /// <typeparam name="TJobRes">Type of job result.</typeparam>
+        /// <typeparam name="TRes">Type of final task result.</typeparam>
+        /// <param name="task">Task to execute.</param>
+        /// <param name="taskArg">Optional task argument.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Task result.
+        /// </returns>
+        Task<TRes> ExecuteAsync<TArg, TJobRes, TRes>(IComputeTask<TArg, TJobRes, TRes> task, TArg taskArg, 
+            CancellationToken cancellationToken);
+
+        /// <summary>
+        /// Executes given task on the grid projection. For step-by-step explanation of task execution process
         /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
         /// </summary>
         /// <param name="task">Task to execute.</param>
@@ -143,6 +173,19 @@ namespace Apache.Ignite.Core.Compute
 
         /// <summary>
         /// Executes given task on the grid projection. For step-by-step explanation of task execution process
+        /// refer to <see cref="IComputeTask{A,T,R}" /> documentation.
+        /// </summary>
+        /// <typeparam name="TJobRes">Type of job result.</typeparam>
+        /// <typeparam name="TRes">Type of reduce result.</typeparam>
+        /// <param name="task">Task to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Task result.
+        /// </returns>
+        Task<TRes> ExecuteAsync<TJobRes, TRes>(IComputeTask<TJobRes, TRes> task, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// Executes given task on the grid projection. For step-by-step explanation of task execution process
         /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
         /// </summary>
         /// <param name="taskType">Task type.</param>
@@ -167,6 +210,21 @@ namespace Apache.Ignite.Core.Compute
 
         /// <summary>
         /// Executes given task on the grid projection. For step-by-step explanation of task execution process
+        /// refer to <see cref="IComputeTask{A,T,R}" /> documentation.
+        /// </summary>
+        /// <typeparam name="TArg">Argument type.</typeparam>
+        /// <typeparam name="TJobRes">Type of job result.</typeparam>
+        /// <typeparam name="TRes">Type of reduce result.</typeparam>
+        /// <param name="taskType">Task type.</param>
+        /// <param name="taskArg">Optional task argument.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Task result.
+        /// </returns>
+        Task<TRes> ExecuteAsync<TArg, TJobRes, TRes>(Type taskType, TArg taskArg, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// Executes given task on the grid projection. For step-by-step explanation of task execution process
         /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
         /// </summary>
         /// <param name="taskType">Task type.</param>
@@ -186,6 +244,19 @@ namespace Apache.Ignite.Core.Compute
         Task<TRes> ExecuteAsync<TJobRes, TRes>(Type taskType);
 
         /// <summary>
+        /// Executes given task on the grid projection. For step-by-step explanation of task execution process
+        /// refer to <see cref="IComputeTask{A,T,R}" /> documentation.
+        /// </summary>
+        /// <typeparam name="TJobRes">Type of job result.</typeparam>
+        /// <typeparam name="TRes">Type of reduce result.</typeparam>
+        /// <param name="taskType">Task type.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Task result.
+        /// </returns>
+        Task<TRes> ExecuteAsync<TJobRes, TRes>(Type taskType, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes provided job on a node in this grid projection. The result of the
         /// job execution is returned from the result closure.
         /// </summary>
@@ -204,6 +275,18 @@ namespace Apache.Ignite.Core.Compute
         Task<TRes> CallAsync<TRes>(IComputeFunc<TRes> clo);
 
         /// <summary>
+        /// Executes provided job on a node in this grid projection. The result of the
+        /// job execution is returned from the result closure.
+        /// </summary>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="clo">Job to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Job result for this execution.
+        /// </returns>
+        Task<TRes> CallAsync<TRes>(IComputeFunc<TRes> clo, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes given job on the node where data for provided affinity key is located
         /// (a.k.a. affinity co-location).
         /// </summary>
@@ -226,6 +309,21 @@ namespace Apache.Ignite.Core.Compute
         Task<TRes> AffinityCallAsync<TRes>(string cacheName, object affinityKey, IComputeFunc<TRes> clo);
 
         /// <summary>
+        /// Executes given job on the node where data for provided affinity key is located
+        /// (a.k.a. affinity co-location).
+        /// </summary>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="cacheName">Name of the cache to use for affinity co-location.</param>
+        /// <param name="affinityKey">Affinity key.</param>
+        /// <param name="clo">Job to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Job result for this execution.
+        /// </returns>
+        Task<TRes> AffinityCallAsync<TRes>(string cacheName, object affinityKey, IComputeFunc<TRes> clo, 
+            CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes collection of jobs on nodes within this grid projection.
         /// </summary>
         /// <param name="clos">Collection of jobs to execute.</param>
@@ -249,6 +347,20 @@ namespace Apache.Ignite.Core.Compute
         /// <summary>
         /// Executes collection of jobs on nodes within this grid projection.
         /// </summary>
+        /// <typeparam name="TFuncRes">Type of function result.</typeparam>
+        /// <typeparam name="TRes">Type of result after reduce.</typeparam>
+        /// <param name="clos">Collection of jobs to execute.</param>
+        /// <param name="reducer">Reducer to reduce all job results into one individual return value.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Reduced job result for this execution.
+        /// </returns>
+        Task<TRes> CallAsync<TFuncRes, TRes>(IEnumerable<IComputeFunc<TFuncRes>> clos, 
+            IComputeReducer<TFuncRes, TRes> reducer, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// Executes collection of jobs on nodes within this grid projection.
+        /// </summary>
         /// <param name="clos">Collection of jobs to execute.</param>
         /// <returns>Collection of job results for this execution.</returns>
         /// <typeparam name="TRes">Type of job result.</typeparam>
@@ -263,6 +375,18 @@ namespace Apache.Ignite.Core.Compute
         Task<ICollection<TRes>> CallAsync<TRes>(IEnumerable<IComputeFunc<TRes>> clos);
 
         /// <summary>
+        /// Executes collection of jobs on nodes within this grid projection.
+        /// </summary>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="clos">Collection of jobs to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Collection of job results for this execution.
+        /// </returns>
+        Task<ICollection<TRes>> CallAsync<TRes>(IEnumerable<IComputeFunc<TRes>> clos, 
+            CancellationToken cancellationToken);
+
+        /// <summary>
         /// Broadcasts given job to all nodes in grid projection. Every participating node will return a job result.
         /// </summary>
         /// <param name="clo">Job to broadcast to all projection nodes.</param>
@@ -277,6 +401,17 @@ namespace Apache.Ignite.Core.Compute
         Task<ICollection<TRes>> BroadcastAsync<TRes>(IComputeFunc<TRes> clo);
 
         /// <summary>
+        /// Broadcasts given job to all nodes in grid projection. Every participating node will return a job result.
+        /// </summary>
+        /// <typeparam name="TRes">The type of the resource.</typeparam>
+        /// <param name="clo">Job to broadcast to all projection nodes.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Collection of results for this execution.
+        /// </returns>
+        Task<ICollection<TRes>> BroadcastAsync<TRes>(IComputeFunc<TRes> clo, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Broadcasts given closure job with passed in argument to all nodes in grid projection.
         /// Every participating node will return a job result.
         /// </summary>
@@ -299,6 +434,21 @@ namespace Apache.Ignite.Core.Compute
         Task<ICollection<TRes>> BroadcastAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg);
 
         /// <summary>
+        /// Broadcasts given closure job with passed in argument to all nodes in grid projection.
+        /// Every participating node will return a job result.
+        /// </summary>
+        /// <typeparam name="TArg">Type of argument.</typeparam>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="clo">Job to broadcast to all projection nodes.</param>
+        /// <param name="arg">Job closure argument.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Collection of results for this execution.
+        /// </returns>
+        Task<ICollection<TRes>> BroadcastAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg, 
+            CancellationToken cancellationToken);
+
+        /// <summary>
         /// Broadcasts given job to all nodes in grid projection.
         /// </summary>
         /// <param name="action">Job to broadcast to all projection nodes.</param>
@@ -311,6 +461,14 @@ namespace Apache.Ignite.Core.Compute
         Task BroadcastAsync(IComputeAction action);
 
         /// <summary>
+        /// Broadcasts given job to all nodes in grid projection.
+        /// </summary>
+        /// <param name="action">Job to broadcast to all projection nodes.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>Task.</returns>
+        Task BroadcastAsync(IComputeAction action, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes provided job on a node in this grid projection.
         /// </summary>
         /// <param name="action">Job to execute.</param>
@@ -323,6 +481,13 @@ namespace Apache.Ignite.Core.Compute
         Task RunAsync(IComputeAction action);
 
         /// <summary>
+        /// Executes provided job on a node in this grid projection.
+        /// </summary>
+        /// <param name="action">Job to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        Task RunAsync(IComputeAction action, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes given job on the node where data for provided affinity key is located
         /// (a.k.a. affinity co-location).
         /// </summary>
@@ -341,6 +506,18 @@ namespace Apache.Ignite.Core.Compute
         Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action);
 
         /// <summary>
+        /// Executes given job on the node where data for provided affinity key is located
+        /// (a.k.a. affinity co-location).
+        /// </summary>
+        /// <param name="cacheName">Name of the cache to use for affinity co-location.</param>
+        /// <param name="affinityKey">Affinity key.</param>
+        /// <param name="action">Job to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>Task.</returns>
+        Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action, 
+            CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes collection of jobs on Ignite nodes within this grid projection.
         /// </summary>
         /// <param name="actions">Jobs to execute.</param>
@@ -353,6 +530,14 @@ namespace Apache.Ignite.Core.Compute
         Task RunAsync(IEnumerable<IComputeAction> actions);
 
         /// <summary>
+        /// Executes collection of jobs on Ignite nodes within this grid projection.
+        /// </summary>
+        /// <param name="actions">Jobs to execute.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>Task.</returns>
+        Task RunAsync(IEnumerable<IComputeAction> actions, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes provided closure job on a node in this grid projection.
         /// </summary>
         /// <param name="clo">Job to run.</param>
@@ -373,6 +558,19 @@ namespace Apache.Ignite.Core.Compute
         Task<TRes> ApplyAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg);
 
         /// <summary>
+        /// Executes provided closure job on a node in this grid projection.
+        /// </summary>
+        /// <typeparam name="TArg">Type of argument.</typeparam>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="clo">Job to run.</param>
+        /// <param name="arg">Job argument.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Job result for this execution.
+        /// </returns>
+        Task<TRes> ApplyAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg, CancellationToken cancellationToken);
+
+        /// <summary>
         /// Executes provided closure job on nodes within this grid projection. A new job is executed for
         /// every argument in the passed in collection. The number of actual job executions will be
         /// equal to size of the job arguments collection.
@@ -399,6 +597,22 @@ namespace Apache.Ignite.Core.Compute
         /// <summary>
         /// Executes provided closure job on nodes within this grid projection. A new job is executed for
         /// every argument in the passed in collection. The number of actual job executions will be
+        /// equal to size of the job arguments collection.
+        /// </summary>
+        /// <typeparam name="TArg">Type of argument.</typeparam>
+        /// <typeparam name="TRes">Type of job result.</typeparam>
+        /// <param name="clo">Job to run.</param>
+        /// <param name="args">Job arguments.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Сollection of job results.
+        /// </returns>
+        Task<ICollection<TRes>> ApplyAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, IEnumerable<TArg> args,
+            CancellationToken cancellationToken);
+
+        /// <summary>
+        /// Executes provided closure job on nodes within this grid projection. A new job is executed for
+        /// every argument in the passed in collection. The number of actual job executions will be
         /// equal to size of the job arguments collection. The returned job results will be reduced
         /// into an individual result by provided reducer.
         /// </summary>
@@ -427,5 +641,24 @@ namespace Apache.Ignite.Core.Compute
         /// <typeparam name="TRes">Type of result after reduce.</typeparam>
         Task<TRes> ApplyAsync<TArg, TFuncRes, TRes>(IComputeFunc<TArg, TFuncRes> clo, IEnumerable<TArg> args, 
             IComputeReducer<TFuncRes, TRes> rdc);
+
+        /// <summary>
+        /// Executes provided closure job on nodes within this grid projection. A new job is executed for
+        /// every argument in the passed in collection. The number of actual job executions will be
+        /// equal to size of the job arguments collection. The returned job results will be reduced
+        /// into an individual result by provided reducer.
+        /// </summary>
+        /// <typeparam name="TArg">Type of argument.</typeparam>
+        /// <typeparam name="TFuncRes">Type of function result.</typeparam>
+        /// <typeparam name="TRes">Type of result after reduce.</typeparam>
+        /// <param name="clo">Job to run.</param>
+        /// <param name="args">Job arguments.</param>
+        /// <param name="rdc">Reducer to reduce all job results into one individual return value.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>
+        /// Reduced job result for this execution.
+        /// </returns>
+        Task<TRes> ApplyAsync<TArg, TFuncRes, TRes>(IComputeFunc<TArg, TFuncRes> clo, IEnumerable<TArg> args, 
+            IComputeReducer<TFuncRes, TRes> rdc, CancellationToken cancellationToken);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/CancelledTask.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/CancelledTask.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/CancelledTask.cs
new file mode 100644
index 0000000..0a84d81
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/CancelledTask.cs
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Impl.Common
+{
+    using System.Threading.Tasks;
+
+    /// <summary>
+    /// Provides cancelled tasks of given type.
+    /// </summary>
+    internal static class CancelledTask<T>
+    {
+        /** Task source. */
+        private static readonly TaskCompletionSource<T> TaskCompletionSource;
+
+        /// <summary>
+        /// Initializes the <see cref="CancelledTask{T}"/> class.
+        /// </summary>
+        static CancelledTask()
+        {
+            TaskCompletionSource = new TaskCompletionSource<T>();
+            TaskCompletionSource.SetCanceled();
+        }
+
+        /// <summary>
+        /// Gets the cancelled task.
+        /// </summary>
+        public static Task<T> Instance
+        {
+            get { return TaskCompletionSource.Task; }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs
index 9460be6..0325b71 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs
@@ -18,9 +18,13 @@
 namespace Apache.Ignite.Core.Impl.Common
 {
     using System;
+    using System.Diagnostics;
     using System.Diagnostics.CodeAnalysis;
+    using System.Threading;
     using System.Threading.Tasks;
+    using Apache.Ignite.Core.Common;
     using Apache.Ignite.Core.Impl.Binary.IO;
+    using Apache.Ignite.Core.Impl.Unmanaged;
 
     /// <summary>
     /// Grid future implementation.
@@ -35,6 +39,9 @@ namespace Apache.Ignite.Core.Impl.Common
         /** Task completion source. */
         private readonly TaskCompletionSource<T> _taskCompletionSource = new TaskCompletionSource<T>();
 
+        /** */
+        private volatile IUnmanagedTarget _unmanagedTarget;
+
         /// <summary>
         /// Constructor.
         /// </summary>
@@ -44,7 +51,9 @@ namespace Apache.Ignite.Core.Impl.Common
             _converter = converter;
         }
 
-        /** <inheritdoc/> */
+        /// <summary>
+        /// Gets the result.
+        /// </summary>
         public T Get()
         {
             try
@@ -57,12 +66,28 @@ namespace Apache.Ignite.Core.Impl.Common
             }
         }
 
-        /** <inheritdoc/> */
+        /// <summary>
+        /// Gets the task.
+        /// </summary>
         public Task<T> Task
         {
             get { return _taskCompletionSource.Task; }
         }
 
+        /// <summary>
+        /// Gets the task with cancellation.
+        /// </summary>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        public Task<T> GetTask(CancellationToken cancellationToken)
+        {
+            Debug.Assert(_unmanagedTarget != null);
+
+            // OnTokenCancel will fire even if cancellationToken is already cancelled.
+            cancellationToken.Register(OnTokenCancel);
+
+            return Task;
+        }
+
         /** <inheritdoc /> */
         [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
         public void OnResult(IBinaryStream stream)
@@ -80,7 +105,10 @@ namespace Apache.Ignite.Core.Impl.Common
         /** <inheritdoc /> */
         public void OnError(Exception err)
         {
-            _taskCompletionSource.TrySetException(err);
+            if (err is IgniteFutureCancelledException)
+                _taskCompletionSource.TrySetCanceled();
+            else
+                _taskCompletionSource.TrySetException(err);
         }
 
         /** <inheritdoc /> */
@@ -124,5 +152,45 @@ namespace Apache.Ignite.Core.Impl.Common
             else
                 OnResult(res);
         }
+
+        /// <summary>
+        /// Sets unmanaged future target for cancellation.
+        /// </summary>
+        internal void SetTarget(IUnmanagedTarget target)
+        {
+            Debug.Assert(target != null);
+
+            _unmanagedTarget = target;
+        }
+
+        /// <summary>
+        /// Cancels this instance.
+        /// </summary>
+        internal bool Cancel()
+        {
+            if (_unmanagedTarget == null)
+                return false;
+
+            return UnmanagedUtils.ListenableCancel(_unmanagedTarget);
+        }
+
+        /// <summary>
+        /// Determines whether this instance is cancelled.
+        /// </summary>
+        internal bool IsCancelled()
+        {
+            if (_unmanagedTarget == null)
+                return false;
+
+            return UnmanagedUtils.ListenableIsCancelled(_unmanagedTarget);
+        }
+
+        /// <summary>
+        /// Called when token cancellation occurs.
+        /// </summary>
+        private void OnTokenCancel()
+        {
+            Cancel();
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
index 0f8fd33..300e944 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
@@ -20,9 +20,11 @@ namespace Apache.Ignite.Core.Impl.Compute
     using System;
     using System.Collections.Generic;
     using System.Diagnostics;
+    using System.Threading;
     using System.Threading.Tasks;
     using Apache.Ignite.Core.Cluster;
     using Apache.Ignite.Core.Compute;
+    using Apache.Ignite.Core.Impl.Common;
 
     /// <summary>
     /// Synchronous Compute facade.
@@ -86,6 +88,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> ExecuteJavaTaskAsync<TRes>(string taskName, object taskArg,
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.ExecuteJavaTaskAsync<TRes>(taskName, taskArg).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TReduceRes Execute<TArg, TJobRes, TReduceRes>(IComputeTask<TArg, TJobRes, TReduceRes> task, TArg taskArg)
         {
             return _compute.Execute(task, taskArg).Get();
@@ -98,6 +108,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> ExecuteAsync<TArg, TJobRes, TRes>(IComputeTask<TArg, TJobRes, TRes> task, TArg taskArg, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Execute(task, taskArg).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TJobRes Execute<TArg, TJobRes>(IComputeTask<TArg, TJobRes> task)
         {
             return _compute.Execute(task, null).Get();
@@ -110,6 +128,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> ExecuteAsync<TJobRes, TRes>(IComputeTask<TJobRes, TRes> task, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Execute(task, null).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TReduceRes Execute<TArg, TJobRes, TReduceRes>(Type taskType, TArg taskArg)
         {
             return _compute.Execute<TArg, TJobRes, TReduceRes>(taskType, taskArg).Get();
@@ -122,6 +148,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TReduceRes> ExecuteAsync<TArg, TJobRes, TReduceRes>(Type taskType, TArg taskArg, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TReduceRes>(cancellationToken) ??
+                _compute.Execute<TArg, TJobRes, TReduceRes>(taskType, taskArg).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TReduceRes Execute<TArg, TReduceRes>(Type taskType)
         {
             return _compute.Execute<object, TArg, TReduceRes>(taskType, null).Get();
@@ -134,6 +168,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TReduceRes> ExecuteAsync<TArg, TReduceRes>(Type taskType, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TReduceRes>(cancellationToken) ??
+                _compute.Execute<object, TArg, TReduceRes>(taskType, null).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TJobRes Call<TJobRes>(IComputeFunc<TJobRes> clo)
         {
             return _compute.Execute(clo).Get();
@@ -146,6 +187,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> CallAsync<TRes>(IComputeFunc<TRes> clo, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Execute(clo).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TJobRes AffinityCall<TJobRes>(string cacheName, object affinityKey, IComputeFunc<TJobRes> clo)
         {
             return _compute.AffinityCall(cacheName, affinityKey, clo).Get();
@@ -158,18 +206,35 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> AffinityCallAsync<TRes>(string cacheName, object affinityKey, IComputeFunc<TRes> clo, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.AffinityCall(cacheName, affinityKey, clo).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TJobRes Call<TJobRes>(Func<TJobRes> func)
         {
             return _compute.Execute(func).Get();
         }
 
         /** <inheritDoc /> */
-        public Task<TRes> CallAsync<TFuncRes, TRes>(IEnumerable<IComputeFunc<TFuncRes>> clos, IComputeReducer<TFuncRes, TRes> reducer)
+        public Task<TRes> CallAsync<TFuncRes, TRes>(IEnumerable<IComputeFunc<TFuncRes>> clos, 
+            IComputeReducer<TFuncRes, TRes> reducer)
         {
             return _compute.Execute(clos, reducer).Task;
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> CallAsync<TFuncRes, TRes>(IEnumerable<IComputeFunc<TFuncRes>> clos, 
+            IComputeReducer<TFuncRes, TRes> reducer, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Execute(clos, reducer).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public ICollection<TJobRes> Call<TJobRes>(IEnumerable<IComputeFunc<TJobRes>> clos)
         {
             return _compute.Execute(clos).Get();
@@ -182,6 +247,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<ICollection<TRes>> CallAsync<TRes>(IEnumerable<IComputeFunc<TRes>> clos, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<ICollection<TRes>>(cancellationToken) ??
+               _compute.Execute(clos).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TReduceRes Call<TJobRes, TReduceRes>(IEnumerable<IComputeFunc<TJobRes>> clos, 
             IComputeReducer<TJobRes, TReduceRes> reducer)
         {
@@ -201,6 +274,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<ICollection<TRes>> BroadcastAsync<TRes>(IComputeFunc<TRes> clo, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<ICollection<TRes>>(cancellationToken) ??
+                _compute.Broadcast(clo).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public ICollection<TJobRes> Broadcast<T, TJobRes>(IComputeFunc<T, TJobRes> clo, T arg)
         {
             return _compute.Broadcast(clo, arg).Get();
@@ -213,6 +293,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<ICollection<TRes>> BroadcastAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<ICollection<TRes>>(cancellationToken) ??
+                _compute.Broadcast(clo, arg).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public void Broadcast(IComputeAction action)
         {
             _compute.Broadcast(action).Get();
@@ -225,6 +313,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task BroadcastAsync(IComputeAction action, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
+                _compute.Broadcast(action).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public void Run(IComputeAction action)
         {
             _compute.Run(action).Get();
@@ -237,6 +332,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task RunAsync(IComputeAction action, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
+                _compute.Run(action).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public void AffinityRun(string cacheName, object affinityKey, IComputeAction action)
         {
             _compute.AffinityRun(cacheName, affinityKey, action).Get();
@@ -249,6 +351,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
+                _compute.AffinityRun(cacheName, affinityKey, action).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public void Run(IEnumerable<IComputeAction> actions)
         {
             _compute.Run(actions).Get();
@@ -261,6 +371,13 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task RunAsync(IEnumerable<IComputeAction> actions, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
+                _compute.Run(actions).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TJobRes Apply<TArg, TJobRes>(IComputeFunc<TArg, TJobRes> clo, TArg arg)
         {
             return _compute.Apply(clo, arg).Get();
@@ -273,6 +390,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<TRes> ApplyAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, TArg arg, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Apply(clo, arg).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public ICollection<TJobRes> Apply<TArg, TJobRes>(IComputeFunc<TArg, TJobRes> clo, IEnumerable<TArg> args)
         {
             return _compute.Apply(clo, args).Get();
@@ -285,6 +410,14 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
+        public Task<ICollection<TRes>> ApplyAsync<TArg, TRes>(IComputeFunc<TArg, TRes> clo, IEnumerable<TArg> args, 
+            CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<ICollection<TRes>>(cancellationToken) ??
+                _compute.Apply(clo, args).GetTask(cancellationToken);
+        }
+
+        /** <inheritDoc /> */
         public TReduceRes Apply<TArg, TJobRes, TReduceRes>(IComputeFunc<TArg, TJobRes> clo, 
             IEnumerable<TArg> args, IComputeReducer<TJobRes, TReduceRes> rdc)
         {
@@ -292,9 +425,29 @@ namespace Apache.Ignite.Core.Impl.Compute
         }
 
         /** <inheritDoc /> */
-        public Task<TRes> ApplyAsync<TArg, TFuncRes, TRes>(IComputeFunc<TArg, TFuncRes> clo, IEnumerable<TArg> args, IComputeReducer<TFuncRes, TRes> rdc)
+        public Task<TRes> ApplyAsync<TArg, TFuncRes, TRes>(IComputeFunc<TArg, TFuncRes> clo, IEnumerable<TArg> args, 
+            IComputeReducer<TFuncRes, TRes> rdc)
         {
             return _compute.Apply(clo, args, rdc).Task;
         }
+
+        /** <inheritDoc /> */
+        public Task<TRes> ApplyAsync<TArg, TFuncRes, TRes>(IComputeFunc<TArg, TFuncRes> clo, IEnumerable<TArg> args, 
+            IComputeReducer<TFuncRes, TRes> rdc, CancellationToken cancellationToken)
+        {
+            return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
+                _compute.Apply(clo, args, rdc).GetTask(cancellationToken);
+        }
+
+        /// <summary>
+        /// Gets the cancelled task if specified token is cancelled.
+        /// </summary>
+        private static Task<T> GetTaskIfAlreadyCancelled<T>(CancellationToken cancellationToken)
+        {
+            if (cancellationToken.IsCancellationRequested)
+                return CancelledTask<T>.Instance;
+
+            return null;
+        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
index b44b2ee..86dee30 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
@@ -165,7 +165,8 @@ namespace Apache.Ignite.Core.Impl.Compute
                     WriteTask(writer, taskName, taskArg, nodes);
                 }, input =>
                 {
-                    fut = GetFuture<TReduceRes>((futId, futTyp) => UU.TargetListenFuture(Target, futId, futTyp), _keepBinary.Value);
+                    fut = GetFuture<TReduceRes>((futId, futTyp) =>
+                        UU.TargetListenFutureAndGet(Target, futId, futTyp), _keepBinary.Value);
                 });
 
                 return fut;
@@ -192,9 +193,13 @@ namespace Apache.Ignite.Core.Impl.Compute
 
             long ptr = Marshaller.Ignite.HandleRegistry.Allocate(holder);
 
-            UU.ComputeExecuteNative(Target, ptr, _prj.TopologyVersion);
+            var futTarget = UU.ComputeExecuteNative(Target, ptr, _prj.TopologyVersion);
 
-            return holder.Future;
+            var future = holder.Future;
+
+            future.SetTarget(futTarget);
+
+            return future;
         }
 
         /// <summary>
@@ -522,7 +527,7 @@ namespace Apache.Ignite.Core.Impl.Compute
 
                 try
                 {
-                    DoOutOp(opId, writer =>
+                    var futTarget = DoOutOpObject(opId, writer =>
                     {
                         writer.WriteLong(taskHandle);
 
@@ -546,6 +551,8 @@ namespace Apache.Ignite.Core.Impl.Compute
                         if (writeAction != null)
                             writeAction(writer);
                     });
+
+                    holder.Future.SetTarget(futTarget);
                 }
                 catch (Exception e)
                 {

http://git-wip-us.apache.org/repos/asf/ignite/blob/24a78f5d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
index e0735e1..665d37e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
@@ -95,6 +95,10 @@ namespace Apache.Ignite.Core.Impl
             // Security exceptions.
             EXS["org.apache.ignite.IgniteAuthenticationException"] = m => new SecurityException(m);
             EXS["org.apache.ignite.plugin.security.GridSecurityException"] = m => new SecurityException(m);
+
+            // Future exceptions
+            EXS["org.apache.ignite.lang.IgniteFutureCancelledException"] = m => new IgniteFutureCancelledException(m);
+            EXS["org.apache.ignite.internal.IgniteFutureCancelledCheckedException"] = m => new IgniteFutureCancelledException(m);
         }
 
         /// <summary>


[25/50] [abbrv] ignite git commit: Merge branch 'ignite-1.5.1-2'

Posted by vo...@apache.org.
Merge branch 'ignite-1.5.1-2'


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

Branch: refs/heads/ignite-2234
Commit: d9d5eeacd6cb58af26471fba35da894410fa3186
Parents: 85fd7e0 8e6b365
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 28 17:43:00 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 28 17:43:00 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  11 ++
 RELEASE_NOTES.txt                               |   2 +
 assembly/release-fabric-base.xml                |   6 +
 assembly/release-sources.xml                    |  79 ++++++++++++
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 modules/aop/pom.xml                             |   4 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |   4 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../apache/ignite/internal/IgniteKernal.java    |   7 +-
 .../ignite/internal/IgniteNodeAttributes.java   |   3 +
 .../ignite/internal/binary/BinaryContext.java   |  44 +------
 .../internal/binary/BinaryEnumObjectImpl.java   |   4 +-
 .../internal/binary/BinaryObjectImpl.java       |  27 ++--
 .../internal/binary/GridBinaryMarshaller.java   |  82 +++++++++++-
 .../processors/rest/GridRestProcessor.java      |   4 +
 .../rest/client/message/GridClientNodeBean.java |   4 +-
 .../util/nio/GridNioRecoveryDescriptor.java     |   7 -
 .../ignite/internal/util/nio/GridNioServer.java |   7 +
 .../plugin/security/AuthenticationContext.java  |  33 ++++-
 .../communication/tcp/TcpCommunicationSpi.java  |  12 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../internal/util/nio/GridNioSelfTest.java      | 127 ++++++++++++-------
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |  14 ++
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |  10 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |  10 +-
 modules/jcl/pom.xml                             |   4 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   4 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 modules/osgi-karaf/pom.xml                      |   6 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |  10 +-
 modules/platforms/cpp/DEVNOTES.txt              |  59 +++++++++
 modules/platforms/cpp/README.txt                |  64 +++-------
 modules/platforms/cpp/common/configure.ac       |   2 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 modules/platforms/cpp/project/vs/ignite.sln     |   6 +-
 modules/platforms/cpp/project/vs/ignite.slnrel  |  10 ++
 .../platforms/cpp/project/vs/ignite_x86.slnrel  |  10 ++
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/platforms/dotnet/Apache.Ignite.sln      |   5 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   8 +-
 modules/platforms/dotnet/DEVNOTES.txt           |  18 +++
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/rest-http/pom.xml                       |   2 +-
 .../rest/protocols/http/jetty/rest.html         |   2 +-
 modules/scalar-2.10/pom.xml                     |   4 +-
 modules/scalar/pom.xml                          |   4 +-
 modules/schedule/pom.xml                        |   4 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   4 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 .../GridUriDeploymentFileProcessorSelfTest.java |  19 ++-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   4 +-
 modules/yardstick/pom.xml                       |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 parent/pom.xml                                  |   4 +-
 pom.xml                                         |  25 ++--
 92 files changed, 595 insertions(+), 314 deletions(-)
----------------------------------------------------------------------