You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2016/03/29 10:04:30 UTC

[01/27] ignite git commit: IGNITE-2870: .NET: Fixed incorrect handling of attribute-based SQL configuration with nested indexed field. This closes #568.

Repository: ignite
Updated Branches:
  refs/heads/ignite-2004 d0c7b5107 -> 3f2c2e65d


IGNITE-2870: .NET: Fixed incorrect handling of attribute-based SQL configuration with nested indexed field. This closes #568.


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

Branch: refs/heads/ignite-2004
Commit: 1332c80faefdbe0849afdbc4d92e59774556b578
Parents: cfc7d4e
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Mar 24 16:54:14 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 24 16:54:14 2016 +0300

----------------------------------------------------------------------
 .../Query/CacheQueriesCodeConfigurationTest.cs      | 16 +++++++++++++++-
 .../Cache/Configuration/QueryEntity.cs              |  9 +++++----
 2 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1332c80f/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
index 684dd62..d5f98ac 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
@@ -140,7 +140,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 
                 cache[1] = new AttributeQueryPerson("Arnold", 10)
                 {
-                    Address = new AttributeQueryAddress {Country = "USA", Street = "Pine Tree road"}
+                    Address = new AttributeQueryAddress {Country = "USA", Street = "Pine Tree road", Zip = 1}
                 };
 
                 cache[2] = new AttributeQueryPerson("John", 20);
@@ -155,6 +155,11 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
                     Assert.AreEqual(1, cursor.GetAll().Single().Key);
                 }
 
+                using (var cursor = cache.Query(new SqlQuery(typeof(AttributeQueryPerson), "Zip = ?", 1)))
+                {
+                    Assert.AreEqual(1, cursor.GetAll().Single().Key);
+                }
+
                 using (var cursor = cache.Query(new TextQuery(typeof(AttributeQueryPerson), "Ar*")))
                 {
                     Assert.AreEqual(1, cursor.GetAll().Single().Key);
@@ -226,6 +231,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             public string Country { get; set; }
 
             /// <summary>
+            /// Gets or sets the zip.
+            /// </summary>
+            /// <value>
+            /// The zip.
+            /// </value>
+            [QuerySqlField(IsIndexed = true)]
+            public int Zip { get; set; }
+
+            /// <summary>
             /// Gets or sets the street.
             /// </summary>
             /// <value>

http://git-wip-us.apache.org/repos/asf/ignite/blob/1332c80f/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/QueryEntity.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/QueryEntity.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/QueryEntity.cs
index 4ce0211..f4c12f6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/QueryEntity.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/QueryEntity.cs
@@ -314,16 +314,17 @@ namespace Apache.Ignite.Core.Cache.Configuration
                 {
                     var columnName = attr.Name ?? memberInfo.Key.Name;
 
+                    // No dot notation for indexes
+                    if (attr.IsIndexed)
+                        indexes.Add(new QueryIndexEx(columnName, attr.IsDescending, QueryIndexType.Sorted,
+                            attr.IndexGroups));
+
                     // Dot notation is required for nested SQL fields
                     if (parentPropName != null)
                         columnName = parentPropName + "." + columnName;
 
                     fields.Add(new QueryField(columnName, memberInfo.Value));
 
-                    if (attr.IsIndexed)
-                        indexes.Add(new QueryIndexEx(columnName, attr.IsDescending, QueryIndexType.Sorted,
-                            attr.IndexGroups));
-
                     ScanAttributes(memberInfo.Value, fields, indexes, columnName, visitedTypes);
                 }
 


[04/27] ignite git commit: IGNITE-2872 .NET: Removed deprecation from IgniteConfiguration.SpringConfigUrl property. This closes #571.

Posted by nt...@apache.org.
IGNITE-2872 .NET: Removed deprecation from IgniteConfiguration.SpringConfigUrl property. This closes #571.


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

Branch: refs/heads/ignite-2004
Commit: 7864826c2c99faf68276f7d963fe66b6e7ccb52e
Parents: afe453f
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Mar 24 17:15:15 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 24 17:15:15 2016 +0300

----------------------------------------------------------------------
 .../dotnet/Apache.Ignite.Core/IgniteConfiguration.cs      | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7864826c/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
index e8cc8ff..2aa6899 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -318,12 +318,14 @@
 
         /// <summary>
         /// URL to Spring configuration file.
+        /// <para />
+        /// Ignite.NET can be configured natively without Spring. 
+        /// Setting this property will ignore all other properties except <see cref="IgniteHome"/>, 
+        /// <see cref="Assemblies"/>, <see cref="SuppressWarnings"/>, <see cref="LifecycleBeans"/>, 
+        /// <see cref="JvmOptions"/>, <see cref="JvmDllPath"/>, <see cref="IgniteHome"/>, 
+        /// <see cref="JvmInitialMemoryMb"/>, <see cref="JvmMaxMemoryMb"/>.
         /// </summary>
         [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
-        [Obsolete("Ignite.NET can be configured natively without Spring. " +
-                  "Setting this property will ignore all other properties except " +
-                  "IgniteHome, Assemblies, SuppressWarnings, LifecycleBeans, JvmOptions, JvmdllPath, IgniteHome, " +
-                  "JvmInitialMemoryMb, JvmMaxMemoryMb.")]
         public string SpringConfigUrl { get; set; }
 
         /// <summary>


[11/27] ignite git commit: IGNITE-2874: .NET: Fixed IDataStreamer performance regression caused by incorrect topology size calculation. This closes #572.

Posted by nt...@apache.org.
IGNITE-2874: .NET: Fixed IDataStreamer performance regression caused by incorrect topology size calculation. This closes #572.


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

Branch: refs/heads/ignite-2004
Commit: fb9e9b78520a6258422e9e2f498f5e9331ae5197
Parents: 166bce8
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Fri Mar 25 16:59:05 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Mar 25 16:59:05 2016 +0300

----------------------------------------------------------------------
 .../datastreamer/PlatformDataStreamer.java      |   7 +-
 .../platform/PlatformAttributeNodeFilter.java   |  31 ++++++
 .../Apache.Ignite.Core.Tests.csproj             |   5 +
 .../Config/cache-local-node.xml                 |  65 ++++++++++++
 .../Dataload/DataStreamerTestTopologyChange.cs  | 104 +++++++++++++++++++
 .../Impl/Datastream/DataStreamerImpl.cs         |   9 +-
 6 files changed, 215 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
index 07ef4f2..78d5d86 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
@@ -162,10 +162,11 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
 
         GridDiscoveryManager discoMgr = platformCtx.kernalContext().discovery();
 
-        long topVer = discoMgr.topologyVersion();
-        int topSize = discoMgr.cacheNodes(cacheName, new AffinityTopologyVersion(topVer)).size();
+        AffinityTopologyVersion topVer = discoMgr.topologyVersionEx();
 
-        platformCtx.gateway().dataStreamerTopologyUpdate(ptr, topVer, topSize);
+        int topSize = discoMgr.cacheNodes(cacheName, topVer).size();
+
+        platformCtx.gateway().dataStreamerTopologyUpdate(ptr, topVer.topologyVersion(), topSize);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/core/src/test/java/org/apache/ignite/platform/PlatformAttributeNodeFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformAttributeNodeFilter.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformAttributeNodeFilter.java
new file mode 100644
index 0000000..bbd08a4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformAttributeNodeFilter.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.platform;
+
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Node filter that allows nodes with an attribute.
+ */
+public class PlatformAttributeNodeFilter implements IgnitePredicate<ClusterNode> {
+    /** {@inheritDoc} */
+    @Override public boolean apply(ClusterNode node) {
+        return node.attributes().containsKey("platformAttributeNode");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 7cc9296..38ddd4d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -114,6 +114,7 @@
     <Compile Include="Compute\TaskAdapterTest.cs" />
     <Compile Include="Compute\TaskResultTest.cs" />
     <Compile Include="Dataload\DataStreamerTest.cs" />
+    <Compile Include="Dataload\DataStreamerTestTopologyChange.cs" />
     <Compile Include="DataStructures\AtomicLongTest.cs" />
     <Compile Include="DataStructures\AtomicReferenceTest.cs" />
     <Compile Include="DataStructures\AtomicSequenceTest.cs" />
@@ -188,6 +189,10 @@
     <Content Include="Config\cache-binarizables.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Content Include="Config\cache-local-node.xml">
+      <SubType>Designer</SubType>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="Config\cache-query-continuous.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-local-node.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-local-node.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-local-node.xml
new file mode 100644
index 0000000..d6e4dd2
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-local-node.xml
@@ -0,0 +1,65 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="localHost" value="127.0.0.1"/>
+        <property name="connectorConfiguration"><null/></property>
+        
+        <property name="userAttributes">
+            <map>
+                <entry key="platformAttributeNode" value="true"/>
+            </map>
+        </property>
+        
+
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="cache"/>
+                    <property name="nodeFilter">
+                        <bean class="org.apache.ignite.platform.PlatformAttributeNodeFilter" />
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTestTopologyChange.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTestTopologyChange.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTestTopologyChange.cs
new file mode 100644
index 0000000..c1f2c53
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTestTopologyChange.cs
@@ -0,0 +1,104 @@
+/*
+ * 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.Tests.Dataload
+{
+    using System;
+    using System.Threading;
+    using System.Threading.Tasks;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Streamer test with topology change.
+    /// </summary>
+    public class DataStreamerTestTopologyChange
+    {
+        /// <summary>
+        /// Tests the streamer on a node without cache.
+        /// </summary>
+        [Test]
+        public void TestNoCacheNode()
+        {
+            const string cacheName = "cache";
+
+            var cacheNodeCfg = new IgniteConfiguration(TestUtils.GetTestConfiguration())
+            {
+                SpringConfigUrl = @"Config\cache-local-node.xml",
+                GridName = "cacheGrid"
+            };
+
+            using (var gridNoCache = Ignition.Start(TestUtils.GetTestConfiguration()))
+            {
+                Assert.Throws<ArgumentException>(() => gridNoCache.GetCache<int, int>(cacheName));
+
+                var gridWithCache = Ignition.Start(cacheNodeCfg);
+
+                var streamer = gridNoCache.GetDataStreamer<int, int>(cacheName);
+
+                streamer.AddData(1, 2);
+                streamer.Flush();
+
+                Ignition.Stop(gridWithCache.Name, true);
+
+                Thread.Sleep(500);  // Wait for node to stop
+
+                var task = streamer.AddData(2, 3);
+                streamer.Flush();
+
+                AssertThrowsCacheStopped(task);
+            }
+        }
+
+        /// <summary>
+        /// Streamer test with destroyed cache.
+        /// </summary>
+        [Test]
+        public void TestDestroyCache()
+        {
+            const string cacheName = "cache";
+
+            using (var grid = Ignition.Start(TestUtils.GetTestConfiguration()))
+            {
+                grid.CreateCache<int, int>(cacheName);
+
+                var streamer = grid.GetDataStreamer<int, int>(cacheName);
+
+                var task = streamer.AddData(1, 2);
+                streamer.Flush();
+                task.Wait();
+
+                grid.DestroyCache(cacheName);
+
+                task = streamer.AddData(2, 3);
+                streamer.Flush();
+
+                AssertThrowsCacheStopped(task);
+            }
+        }
+
+        /// <summary>
+        /// Asserts that cache stopped error is thrown.
+        /// </summary>
+        private static void AssertThrowsCacheStopped(Task task)
+        {
+            var ex = Assert.Throws<AggregateException>(task.Wait);
+            Assert.IsTrue(ex.InnerException.Message.Contains(
+                "Failed to find server node for cache " +
+                "(all affinity nodes have left the grid or cache was stopped):"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fb9e9b78/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs
index 6066504..74261d3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs
@@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Impl.Datastream
 {
     using System;
     using System.Collections.Generic;
+    using System.Diagnostics;
     using System.Diagnostics.CodeAnalysis;
     using System.Threading;
     using System.Threading.Tasks;
@@ -86,7 +87,7 @@ namespace Apache.Ignite.Core.Impl.Datastream
         private long _topVer;
 
         /** Topology size. */
-        private int _topSize;
+        private int _topSize = 1;
         
         /** Buffer send size. */
         private volatile int _bufSndSize;
@@ -568,9 +569,9 @@ namespace Apache.Ignite.Core.Impl.Datastream
                 if (_topVer < topVer)
                 {
                     _topVer = topVer;
-                    _topSize = topSize;
+                    _topSize = topSize > 0 ? topSize : 1;  // Do not set to 0 to avoid 0 buffer size.
 
-                    _bufSndSize = topSize * UU.DataStreamerPerNodeBufferSizeGet(Target);
+                    _bufSndSize = _topSize * UU.DataStreamerPerNodeBufferSizeGet(Target);
                 }
             }
             finally
@@ -590,6 +591,8 @@ namespace Apache.Ignite.Core.Impl.Datastream
         {
             int bufSndSize0 = _bufSndSize;
 
+            Debug.Assert(bufSndSize0 > 0);
+
             while (true)
             {
                 var batch0 = _batch;


[12/27] ignite git commit: Fixed IGNITE-2863 - Memory leak in GridUnsafeMap destruct method (author Krome Plasma, remi dot malnar at some dot invalid dot address)

Posted by nt...@apache.org.
Fixed IGNITE-2863 - Memory leak in GridUnsafeMap destruct method (author Krome Plasma, remi dot malnar at some dot invalid dot address)


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

Branch: refs/heads/ignite-2004
Commit: ddd9f0ff66bee1eaf957ea63698d3c2b8c330832
Parents: fb9e9b7
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Mar 25 17:05:13 2016 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Mar 25 17:05:13 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/offheap/unsafe/GridUnsafeMap.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ddd9f0ff/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMap.java
index 3f58447..5c9951b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMap.java
@@ -740,7 +740,7 @@ public class GridUnsafeMap implements GridOffHeapMap {
                 if (tblAddr == 0)
                     return;
 
-                for (long binAddr = tblAddr; binAddr < memCap; binAddr += 8) {
+                for (long binAddr = tblAddr, tblEnd = (tblAddr + memCap); binAddr < tblEnd; binAddr += 8) {
                     long entryAddr = Bin.first(binAddr, mem);
 
                     if (entryAddr == 0)
@@ -1817,4 +1817,4 @@ public class GridUnsafeMap implements GridOffHeapMap {
             return len == keyBytes.length && GridUnsafeMemory.compare(ptr + HEADER_SIZE, keyBytes);
         }
     }
-}
\ No newline at end of file
+}


[16/27] ignite git commit: Query Suite separation : 1,2,3

Posted by nt...@apache.org.
Query Suite separation : 1,2,3


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

Branch: refs/heads/ignite-2004
Commit: 29877281aed4d3d79133279d8aae9bb4b5d9992d
Parents: 34a9b66
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 14:13:20 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 14:32:13 2016 +0300

----------------------------------------------------------------------
 .../IgniteBinaryCacheQueryTestSuite2.java       |  39 +++++
 .../IgniteBinaryCacheQueryTestSuite3.java       |  39 +++++
 .../IgniteCacheQuerySelfTestSuite.java          | 156 -------------------
 .../IgniteCacheQuerySelfTestSuite2.java         | 109 +++++++++++++
 .../IgniteCacheQuerySelfTestSuite3.java         | 117 ++++++++++++++
 5 files changed, 304 insertions(+), 156 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/29877281/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java
new file mode 100644
index 0000000..5c9c733
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with binary marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite2 extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        TestSuite suite = IgniteCacheQuerySelfTestSuite2.suite();
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/29877281/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
new file mode 100644
index 0000000..f9e9af2
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with binary marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite3 extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        TestSuite suite = IgniteCacheQuerySelfTestSuite3.suite();
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/29877281/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 0aa3560..04885ce 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -18,17 +18,8 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
-import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
-import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
-import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheQueryNewClientSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheQueryOffheapEvictDataLostTest;
-import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheScanPartitionQueryFallbackSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheCrossCacheQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryInternalKeysSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQuerySerializationSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheReduceQueryMultithreadedSelfTest;
@@ -36,12 +27,9 @@ import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectFieldsQuery
 import org.apache.ignite.internal.processors.cache.IgniteBinaryWrappedObjectFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheCollocatedQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheDuplicateEntityConfigurationSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheFieldsQueryNoDataSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheLargeResultSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheNoClassQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapEvictQueryTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapTieredMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheP2pUnmarshallingQueryErrorTest;
 import org.apache.ignite.internal.processors.cache.IgniteCachePartitionedQueryMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryEvictsMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryIndexSelfTest;
@@ -51,78 +39,22 @@ import org.apache.ignite.internal.processors.cache.IgniteCacheQueryMultiThreaded
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryOffheapMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheSqlQueryMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.SqlFieldsQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicFieldsQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicNearEnabledFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicNearEnabledQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheClientQueryReplicatedNodeRestartSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedFieldsQueryP2PEnabledSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedQueryP2PDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedSnapshotEnabledQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheQueryNodeFailTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheQueryNodeRestartSelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheQueryNodeRestartSelfTest2;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQueryP2PEnabledSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQueryP2PDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalAtomicQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.query.GridCacheSwapScanQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedTxTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedTxTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchAckTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchForceServerModeAckTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryConcurrentTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionAtomicOneNodeTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionTxOneNodeTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedOnlySelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedP2PDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicOneNodeTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedTxOneNodeTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedP2PDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapValuesTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientReconnectTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTxReconnectTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryReconnectTest;
-import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryPartitionedSelfTest;
-import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryReplicatedSelfTest;
 import org.apache.ignite.internal.processors.query.IgniteSqlSchemaIndexingTest;
 import org.apache.ignite.internal.processors.query.IgniteSqlSplitterSelfTest;
-import org.apache.ignite.internal.processors.query.h2.sql.BaseH2CompareQueryTest;
 import org.apache.ignite.internal.processors.query.h2.sql.GridQueryParsingTest;
-import org.apache.ignite.internal.processors.query.h2.sql.H2CompareBigQueryTest;
-import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest;
 
 /**
  * Test suite for cache queries.
@@ -178,94 +110,6 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(IgniteBinaryObjectFieldsQuerySelfTest.class);
         suite.addTestSuite(IgniteBinaryWrappedObjectFieldsQuerySelfTest.class);
 
-        // Scan queries.
-        suite.addTestSuite(CacheScanPartitionQueryFallbackSelfTest.class);
-
-        // Fields queries.
-        suite.addTestSuite(SqlFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCacheLocalFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCacheReplicatedFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCacheReplicatedFieldsQueryP2PEnabledSelfTest.class);
-        suite.addTestSuite(IgniteCachePartitionedFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCacheAtomicFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCacheAtomicNearEnabledFieldsQuerySelfTest.class);
-        suite.addTestSuite(IgniteCachePartitionedFieldsQueryP2PEnabledSelfTest.class);
-        suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
-
-        // Continuous queries.
-        suite.addTestSuite(GridCacheContinuousQueryLocalSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedP2PDisabledSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionedSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionedOnlySelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionedP2PDisabledSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryTxSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryTxOffheapTieredTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryTxOffheapValuesTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapTieredTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapValuesTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedTxOneNodeTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicOneNodeTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionTxOneNodeTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionAtomicOneNodeTest.class);
-        suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
-        suite.addTestSuite(IgniteCacheContinuousQueryReconnectTest.class);
-        suite.addTestSuite(IgniteCacheContinuousQueryClientReconnectTest.class);
-        suite.addTestSuite(IgniteCacheContinuousQueryClientTxReconnectTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterPartitionedAtomicTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterPartitionedTxTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterReplicatedAtomicTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterReplicatedTxTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
-        suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
-        suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryConcurrentTest.class);
-        suite.addTestSuite(CacheContinuousQueryOperationP2PTest.class);
-        suite.addTestSuite(CacheContinuousBatchAckTest.class);
-        suite.addTestSuite(CacheContinuousBatchForceServerModeAckTest.class);
-
-        // Reduce fields queries.
-        suite.addTestSuite(GridCacheReduceFieldsQueryLocalSelfTest.class);
-        suite.addTestSuite(GridCacheReduceFieldsQueryPartitionedSelfTest.class);
-        suite.addTestSuite(GridCacheReduceFieldsQueryAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheReduceFieldsQueryReplicatedSelfTest.class);
-
-        suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
-
-        suite.addTestSuite(GridCacheSwapScanQuerySelfTest.class);
-
-        suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
-
-        suite.addTestSuite(CacheQueryOffheapEvictDataLostTest.class);
-
-        // Ignite cache and H2 comparison.
-        suite.addTestSuite(BaseH2CompareQueryTest.class);
-        suite.addTestSuite(H2CompareBigQueryTest.class);
-
-        // Cache query metrics.
-        suite.addTestSuite(CacheLocalQueryMetricsSelfTest.class);
-        suite.addTestSuite(CachePartitionedQueryMetricsDistributedSelfTest.class);
-        suite.addTestSuite(CachePartitionedQueryMetricsLocalSelfTest.class);
-        suite.addTestSuite(CacheReplicatedQueryMetricsDistributedSelfTest.class);
-        suite.addTestSuite(CacheReplicatedQueryMetricsLocalSelfTest.class);
-
-        // Unmarshalling query test.
-        suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
-        suite.addTestSuite(IgniteCacheNoClassQuerySelfTest.class);
-
-        // Other.
-        suite.addTestSuite(CacheQueryNewClientSelfTest.class);
-
         return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/29877281/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
new file mode 100644
index 0000000..e9fcb79
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
@@ -0,0 +1,109 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheQueryNewClientSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheQueryOffheapEvictDataLostTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheScanPartitionQueryFallbackSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheFieldsQueryNoDataSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheNoClassQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheP2pUnmarshallingQueryErrorTest;
+import org.apache.ignite.internal.processors.cache.SqlFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicNearEnabledFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedFieldsQueryP2PEnabledSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQueryP2PEnabledSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.query.GridCacheSwapScanQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryPartitionedSelfTest;
+import org.apache.ignite.internal.processors.cache.reducefields.GridCacheReduceFieldsQueryReplicatedSelfTest;
+import org.apache.ignite.internal.processors.query.h2.sql.BaseH2CompareQueryTest;
+import org.apache.ignite.internal.processors.query.h2.sql.H2CompareBigQueryTest;
+import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest;
+
+/**
+ * Test suite for cache queries.
+ */
+public class IgniteCacheQuerySelfTestSuite2 extends TestSuite {
+    /**
+     * @return Test suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Ignite Cache Queries Test Suite 2");
+
+        // Scan queries.
+        suite.addTestSuite(CacheScanPartitionQueryFallbackSelfTest.class);
+
+        // Fields queries.
+        suite.addTestSuite(SqlFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCacheLocalFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCacheReplicatedFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCacheReplicatedFieldsQueryP2PEnabledSelfTest.class);
+        suite.addTestSuite(IgniteCachePartitionedFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCacheAtomicFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCacheAtomicNearEnabledFieldsQuerySelfTest.class);
+        suite.addTestSuite(IgniteCachePartitionedFieldsQueryP2PEnabledSelfTest.class);
+        suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
+
+        // Reduce fields queries.
+        suite.addTestSuite(GridCacheReduceFieldsQueryLocalSelfTest.class);
+        suite.addTestSuite(GridCacheReduceFieldsQueryPartitionedSelfTest.class);
+        suite.addTestSuite(GridCacheReduceFieldsQueryAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheReduceFieldsQueryReplicatedSelfTest.class);
+
+        suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
+
+        suite.addTestSuite(GridCacheSwapScanQuerySelfTest.class);
+
+        suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
+
+        suite.addTestSuite(CacheQueryOffheapEvictDataLostTest.class);
+
+        // Ignite cache and H2 comparison.
+        suite.addTestSuite(BaseH2CompareQueryTest.class);
+        suite.addTestSuite(H2CompareBigQueryTest.class);
+
+        // Cache query metrics.
+        suite.addTestSuite(CacheLocalQueryMetricsSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryMetricsLocalSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryMetricsLocalSelfTest.class);
+
+        // Unmarshalling query test.
+        suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
+        suite.addTestSuite(IgniteCacheNoClassQuerySelfTest.class);
+
+        // Other.
+        suite.addTestSuite(CacheQueryNewClientSelfTest.class);
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/29877281/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
new file mode 100644
index 0000000..3487421
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@ -0,0 +1,117 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchAckTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchForceServerModeAckTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedAtomicTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedTxTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedAtomicTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedTxTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryConcurrentTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionAtomicOneNodeTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionTxOneNodeTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedOnlySelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedP2PDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicOneNodeTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedP2PDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedTxOneNodeTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapValuesTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientReconnectTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTxReconnectTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryReconnectTest;
+
+/**
+ * Test suite for cache queries.
+ */
+public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
+    /**
+     * @return Test suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Ignite Cache Queries Test Suite 3");
+
+        // Continuous queries.
+        suite.addTestSuite(GridCacheContinuousQueryLocalSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedP2PDisabledSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionedSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionedOnlySelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionedP2PDisabledSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryTxSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryTxOffheapTieredTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryTxOffheapValuesTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapTieredTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapValuesTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedTxOneNodeTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicOneNodeTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionTxOneNodeTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionAtomicOneNodeTest.class);
+        suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
+        suite.addTestSuite(IgniteCacheContinuousQueryReconnectTest.class);
+        suite.addTestSuite(IgniteCacheContinuousQueryClientReconnectTest.class);
+        suite.addTestSuite(IgniteCacheContinuousQueryClientTxReconnectTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryCounterPartitionedAtomicTest.class);
+        suite.addTestSuite(CacheContinuousQueryCounterPartitionedTxTest.class);
+        suite.addTestSuite(CacheContinuousQueryCounterReplicatedAtomicTest.class);
+        suite.addTestSuite(CacheContinuousQueryCounterReplicatedTxTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
+        suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
+        suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryConcurrentTest.class);
+        suite.addTestSuite(CacheContinuousQueryOperationP2PTest.class);
+        suite.addTestSuite(CacheContinuousBatchAckTest.class);
+        suite.addTestSuite(CacheContinuousBatchForceServerModeAckTest.class);
+
+        return suite;
+    }
+}


[02/27] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-2004
Commit: 7b63eee332801d770878699b59ef03ddd25d1709
Parents: 1332c80 34a9b66
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 24 16:54:28 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 24 16:54:28 2016 +0300

----------------------------------------------------------------------
 .../CacheContinuousQueryFailoverAbstractSelfTest.java         | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------



[10/27] ignite git commit: IGNITE-2889 .NET: Added tests for IBinaryNameMapper. This closes #578.

Posted by nt...@apache.org.
IGNITE-2889 .NET: Added tests for IBinaryNameMapper. This closes #578.


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

Branch: refs/heads/ignite-2004
Commit: 166bce84516e6c1c10381eb6fa4fe356c9b83e1d
Parents: 090144c
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Fri Mar 25 09:26:30 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Mar 25 09:26:30 2016 +0300

----------------------------------------------------------------------
 .../Binary/BinaryBuilderSelfTest.cs             | 60 +++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/166bce84/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
index e2f7d8a..1199790 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
@@ -17,6 +17,7 @@
 
 // ReSharper disable UnassignedField.Global
 // ReSharper disable CollectionNeverUpdated.Global
+// ReSharper disable UnusedAutoPropertyAccessor.Global
 namespace Apache.Ignite.Core.Tests.Binary
 {
     using System;
@@ -83,9 +84,11 @@ namespace Apache.Ignite.Core.Tests.Binary
                         new BinaryTypeConfiguration(typeof (BuilderCollectionItem)),
                         new BinaryTypeConfiguration(typeof (DecimalHolder)),
                         new BinaryTypeConfiguration(TypeEmpty),
-                        new BinaryTypeConfiguration(typeof(TestEnumRegistered))
+                        new BinaryTypeConfiguration(typeof(TestEnumRegistered)),
+                        new BinaryTypeConfiguration(typeof(NameMapperTestType))
                     },
                     DefaultIdMapper = new IdMapper(),
+                    DefaultNameMapper = new NameMapper(),
                     CompactFooter = GetCompactFooter()
                 },
                 JvmClasspath = TestUtils.CreateTestClasspath(),
@@ -1382,6 +1385,22 @@ namespace Apache.Ignite.Core.Tests.Binary
         }
 
         /// <summary>
+        /// Tests type name mapper.
+        /// </summary>
+        [Test]
+        public void TestTypeName()
+        {
+            var bytes = _marsh.Marshal(new NameMapperTestType {NameMapperTestField = 17});
+
+            var bin = _marsh.Unmarshal<IBinaryObject>(bytes, BinaryMode.ForceBinary);
+
+            var binType = bin.GetBinaryType();
+
+            Assert.AreEqual(BinaryUtils.GetStringHashCode(NameMapper.TestTypeName + "_"), binType.TypeId);
+            Assert.AreEqual(17, bin.GetField<int>(NameMapper.TestFieldName));
+        }
+
+        /// <summary>
         /// Tests metadata methods.
         /// </summary>
         [Test]
@@ -1784,4 +1803,43 @@ namespace Apache.Ignite.Core.Tests.Binary
             return 0;
         }
     }
+
+    /// <summary>
+    /// Test name mapper.
+    /// </summary>
+    public class NameMapper : IBinaryNameMapper
+    {
+        /** */
+        public const string TestTypeName = "NameMapperTestType";
+
+        /** */
+        public const string TestFieldName = "NameMapperTestField";
+
+        /** <inheritdoc /> */
+        public string GetTypeName(string name)
+        {
+            if (name == TestTypeName)
+                return name + "_";
+
+            return name;
+        }
+
+        /** <inheritdoc /> */
+        public string GetFieldName(string name)
+        {
+            if (name == TestFieldName)
+                return name + "_";
+
+            return name;
+        }
+    }
+
+    /// <summary>
+    /// Name mapper test type.
+    /// </summary>
+    public class NameMapperTestType
+    {
+        /** */
+        public int NameMapperTestField { get; set; }
+    }
 }


[08/27] ignite git commit: Added CacheLoadOnlyStoreExample's csv to exclusions from RAT validation.

Posted by nt...@apache.org.
Added CacheLoadOnlyStoreExample's csv to exclusions from RAT validation.


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

Branch: refs/heads/ignite-2004
Commit: c63faf677dc97c613d7ef95e061a354dc650763f
Parents: b81e38d
Author: shtykh_roman <rs...@yahoo.com>
Authored: Fri Mar 25 11:18:55 2016 +0900
Committer: shtykh_roman <rs...@yahoo.com>
Committed: Fri Mar 25 11:18:55 2016 +0900

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/c63faf67/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 8be235a..8b613fa 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -792,6 +792,7 @@
                                         <exclude>src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
                                         <exclude>examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
                                         <exclude>src/main/resources/person.csv</exclude><!--CacheLoadOnlyStoreExample csv-->
+                                        <exclude>examples/src/main/resources/person.csv</exclude><!--CacheLoadOnlyStoreExample csv-->
                                         <exclude>src/main/java/META-INF/services/javax.cache.spi.CachingProvider</exclude><!--cannot be changed-->
                                         <exclude>src/main/java/org/jetbrains/annotations/*.java</exclude><!--copyright-->
                                         <exclude>src/main/resources/META-INF/services/org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider</exclude><!--cannot be changed-->


[22/27] ignite git commit: IGNITE-1071 IgniteCache.metrics() method returns local metrics

Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
index 4bd4c59..b227364 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
@@ -231,7 +231,7 @@ public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends Grid
 
         for (int i = 0; i < gridCount(); i++) {
             TransactionMetrics metrics = grid(i).transactions().metrics();
-            CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
+            CacheMetrics cacheMetrics = grid(i).cache(null).localMetrics();
 
             if (i == 0) {
                 assertEquals(TX_CNT, metrics.txCommits());
@@ -276,7 +276,7 @@ public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends Grid
 
         for (int i = 0; i < gridCount(); i++) {
             TransactionMetrics metrics = grid(i).transactions().metrics();
-            CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
+            CacheMetrics cacheMetrics = grid(i).cache(null).localMetrics();
 
             assertEquals(0, metrics.txCommits());
             assertEquals(0, cacheMetrics.getCacheTxCommits());

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index 463c2c0..aa7f6fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -476,7 +476,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
                 if (tx != null)
                     tx.commit();
 
-                System.out.println(cache.metrics());
+                System.out.println(cache.localMetrics());
 
                 assertEquals("Hello", cache.get(1));
                 assertEquals("World", cache.get(2));

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
index 3ace98d..16aa72d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
@@ -107,7 +107,7 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
         long misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             removes += m.getCacheRemovals();
             reads += m.getCacheGets();

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
index d94fe68..9e4be22 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
@@ -50,19 +50,19 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
             }
         });
 
-        assertEquals(1L, cache.metrics().getCachePuts());
+        assertEquals(1L, cache.localMetrics().getCachePuts());
 
         assertEquals(20, result);
-        assertEquals(1L, cache.metrics().getCacheHits());
-        assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
-        assertEquals(0L, cache.metrics().getCacheMisses());
-        assertEquals(0f, cache.metrics().getCacheMissPercentage());
-        assertEquals(1L, cache.metrics().getCachePuts());
-        assertEquals(1L, cache.metrics().getCacheRemovals());
-        assertEquals(0L, cache.metrics().getCacheEvictions());
-        assert cache.metrics().getAveragePutTime() >= 0;
-        assert cache.metrics().getAverageGetTime() >= 0;
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assertEquals(1L, cache.localMetrics().getCacheHits());
+        assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage());
+        assertEquals(0L, cache.localMetrics().getCacheMisses());
+        assertEquals(0f, cache.localMetrics().getCacheMissPercentage());
+        assertEquals(1L, cache.localMetrics().getCachePuts());
+        assertEquals(1L, cache.localMetrics().getCacheRemovals());
+        assertEquals(0L, cache.localMetrics().getCacheEvictions());
+        assert cache.localMetrics().getAveragePutTime() >= 0;
+        assert cache.localMetrics().getAverageGetTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
     /**
@@ -73,36 +73,36 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
 
         cache.put(1, 10);
 
-        assertEquals(0, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.remove(1);
 
-        assertEquals(0, cache.metrics().getCacheHits());
-        assertEquals(1, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheHits());
+        assertEquals(1, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.remove(1);
 
-        assertEquals(0, cache.metrics().getCacheHits());
-        assertEquals(0, cache.metrics().getCacheMisses());
-        assertEquals(1, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheHits());
+        assertEquals(0, cache.localMetrics().getCacheMisses());
+        assertEquals(1, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.put(1, 10);
         assertTrue(cache.remove(1, 10));
 
-        assertEquals(1, cache.metrics().getCacheHits());
-        assertEquals(0, cache.metrics().getCacheMisses());
-        assertEquals(2, cache.metrics().getCacheRemovals());
-        assertEquals(2, cache.metrics().getCachePuts());
+        assertEquals(1, cache.localMetrics().getCacheHits());
+        assertEquals(0, cache.localMetrics().getCacheMisses());
+        assertEquals(2, cache.localMetrics().getCacheRemovals());
+        assertEquals(2, cache.localMetrics().getCachePuts());
 
         assertFalse(cache.remove(1, 10));
 
-        assertEquals(1, cache.metrics().getCacheHits());
-        assertEquals(1, cache.metrics().getCacheMisses());
-        assertEquals(2, cache.metrics().getCacheRemovals());
-        assertEquals(2, cache.metrics().getCachePuts());
+        assertEquals(1, cache.localMetrics().getCacheHits());
+        assertEquals(1, cache.localMetrics().getCacheMisses());
+        assertEquals(2, cache.localMetrics().getCacheRemovals());
+        assertEquals(2, cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -120,18 +120,18 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
         ++missCount;
         assertFalse(result);
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         assertNull(cache.localPeek(1));
 
         cache.put(1, 10);
         ++putCount;
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         assertNotNull(cache.localPeek(1));
 
@@ -141,18 +141,18 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
         ++hitCount;
         ++putCount;
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         result = cache.replace(1, 40, 50);
 
         assertFalse(result);
         ++hitCount;
 
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
-        assertEquals(missCount, cache.metrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
     }
 
     /**
@@ -170,17 +170,17 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
         ++putCount;
         assertTrue(result);
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         result = cache.putIfAbsent(1, 1);
 
         cache.containsKey(123);
 
         assertFalse(result);
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
-        assertEquals(missCount, cache.metrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
index 01ed157..09ff519 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
@@ -72,7 +72,7 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             assert g.cache(null).localSize() == 0;
 
-            g.cache(null).mxBean().clear();
+            g.cache(null).localMxBean().clear();
         }
     }
 
@@ -116,8 +116,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Puts: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Puts: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -131,23 +131,23 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             IgniteCache<Object, Object> jcache = g.cache(null);
 
-            info("Puts: " + jcache.metrics().getCachePuts());
-            info("Reads: " + jcache.metrics().getCacheGets());
+            info("Puts: " + jcache.localMetrics().getCachePuts());
+            info("Reads: " + jcache.localMetrics().getCacheGets());
 
             if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key))
-                assertEquals(1, jcache.metrics().getCachePuts());
+                assertEquals(1, jcache.localMetrics().getCachePuts());
             else
-                assertEquals(0, jcache.metrics().getCachePuts());
+                assertEquals(0, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
-                assertEquals(2, jcache.metrics().getCacheGets());
-                assertEquals(1, jcache.metrics().getCacheHits());
-                assertEquals(1, jcache.metrics().getCacheMisses());
+                assertEquals(2, jcache.localMetrics().getCacheGets());
+                assertEquals(1, jcache.localMetrics().getCacheHits());
+                assertEquals(1, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
         }
     }
@@ -171,8 +171,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Puts: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Puts: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -184,24 +184,24 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
             IgniteCache<Object, Object> jcache = g.cache(null);
 
             if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key))
-                assertEquals(1, jcache.metrics().getCachePuts());
+                assertEquals(1, jcache.localMetrics().getCachePuts());
             else
-                assertEquals(0, jcache.metrics().getCachePuts());
+                assertEquals(0, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
-                assertEquals(1, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(1, jcache.metrics().getCacheMisses());
+                assertEquals(1, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(1, jcache.localMetrics().getCacheMisses());
             }
             else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
-                assertEquals(1, jcache.metrics().getCacheGets());
-                assertEquals(1, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(1, jcache.localMetrics().getCacheGets());
+                assertEquals(1, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
         }
     }
@@ -225,8 +225,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -238,22 +238,22 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             IgniteCache<Object, Object> jcache = g.cache(null);
 
-            assertEquals(1, jcache.metrics().getCachePuts());
+            assertEquals(1, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
-                assertEquals(1, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(1, jcache.metrics().getCacheMisses());
+                assertEquals(1, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(1, jcache.localMetrics().getCacheMisses());
             }
             else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(1, jcache.metrics().getCacheGets());
-                assertEquals(1, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(1, jcache.localMetrics().getCacheGets());
+                assertEquals(1, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
         }
     }
@@ -275,14 +275,14 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 cache0.get(i); // +1 read.
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -296,20 +296,20 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             IgniteCache<Object, Object> jcache = g.cache(null);
 
-            info("Writes: " + jcache.metrics().getCachePuts());
-            info("Reads: " + jcache.metrics().getCacheGets());
+            info("Writes: " + jcache.localMetrics().getCachePuts());
+            info("Reads: " + jcache.localMetrics().getCacheGets());
 
-            assertEquals(0, jcache.metrics().getCachePuts());
+            assertEquals(0, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
-                assertEquals(2, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(2, jcache.metrics().getCacheMisses());
+                assertEquals(2, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(2, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
         }
     }
@@ -331,14 +331,14 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 cache0.get(i); // +1 read.
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -350,17 +350,17 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             IgniteCache<Object, Object> jcache = g.cache(null);
 
-            assertEquals(0, jcache.metrics().getCachePuts());
+            assertEquals(0, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key)) {
-                assertEquals(2, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(2, jcache.metrics().getCacheMisses());
+                assertEquals(2, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(2, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
         }
     }
@@ -383,10 +383,10 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
                 key = i;
 
-                info("Writes: " + cache0.metrics().getCachePuts());
-                info("Reads: " + cache0.metrics().getCacheGets());
-                info("Hits: " + cache0.metrics().getCacheHits());
-                info("Misses: " + cache0.metrics().getCacheMisses());
+                info("Writes: " + cache0.localMetrics().getCachePuts());
+                info("Reads: " + cache0.localMetrics().getCacheGets());
+                info("Hits: " + cache0.localMetrics().getCacheHits());
+                info("Misses: " + cache0.localMetrics().getCacheMisses());
                 info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
 
                 break;
@@ -398,22 +398,22 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
 
             IgniteCache<Object, Object> jcache = g.cache(null);
 
-            assertEquals(0, jcache.metrics().getCachePuts());
+            assertEquals(0, jcache.localMetrics().getCachePuts());
 
             if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
-                assertEquals(2, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(2, jcache.metrics().getCacheMisses());
+                assertEquals(2, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(2, jcache.localMetrics().getCacheMisses());
             }
             else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
-                assertEquals(0, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(0, jcache.metrics().getCacheMisses());
+                assertEquals(0, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(0, jcache.localMetrics().getCacheMisses());
             }
             else {
-                assertEquals(2, jcache.metrics().getCacheGets());
-                assertEquals(0, jcache.metrics().getCacheHits());
-                assertEquals(2, jcache.metrics().getCacheMisses());
+                assertEquals(2, jcache.localMetrics().getCacheGets());
+                assertEquals(0, jcache.localMetrics().getCacheHits());
+                assertEquals(2, jcache.localMetrics().getCacheMisses());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
index 02eb9d8..16faa45 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
@@ -114,7 +114,7 @@ public class GridCachePartitionedHitsAndMissesSelfTest extends GridCommonAbstrac
             long misses = 0;
 
             for (int i = 0; i < GRID_CNT; i++) {
-                CacheMetrics m = grid(i).cache(null).metrics();
+                CacheMetrics m = grid(i).cache(null).localMetrics();
 
                 hits += m.getCacheHits();
                 misses += m.getCacheMisses();

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
index b638236..15ac96e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
@@ -113,74 +113,74 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
-        assertEquals(0, cache.metrics().getOffHeapHits());
-        assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
-        assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
-        assertEquals(0, cache.metrics().getOffHeapRemovals());
-
-        assertEquals(0, cache.metrics().getOffHeapEvictions());
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapEntriesCount());
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapGets());
+        assertEquals(0, cache.localMetrics().getOffHeapHits());
+        assertEquals(0f, cache.localMetrics().getOffHeapHitPercentage());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100f, cache.localMetrics().getOffHeapMissPercentage());
+        assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+        assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapHits());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapRemovals());
 
-        assertEquals(0, cache.metrics().getOffHeapEvictions());
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
 
         for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
-        assertEquals(100 / 3.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
-        assertEquals(100 - (100 / 3.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapHits());
+        assertEquals(100 / 3.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100 - (100 / 3.0), cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapRemovals());
 
-        assertEquals(0, cache.metrics().getOffHeapEvictions());
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.remove(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapHits());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getOffHeapGets());
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getOffHeapHits());
         assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
+            cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
         assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapRemovals());
+            cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getOffHeapRemovals());
 
-        assertEquals(0, cache.metrics().getOffHeapEvictions());
-        assertEquals(0, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(0, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
     }
 
     /**
@@ -194,62 +194,62 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
-        assertEquals(0, cache.metrics().getSwapHits());
-        assertEquals(0f, cache.metrics().getSwapHitPercentage());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
-        assertEquals(100f, cache.metrics().getSwapMissPercentage());
-        assertEquals(0, cache.metrics().getSwapRemovals());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapGets());
+        assertEquals(0, cache.localMetrics().getSwapHits());
+        assertEquals(0f, cache.localMetrics().getSwapHitPercentage());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+        assertEquals(100f, cache.localMetrics().getSwapMissPercentage());
+        assertEquals(0, cache.localMetrics().getSwapRemovals());
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
 
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getSwapEntriesCount());
 
         for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
-        assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
-        assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 3, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+        assertEquals(100 / 3.0, cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
+        assertEquals(100 - (100 / 3.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
 
-        assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+        assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getSwapEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.remove(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapHits());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getSwapHits());
         assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+            cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
         assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapRemovals());
+            cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getSwapRemovals());
 
-        assertEquals(0, cache.metrics().getSwapEntriesCount());
+        assertEquals(0, cache.localMetrics().getSwapEntriesCount());
     }
 
     /**
@@ -263,116 +263,116 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
-        assertEquals(0, cache.metrics().getOffHeapHits());
-        assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
-        assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
-        assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
-        assertEquals(0, cache.metrics().getOffHeapRemovals());
-
-        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
-        assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
-        assertEquals(0, cache.metrics().getSwapHits());
-        assertEquals(0f, cache.metrics().getSwapHitPercentage());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
-        assertEquals(100f, cache.metrics().getSwapMissPercentage());
-        assertEquals(0, cache.metrics().getSwapRemovals());
-
-        assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapGets());
+        assertEquals(0, cache.localMetrics().getOffHeapHits());
+        assertEquals(0f, cache.localMetrics().getOffHeapHitPercentage());
+        assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100f, cache.localMetrics().getOffHeapMissPercentage());
+        assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+        assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapGets());
+        assertEquals(0, cache.localMetrics().getSwapHits());
+        assertEquals(0f, cache.localMetrics().getSwapHitPercentage());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+        assertEquals(100f, cache.localMetrics().getSwapMissPercentage());
+        assertEquals(0, cache.localMetrics().getSwapRemovals());
+
+        assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
-        assertEquals(0, cache.metrics().getOffHeapHits());
-        assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
-        assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(0, cache.metrics().getOffHeapRemovals());
-
-        assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
-        assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
-        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
-
-        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapGets());
+        assertEquals(0, cache.localMetrics().getOffHeapHits());
+        assertEquals(0.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100.0, cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+        assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+        assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+        assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
+
+        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapEntriesCount());
 
         for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
             cache.get(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
-        assertEquals(0, cache.metrics().getOffHeapHits());
-        assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapMisses());
-        assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(0, cache.metrics().getOffHeapRemovals());
-
-        assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
-        assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
-        assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
-        assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
-
-        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapGets());
+        assertEquals(0, cache.localMetrics().getOffHeapHits());
+        assertEquals(0.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapMisses());
+        assertEquals(100.0, cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+        assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+        assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 3, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+        assertEquals(100 / 3.0, cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
+        assertEquals(100 - (100 / 3.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
+
+        assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapEntriesCount());
 
         for (int i = 0; i < KEYS_CNT; i++)
             cache.remove(i);
 
         printStat();
 
-        assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
-        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapHits());
+        assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+        assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getOffHeapGets());
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapHits());
         assertEquals(100 * OFFHEAP_MAX_CNT / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getOffHeapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE, cache.metrics().getOffHeapMisses());
+            cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE, cache.localMetrics().getOffHeapMisses());
         assertEquals(100 * (KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
-            cache.metrics().getOffHeapMissPercentage(), 0.1);
-        assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapRemovals());
+            cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+        assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapRemovals());
 
-        assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
-        assertEquals(0, cache.metrics().getOffHeapEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
-        assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+        assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+        assertEquals(0, cache.localMetrics().getOffHeapEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+        assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
 
-        assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
-        assertEquals(KEYS_CNT * 4 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapGets());
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapHits());
+        assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+        assertEquals(KEYS_CNT * 4 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapGets());
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapHits());
         assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE - OFFHEAP_MAX_CNT) / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
-            cache.metrics().getSwapHitPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+            cache.localMetrics().getSwapHitPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
         assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
-            cache.metrics().getSwapMissPercentage(), 0.1);
-        assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapRemovals());
+            cache.localMetrics().getSwapMissPercentage(), 0.1);
+        assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapRemovals());
 
-        assertEquals(0, cache.metrics().getSwapEntriesCount());
+        assertEquals(0, cache.localMetrics().getSwapEntriesCount());
     }
 
     /**
@@ -380,36 +380,36 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
      */
     protected void printStat() {
         System.out.println("!!! -------------------------------------------------------");
-        System.out.println("!!! Puts: cache = " + cache.metrics().getCachePuts() +
-            ", offheap = " + cache.metrics().getOffHeapPuts() +
-            ", swap = " + cache.metrics().getSwapPuts());
-        System.out.println("!!! Gets: cache = " + cache.metrics().getCacheGets() +
-            ", offheap = " + cache.metrics().getOffHeapGets() +
-            ", swap = " + cache.metrics().getSwapGets());
-        System.out.println("!!! Removes: cache = " + cache.metrics().getCacheRemovals() +
-            ", offheap = " + cache.metrics().getOffHeapRemovals() +
-            ", swap = " + cache.metrics().getSwapRemovals());
-        System.out.println("!!! Evictions: cache = " + cache.metrics().getCacheEvictions() +
-            ", offheap = " + cache.metrics().getOffHeapEvictions() +
+        System.out.println("!!! Puts: cache = " + cache.localMetrics().getCachePuts() +
+            ", offheap = " + cache.localMetrics().getOffHeapPuts() +
+            ", swap = " + cache.localMetrics().getSwapPuts());
+        System.out.println("!!! Gets: cache = " + cache.localMetrics().getCacheGets() +
+            ", offheap = " + cache.localMetrics().getOffHeapGets() +
+            ", swap = " + cache.localMetrics().getSwapGets());
+        System.out.println("!!! Removes: cache = " + cache.localMetrics().getCacheRemovals() +
+            ", offheap = " + cache.localMetrics().getOffHeapRemovals() +
+            ", swap = " + cache.localMetrics().getSwapRemovals());
+        System.out.println("!!! Evictions: cache = " + cache.localMetrics().getCacheEvictions() +
+            ", offheap = " + cache.localMetrics().getOffHeapEvictions() +
             ", swap = none" );
-        System.out.println("!!! Hits: cache = " + cache.metrics().getCacheHits() +
-            ", offheap = " + cache.metrics().getOffHeapHits() +
-            ", swap = " + cache.metrics().getSwapHits());
-        System.out.println("!!! Hit(%): cache = " + cache.metrics().getCacheHitPercentage() +
-            ", offheap = " + cache.metrics().getOffHeapHitPercentage() +
-            ", swap = " + cache.metrics().getSwapHitPercentage());
-        System.out.println("!!! Misses: cache = " + cache.metrics().getCacheMisses() +
-            ", offheap = " + cache.metrics().getOffHeapMisses() +
-            ", swap = " + cache.metrics().getSwapMisses());
-        System.out.println("!!! Miss(%): cache = " + cache.metrics().getCacheMissPercentage() +
-            ", offheap = " + cache.metrics().getOffHeapMissPercentage() +
-            ", swap = " + cache.metrics().getSwapMissPercentage());
-        System.out.println("!!! Entries: cache = " + cache.metrics().getSize() +
-            ", offheap = " + cache.metrics().getOffHeapEntriesCount() +
-            ", swap = " + cache.metrics().getSwapEntriesCount());
+        System.out.println("!!! Hits: cache = " + cache.localMetrics().getCacheHits() +
+            ", offheap = " + cache.localMetrics().getOffHeapHits() +
+            ", swap = " + cache.localMetrics().getSwapHits());
+        System.out.println("!!! Hit(%): cache = " + cache.localMetrics().getCacheHitPercentage() +
+            ", offheap = " + cache.localMetrics().getOffHeapHitPercentage() +
+            ", swap = " + cache.localMetrics().getSwapHitPercentage());
+        System.out.println("!!! Misses: cache = " + cache.localMetrics().getCacheMisses() +
+            ", offheap = " + cache.localMetrics().getOffHeapMisses() +
+            ", swap = " + cache.localMetrics().getSwapMisses());
+        System.out.println("!!! Miss(%): cache = " + cache.localMetrics().getCacheMissPercentage() +
+            ", offheap = " + cache.localMetrics().getOffHeapMissPercentage() +
+            ", swap = " + cache.localMetrics().getSwapMissPercentage());
+        System.out.println("!!! Entries: cache = " + cache.localMetrics().getSize() +
+            ", offheap = " + cache.localMetrics().getOffHeapEntriesCount() +
+            ", swap = " + cache.localMetrics().getSwapEntriesCount());
         System.out.println("!!! Size: cache = none" +
-            ", offheap = " + cache.metrics().getOffHeapAllocatedSize() +
-            ", swap = " + cache.metrics().getSwapSize());
+            ", offheap = " + cache.localMetrics().getOffHeapAllocatedSize() +
+            ", swap = " + cache.localMetrics().getSwapSize());
         System.out.println();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
index 0cc2377..fa21de9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
@@ -45,19 +45,19 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
             }
         });
 
-        assertEquals(1L, cache.metrics().getCachePuts());
+        assertEquals(1L, cache.localMetrics().getCachePuts());
 
         assertEquals(20, result);
-        assertEquals(1L, cache.metrics().getCacheHits());
-        assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
-        assertEquals(0L, cache.metrics().getCacheMisses());
-        assertEquals(0f, cache.metrics().getCacheMissPercentage());
-        assertEquals(1L, cache.metrics().getCachePuts());
-        assertEquals(1L, cache.metrics().getCacheRemovals());
-        assertEquals(0L, cache.metrics().getCacheEvictions());
-        assert cache.metrics().getAveragePutTime() >= 0;
-        assert cache.metrics().getAverageGetTime() >= 0;
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assertEquals(1L, cache.localMetrics().getCacheHits());
+        assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage());
+        assertEquals(0L, cache.localMetrics().getCacheMisses());
+        assertEquals(0f, cache.localMetrics().getCacheMissPercentage());
+        assertEquals(1L, cache.localMetrics().getCachePuts());
+        assertEquals(1L, cache.localMetrics().getCacheRemovals());
+        assertEquals(0L, cache.localMetrics().getCacheEvictions());
+        assert cache.localMetrics().getAveragePutTime() >= 0;
+        assert cache.localMetrics().getAverageGetTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
     /**
@@ -68,36 +68,36 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
 
         cache.put(1, 10);
 
-        assertEquals(0, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.remove(1);
 
-        assertEquals(0, cache.metrics().getCacheHits());
-        assertEquals(1, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheHits());
+        assertEquals(1, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.remove(1);
 
-        assertEquals(0, cache.metrics().getCacheHits());
-        assertEquals(0, cache.metrics().getCacheMisses());
-        assertEquals(1, cache.metrics().getCacheRemovals());
-        assertEquals(1, cache.metrics().getCachePuts());
+        assertEquals(0, cache.localMetrics().getCacheHits());
+        assertEquals(0, cache.localMetrics().getCacheMisses());
+        assertEquals(1, cache.localMetrics().getCacheRemovals());
+        assertEquals(1, cache.localMetrics().getCachePuts());
 
         cache.put(1, 10);
         assertTrue(cache.remove(1, 10));
 
-        assertEquals(1, cache.metrics().getCacheHits());
-        assertEquals(0, cache.metrics().getCacheMisses());
-        assertEquals(2, cache.metrics().getCacheRemovals());
-        assertEquals(2, cache.metrics().getCachePuts());
+        assertEquals(1, cache.localMetrics().getCacheHits());
+        assertEquals(0, cache.localMetrics().getCacheMisses());
+        assertEquals(2, cache.localMetrics().getCacheRemovals());
+        assertEquals(2, cache.localMetrics().getCachePuts());
 
         assertFalse(cache.remove(1, 10));
 
-        assertEquals(1, cache.metrics().getCacheHits());
-        assertEquals(1, cache.metrics().getCacheMisses());
-        assertEquals(2, cache.metrics().getCacheRemovals());
-        assertEquals(2, cache.metrics().getCachePuts());
+        assertEquals(1, cache.localMetrics().getCacheHits());
+        assertEquals(1, cache.localMetrics().getCacheMisses());
+        assertEquals(2, cache.localMetrics().getCacheRemovals());
+        assertEquals(2, cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -115,18 +115,18 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
         ++missCount;
         assertFalse(result);
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         assertNull(cache.localPeek(1));
 
         cache.put(1, 10);
         ++putCount;
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         assertNotNull(cache.localPeek(1));
 
@@ -136,18 +136,18 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
         ++hitCount;
         ++putCount;
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         result = cache.replace(1, 40, 50);
 
         assertFalse(result);
         ++hitCount;
 
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
-        assertEquals(missCount, cache.metrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
     }
 
     /**
@@ -165,15 +165,15 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
         ++putCount;
         assertTrue(result);
 
-        assertEquals(missCount, cache.metrics().getCacheMisses());
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
 
         result = cache.putIfAbsent(1, 1);
 
         assertFalse(result);
-        assertEquals(hitCount, cache.metrics().getCacheHits());
-        assertEquals(putCount, cache.metrics().getCachePuts());
-        assertEquals(missCount, cache.metrics().getCacheMisses());
+        assertEquals(hitCount, cache.localMetrics().getCacheHits());
+        assertEquals(putCount, cache.localMetrics().getCachePuts());
+        assertEquals(missCount, cache.localMetrics().getCacheMisses());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 7286fb3..205dc83 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -439,11 +439,19 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
         throw new UnsupportedOperationException("Method should be supported.");
     }
 
+    @Override public CacheMetrics localMetrics() {
+        throw new UnsupportedOperationException("Method should be supported.");
+    }
+
     /** {@inheritDoc} */
     @Override public CacheMetricsMXBean mxBean() {
         throw new UnsupportedOperationException("Method should be supported.");
     }
 
+    @Override public CacheMetricsMXBean localMxBean() {
+        throw new UnsupportedOperationException("Method should be supported.");
+    }
+
     /** {@inheritDoc} */
     @Override public <K1, V1> IgniteCache<K1, V1> withKeepBinary() {
         throw new UnsupportedOperationException("Method should be supported.");


[07/27] ignite git commit: Added CacheLoadOnlyStoreExample's csv to exclusions from RAT validation.

Posted by nt...@apache.org.
Added CacheLoadOnlyStoreExample's csv to exclusions from RAT validation.


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

Branch: refs/heads/ignite-2004
Commit: b81e38dc6c7b97bcc846744d62f9e4213cacbde2
Parents: 093623e
Author: shtykh_roman <rs...@yahoo.com>
Authored: Fri Mar 25 09:48:43 2016 +0900
Committer: shtykh_roman <rs...@yahoo.com>
Committed: Fri Mar 25 09:48:43 2016 +0900

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/b81e38dc/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a52ac12..8be235a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -791,6 +791,7 @@
                                         <exclude>src/test/java/org/apache/ignite/internal/processors/hadoop/books/*.txt</exclude><!--books examples-->
                                         <exclude>src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
                                         <exclude>examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
+                                        <exclude>src/main/resources/person.csv</exclude><!--CacheLoadOnlyStoreExample csv-->
                                         <exclude>src/main/java/META-INF/services/javax.cache.spi.CachingProvider</exclude><!--cannot be changed-->
                                         <exclude>src/main/java/org/jetbrains/annotations/*.java</exclude><!--copyright-->
                                         <exclude>src/main/resources/META-INF/services/org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider</exclude><!--cannot be changed-->


[20/27] ignite git commit: Divide test suite.

Posted by nt...@apache.org.
Divide test suite.


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

Branch: refs/heads/ignite-2004
Commit: 7a5024cb47938932739d8cc469c61ae05621ab04
Parents: 35fd10d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Mar 28 16:59:56 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Mar 28 17:04:42 2016 +0300

----------------------------------------------------------------------
 ...acheContinuousQueryRandomOperationsTest.java |  8 ++--
 .../IgniteBinaryCacheQueryTestSuite4.java       | 39 ++++++++++++++++
 .../IgniteCacheQuerySelfTestSuite3.java         | 22 ---------
 .../IgniteCacheQuerySelfTestSuite4.java         | 49 ++++++++++++++++++++
 4 files changed, 92 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
index b1316ab..e9fbf70 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
@@ -146,13 +146,13 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
      * @throws Exception If failed.
      */
     public void testFilterAndFactoryProvided() throws Exception {
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+        final CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
             1,
             ATOMIC,
             ONHEAP_TIERED,
             false);
 
-        final IgniteCache<Object, Object> cache = grid(0).getOrCreateCache(ccfg);
+        grid(0).createCache(ccfg);
 
         try {
             final ContinuousQuery qry = new ContinuousQuery();
@@ -177,13 +177,13 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
 
             GridTestUtils.assertThrows(log, new Callable<Object>() {
                 @Override public Object call() throws Exception {
-                    return cache.query(qry);
+                    return grid(0).cache(ccfg.getName()).query(qry);
                 }
             }, IgniteException.class, null);
 
         }
         finally {
-            cache.destroy();
+            grid(0).destroyCache(ccfg.getName());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
new file mode 100644
index 0000000..32a693f
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with binary marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite4 extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        TestSuite suite = IgniteCacheQuerySelfTestSuite4.suite();
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index b2cb50b..73c856b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@ -20,17 +20,7 @@ package org.apache.ignite.testsuites;
 import junit.framework.TestSuite;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchAckTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchForceServerModeAckTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedTxTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedTxTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTwoNodesTest;
@@ -58,7 +48,6 @@ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheCon
 import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientReconnectTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTxReconnectTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryReconnectTest;
 
 /**
  * Test suite for cache queries.
@@ -93,19 +82,8 @@ public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
         suite.addTestSuite(GridCacheContinuousQueryPartitionTxOneNodeTest.class);
         suite.addTestSuite(GridCacheContinuousQueryPartitionAtomicOneNodeTest.class);
         suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
-        suite.addTestSuite(IgniteCacheContinuousQueryReconnectTest.class);
         suite.addTestSuite(IgniteCacheContinuousQueryClientReconnectTest.class);
         suite.addTestSuite(IgniteCacheContinuousQueryClientTxReconnectTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterPartitionedAtomicTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterPartitionedTxTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterReplicatedAtomicTest.class);
-        suite.addTestSuite(CacheContinuousQueryCounterReplicatedTxTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
-        suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
         suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
         suite.addTestSuite(CacheContinuousQueryRandomOperationsTwoNodesTest.class);
         suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
new file mode 100644
index 0000000..fa4e642
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
+
+/**
+ * Test suite for cache queries.
+ */
+public class IgniteCacheQuerySelfTestSuite4 extends TestSuite {
+    /**
+     * @return Test suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Ignite Cache Queries Test Suite 4");
+
+        // Continuous queries failover tests.
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
+        suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
+
+        return suite;
+    }
+}


[23/27] ignite git commit: IGNITE-1071 IgniteCache.metrics() method returns local metrics

Posted by nt...@apache.org.
IGNITE-1071 IgniteCache.metrics() method returns local metrics


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

Branch: refs/heads/ignite-2004
Commit: f17b2ae0ea150a2803584f80276ada527db54b5a
Parents: 134f26e
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 19:19:26 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 19:34:29 2016 +0300

----------------------------------------------------------------------
 .../rest/RestBinaryProtocolSelfTest.java        |   4 +-
 .../rest/RestMemcacheProtocolSelfTest.java      |   4 +-
 .../java/org/apache/ignite/IgniteCache.java     |  20 +-
 .../discovery/GridDiscoveryManager.java         |   2 +-
 .../cache/CacheClusterMetricsMXBeanImpl.java    | 410 +++++++++++++++++++
 .../cache/CacheLocalMetricsMXBeanImpl.java      | 410 +++++++++++++++++++
 .../cache/CacheMetricsMXBeanImpl.java           | 410 -------------------
 .../processors/cache/GridCacheAdapter.java      |  43 +-
 .../processors/cache/GridCacheProcessor.java    |  12 +-
 .../processors/cache/GridCacheProxyImpl.java    |  45 +-
 .../processors/cache/IgniteCacheProxy.java      |  39 +-
 .../processors/cache/IgniteInternalCache.java   |  31 +-
 .../platform/cache/PlatformCache.java           |   2 +-
 .../handlers/cache/GridCacheCommandHandler.java |   2 +-
 .../internal/visor/cache/VisorCacheMetrics.java |   2 +-
 .../visor/cache/VisorCacheResetMetricsTask.java |   2 +-
 .../CacheMetricsForClusterGroupSelfTest.java    |   2 +-
 .../cache/CacheSwapUnswapGetTest.java           |   4 +-
 .../cache/GridCacheAbstractMetricsSelfTest.java | 124 +++---
 .../GridCacheOffHeapValuesEvictionSelfTest.java |  18 +-
 ...cheTransactionalAbstractMetricsSelfTest.java |   4 +-
 .../dht/GridCacheColocatedDebugTest.java        |   2 +-
 ...ePartitionedNearDisabledMetricsSelfTest.java |   2 +-
 ...AtomicPartitionedTckMetricsSelfTestImpl.java |  92 ++---
 .../near/GridCacheNearMetricsSelfTest.java      | 152 +++----
 ...idCachePartitionedHitsAndMissesSelfTest.java |   2 +-
 ...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 380 ++++++++---------
 ...dCacheAtomicLocalTckMetricsSelfTestImpl.java |  92 ++---
 .../multijvm/IgniteCacheProcessProxy.java       |   8 +
 29 files changed, 1431 insertions(+), 889 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
index 7629afb..251e184 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
@@ -412,9 +412,9 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest {
         IgniteCache<Object, Object> jcacheDft = grid().cache(null);
         IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME);
 
-        jcacheDft.mxBean().clear();
+        jcacheDft.localMxBean().clear();
 
-        jcacheName.mxBean().clear();
+        jcacheName.localMxBean().clear();
 
         jcacheDft.put("key1", "val");
         jcacheDft.put("key2", "val");

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
index fbaee9e..2797387 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
@@ -205,8 +205,8 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testMetrics() throws Exception {
-        grid().cache(null).mxBean().clear();
-        grid().cache(CACHE_NAME).mxBean().clear();
+        grid().cache(null).localMxBean().clear();
+        grid().cache(CACHE_NAME).localMxBean().clear();
 
         grid().cache(null).put("key1", "val");
         grid().cache(null).put("key2", "val");

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index a791e38..581f091 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -715,14 +715,14 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
     public IgniteFuture<?> rebalance();
 
     /**
-     * Gets snapshot metrics (statistics) for this cache.
+     * Gets whole cluster snapshot metrics (statistics) for this cache.
      *
      * @return Cache metrics.
      */
     public CacheMetrics metrics();
 
     /**
-     * Gets snapshot metrics for caches in cluster group.
+     * Gets cluster group snapshot metrics for caches in cluster group.
      *
      * @param grp Cluster group.
      * @return Cache metrics.
@@ -730,9 +730,23 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
     public CacheMetrics metrics(ClusterGroup grp);
 
     /**
-     * Gets MxBean for this cache.
+     * Gets local snapshot metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetrics localMetrics();
+
+    /**
+     * Gets whole cluster MxBean for this cache.
      *
      * @return MxBean.
      */
     public CacheMetricsMXBean mxBean();
+
+    /**
+     * Gets local MxBean for this cache.
+     *
+     * @return MxBean.
+     */
+    public CacheMetricsMXBean localMxBean();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 7b795d5..a254b73 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
@@ -908,7 +908,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
                         if (metrics == null)
                             metrics = U.newHashMap(caches.size());
 
-                        metrics.put(cache.context().cacheId(), cache.metrics());
+                        metrics.put(cache.context().cacheId(), cache.localMetrics());
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
new file mode 100644
index 0000000..519d07b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * 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 org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
+    /** Cache. */
+    private GridCacheAdapter<?, ?> cache;
+
+    /**
+     * Creates MBean;
+     *
+     * @param cache Cache.
+     */
+    CacheClusterMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+        assert cache != null;
+
+        this.cache = cache;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return cache.clusterMetrics().name();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOverflowSize() {
+        return cache.clusterMetrics().getOverflowSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapGets() {
+        return cache.clusterMetrics().getOffHeapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPuts() {
+        return cache.clusterMetrics().getOffHeapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapRemovals() {
+        return cache.clusterMetrics().getOffHeapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEvictions() {
+        return cache.clusterMetrics().getOffHeapEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapHits() {
+        return cache.clusterMetrics().getOffHeapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapHitPercentage() {
+        return cache.clusterMetrics().getOffHeapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMisses() {
+        return cache.clusterMetrics().getOffHeapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapMissPercentage() {
+        return cache.clusterMetrics().getOffHeapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEntriesCount() {
+        return cache.clusterMetrics().getOffHeapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPrimaryEntriesCount() {
+        return cache.clusterMetrics().getOffHeapPrimaryEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapBackupEntriesCount() {
+        return cache.clusterMetrics().getOffHeapBackupEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapAllocatedSize() {
+        return cache.clusterMetrics().getOffHeapAllocatedSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMaxSize() {
+        return cache.clusterMetrics().getOffHeapMaxSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapGets() {
+        return cache.clusterMetrics().getSwapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapPuts() {
+        return cache.clusterMetrics().getSwapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapRemovals() {
+        return cache.clusterMetrics().getSwapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapHits() {
+        return cache.clusterMetrics().getSwapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapMisses() {
+        return cache.clusterMetrics().getSwapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapHitPercentage() {
+        return cache.clusterMetrics().getSwapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapMissPercentage() {
+        return cache.clusterMetrics().getSwapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapEntriesCount() {
+        return cache.clusterMetrics().getSwapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapSize() {
+        return cache.clusterMetrics().getSwapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getSize() {
+        return cache.clusterMetrics().getSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getKeySize() {
+        return cache.clusterMetrics().getKeySize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return cache.clusterMetrics().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDhtEvictQueueCurrentSize() {
+        return cache.clusterMetrics().getDhtEvictQueueCurrentSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommitQueueSize() {
+        return cache.clusterMetrics().getTxCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxThreadMapSize() {
+        return cache.clusterMetrics().getTxThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxXidMapSize() {
+        return cache.clusterMetrics().getTxXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxPrepareQueueSize() {
+        return cache.clusterMetrics().getTxPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxStartVersionCountsSize() {
+        return cache.clusterMetrics().getTxStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommittedVersionsSize() {
+        return cache.clusterMetrics().getTxCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxRolledbackVersionsSize() {
+        return cache.clusterMetrics().getTxRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtThreadMapSize() {
+        return cache.clusterMetrics().getTxDhtThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtXidMapSize() {
+        return cache.clusterMetrics().getTxDhtXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommitQueueSize() {
+        return cache.clusterMetrics().getTxDhtCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtPrepareQueueSize() {
+        return cache.clusterMetrics().getTxDhtPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtStartVersionCountsSize() {
+        return cache.clusterMetrics().getTxDhtStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommittedVersionsSize() {
+        return cache.clusterMetrics().getTxDhtCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtRolledbackVersionsSize() {
+        return cache.clusterMetrics().getTxDhtRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteBehindEnabled() {
+        return cache.clusterMetrics().isWriteBehindEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushSize() {
+        return cache.clusterMetrics().getWriteBehindFlushSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushThreadCount() {
+        return cache.clusterMetrics().getWriteBehindFlushThreadCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getWriteBehindFlushFrequency() {
+        return cache.clusterMetrics().getWriteBehindFlushFrequency();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindStoreBatchSize() {
+        return cache.clusterMetrics().getWriteBehindStoreBatchSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindTotalCriticalOverflowCount() {
+        return cache.clusterMetrics().getWriteBehindTotalCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindCriticalOverflowCount() {
+        return cache.clusterMetrics().getWriteBehindCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindErrorRetryCount() {
+        return cache.clusterMetrics().getWriteBehindErrorRetryCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindBufferSize() {
+        return cache.clusterMetrics().getWriteBehindBufferSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        throw new UnsupportedOperationException("Cluster metrics can't be cleared. Use local metrics clear instead.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheHits() {
+        return cache.clusterMetrics().getCacheHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheHitPercentage() {
+        return cache.clusterMetrics().getCacheHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheMisses() {
+        return cache.clusterMetrics().getCacheMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheMissPercentage() {
+        return cache.clusterMetrics().getCacheMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheGets() {
+        return cache.clusterMetrics().getCacheGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCachePuts() {
+        return cache.clusterMetrics().getCachePuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheRemovals() {
+        return cache.clusterMetrics().getCacheRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheEvictions() {
+        return cache.clusterMetrics().getCacheEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageGetTime() {
+        return cache.clusterMetrics().getAverageGetTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAveragePutTime() {
+        return cache.clusterMetrics().getAveragePutTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageRemoveTime() {
+        return cache.clusterMetrics().getAverageRemoveTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxCommitTime() {
+        return cache.clusterMetrics().getAverageTxCommitTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxRollbackTime() {
+        return cache.clusterMetrics().getAverageTxRollbackTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxCommits() {
+        return cache.clusterMetrics().getCacheTxCommits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxRollbacks() {
+        return cache.clusterMetrics().getCacheTxRollbacks();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getKeyType() {
+        return cache.clusterMetrics().getKeyType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getValueType() {
+        return cache.clusterMetrics().getValueType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStoreByValue() {
+        return cache.clusterMetrics().isStoreByValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStatisticsEnabled() {
+        return cache.clusterMetrics().isStatisticsEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isManagementEnabled() {
+        return cache.clusterMetrics().isManagementEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isReadThrough() {
+        return cache.clusterMetrics().isReadThrough();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteThrough() {
+        return cache.clusterMetrics().isWriteThrough();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
new file mode 100644
index 0000000..5284ca0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * 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 org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
+    /** Cache. */
+    private GridCacheAdapter<?, ?> cache;
+
+    /**
+     * Creates MBean;
+     *
+     * @param cache Cache.
+     */
+    CacheLocalMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+        assert cache != null;
+
+        this.cache = cache;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return cache.metrics0().name();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOverflowSize() {
+        return cache.metrics0().getOverflowSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapGets() {
+        return cache.metrics0().getOffHeapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPuts() {
+        return cache.metrics0().getOffHeapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapRemovals() {
+        return cache.metrics0().getOffHeapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEvictions() {
+        return cache.metrics0().getOffHeapEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapHits() {
+        return cache.metrics0().getOffHeapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapHitPercentage() {
+        return cache.metrics0().getOffHeapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMisses() {
+        return cache.metrics0().getOffHeapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapMissPercentage() {
+        return cache.metrics0().getOffHeapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEntriesCount() {
+        return cache.metrics0().getOffHeapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPrimaryEntriesCount() {
+        return cache.metrics0().getOffHeapPrimaryEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapBackupEntriesCount() {
+        return cache.metrics0().getOffHeapBackupEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapAllocatedSize() {
+        return cache.metrics0().getOffHeapAllocatedSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMaxSize() {
+        return cache.metrics0().getOffHeapMaxSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapGets() {
+        return cache.metrics0().getSwapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapPuts() {
+        return cache.metrics0().getSwapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapRemovals() {
+        return cache.metrics0().getSwapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapHits() {
+        return cache.metrics0().getSwapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapMisses() {
+        return cache.metrics0().getSwapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapHitPercentage() {
+        return cache.metrics0().getSwapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapMissPercentage() {
+        return cache.metrics0().getSwapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapEntriesCount() {
+        return cache.metrics0().getSwapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapSize() {
+        return cache.metrics0().getSwapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getSize() {
+        return cache.metrics0().getSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getKeySize() {
+        return cache.metrics0().getKeySize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return cache.metrics0().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDhtEvictQueueCurrentSize() {
+        return cache.metrics0().getDhtEvictQueueCurrentSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommitQueueSize() {
+        return cache.metrics0().getTxCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxThreadMapSize() {
+        return cache.metrics0().getTxThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxXidMapSize() {
+        return cache.metrics0().getTxXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxPrepareQueueSize() {
+        return cache.metrics0().getTxPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxStartVersionCountsSize() {
+        return cache.metrics0().getTxStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommittedVersionsSize() {
+        return cache.metrics0().getTxCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxRolledbackVersionsSize() {
+        return cache.metrics0().getTxRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtThreadMapSize() {
+        return cache.metrics0().getTxDhtThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtXidMapSize() {
+        return cache.metrics0().getTxDhtXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommitQueueSize() {
+        return cache.metrics0().getTxDhtCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtPrepareQueueSize() {
+        return cache.metrics0().getTxDhtPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtStartVersionCountsSize() {
+        return cache.metrics0().getTxDhtStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommittedVersionsSize() {
+        return cache.metrics0().getTxDhtCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtRolledbackVersionsSize() {
+        return cache.metrics0().getTxDhtRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteBehindEnabled() {
+        return cache.metrics0().isWriteBehindEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushSize() {
+        return cache.metrics0().getWriteBehindFlushSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushThreadCount() {
+        return cache.metrics0().getWriteBehindFlushThreadCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getWriteBehindFlushFrequency() {
+        return cache.metrics0().getWriteBehindFlushFrequency();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindStoreBatchSize() {
+        return cache.metrics0().getWriteBehindStoreBatchSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindTotalCriticalOverflowCount() {
+        return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindCriticalOverflowCount() {
+        return cache.metrics0().getWriteBehindCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindErrorRetryCount() {
+        return cache.metrics0().getWriteBehindErrorRetryCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindBufferSize() {
+        return cache.metrics0().getWriteBehindBufferSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        cache.metrics0().clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheHits() {
+        return cache.metrics0().getCacheHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheHitPercentage() {
+        return cache.metrics0().getCacheHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheMisses() {
+        return cache.metrics0().getCacheMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheMissPercentage() {
+        return cache.metrics0().getCacheMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheGets() {
+        return cache.metrics0().getCacheGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCachePuts() {
+        return cache.metrics0().getCachePuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheRemovals() {
+        return cache.metrics0().getCacheRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheEvictions() {
+        return cache.metrics0().getCacheEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageGetTime() {
+        return cache.metrics0().getAverageGetTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAveragePutTime() {
+        return cache.metrics0().getAveragePutTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageRemoveTime() {
+        return cache.metrics0().getAverageRemoveTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxCommitTime() {
+        return cache.metrics0().getAverageTxCommitTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxRollbackTime() {
+        return cache.metrics0().getAverageTxRollbackTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxCommits() {
+        return cache.metrics0().getCacheTxCommits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxRollbacks() {
+        return cache.metrics0().getCacheTxRollbacks();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getKeyType() {
+        return cache.metrics0().getKeyType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getValueType() {
+        return cache.metrics0().getValueType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStoreByValue() {
+        return cache.metrics0().isStoreByValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStatisticsEnabled() {
+        return cache.metrics0().isStatisticsEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isManagementEnabled() {
+        return cache.metrics0().isManagementEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isReadThrough() {
+        return cache.metrics0().isReadThrough();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteThrough() {
+        return cache.metrics0().isWriteThrough();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
deleted file mode 100644
index 822240e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
+++ /dev/null
@@ -1,410 +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.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.mxbean.CacheMetricsMXBean;
-
-/**
- * Management bean that provides access to {@link IgniteCache IgniteCache}.
- */
-class CacheMetricsMXBeanImpl implements CacheMetricsMXBean {
-    /** Cache. */
-    private GridCacheAdapter<?, ?> cache;
-
-    /**
-     * Creates MBean;
-     *
-     * @param cache Cache.
-     */
-    CacheMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
-        assert cache != null;
-
-        this.cache = cache;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String name() {
-        return cache.metrics0().name();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOverflowSize() {
-        return cache.metrics0().getOverflowSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapGets() {
-        return cache.metrics0().getOffHeapGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapPuts() {
-        return cache.metrics0().getOffHeapPuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapRemovals() {
-        return cache.metrics0().getOffHeapRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapEvictions() {
-        return cache.metrics0().getOffHeapEvictions();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapHits() {
-        return cache.metrics0().getOffHeapHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getOffHeapHitPercentage() {
-        return cache.metrics0().getOffHeapHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapMisses() {
-        return cache.metrics0().getOffHeapMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getOffHeapMissPercentage() {
-        return cache.metrics0().getOffHeapMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapEntriesCount() {
-        return cache.metrics0().getOffHeapEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapPrimaryEntriesCount() {
-        return cache.metrics0().getOffHeapPrimaryEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapBackupEntriesCount() {
-        return cache.metrics0().getOffHeapBackupEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapAllocatedSize() {
-        return cache.metrics0().getOffHeapAllocatedSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapMaxSize() {
-        return cache.metrics0().getOffHeapMaxSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapGets() {
-        return cache.metrics0().getSwapGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapPuts() {
-        return cache.metrics0().getSwapPuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapRemovals() {
-        return cache.metrics0().getSwapRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapHits() {
-        return cache.metrics0().getSwapHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapMisses() {
-        return cache.metrics0().getSwapMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getSwapHitPercentage() {
-        return cache.metrics0().getSwapHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getSwapMissPercentage() {
-        return cache.metrics0().getSwapMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapEntriesCount() {
-        return cache.metrics0().getSwapEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapSize() {
-        return cache.metrics0().getSwapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getSize() {
-        return cache.metrics0().getSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getKeySize() {
-        return cache.metrics0().getKeySize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return cache.metrics0().isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDhtEvictQueueCurrentSize() {
-        return cache.metrics0().getDhtEvictQueueCurrentSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxCommitQueueSize() {
-        return cache.metrics0().getTxCommitQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxThreadMapSize() {
-        return cache.metrics0().getTxThreadMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxXidMapSize() {
-        return cache.metrics0().getTxXidMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxPrepareQueueSize() {
-        return cache.metrics0().getTxPrepareQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxStartVersionCountsSize() {
-        return cache.metrics0().getTxStartVersionCountsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxCommittedVersionsSize() {
-        return cache.metrics0().getTxCommittedVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxRolledbackVersionsSize() {
-        return cache.metrics0().getTxRolledbackVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtThreadMapSize() {
-        return cache.metrics0().getTxDhtThreadMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtXidMapSize() {
-        return cache.metrics0().getTxDhtXidMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtCommitQueueSize() {
-        return cache.metrics0().getTxDhtCommitQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtPrepareQueueSize() {
-        return cache.metrics0().getTxDhtPrepareQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtStartVersionCountsSize() {
-        return cache.metrics0().getTxDhtStartVersionCountsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtCommittedVersionsSize() {
-        return cache.metrics0().getTxDhtCommittedVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtRolledbackVersionsSize() {
-        return cache.metrics0().getTxDhtRolledbackVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWriteBehindEnabled() {
-        return cache.metrics0().isWriteBehindEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindFlushSize() {
-        return cache.metrics0().getWriteBehindFlushSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindFlushThreadCount() {
-        return cache.metrics0().getWriteBehindFlushThreadCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getWriteBehindFlushFrequency() {
-        return cache.metrics0().getWriteBehindFlushFrequency();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindStoreBatchSize() {
-        return cache.metrics0().getWriteBehindStoreBatchSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindTotalCriticalOverflowCount() {
-        return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindCriticalOverflowCount() {
-        return cache.metrics0().getWriteBehindCriticalOverflowCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindErrorRetryCount() {
-        return cache.metrics0().getWriteBehindErrorRetryCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindBufferSize() {
-        return cache.metrics0().getWriteBehindBufferSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        cache.metrics0().clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheHits() {
-        return cache.metrics0().getCacheHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getCacheHitPercentage() {
-        return cache.metrics0().getCacheHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheMisses() {
-        return cache.metrics0().getCacheMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getCacheMissPercentage() {
-        return cache.metrics0().getCacheMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheGets() {
-        return cache.metrics0().getCacheGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCachePuts() {
-        return cache.metrics0().getCachePuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheRemovals() {
-        return cache.metrics0().getCacheRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheEvictions() {
-        return cache.metrics0().getCacheEvictions();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageGetTime() {
-        return cache.metrics0().getAverageGetTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAveragePutTime() {
-        return cache.metrics0().getAveragePutTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageRemoveTime() {
-        return cache.metrics0().getAverageRemoveTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageTxCommitTime() {
-        return cache.metrics0().getAverageTxCommitTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageTxRollbackTime() {
-        return cache.metrics0().getAverageTxRollbackTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheTxCommits() {
-        return cache.metrics0().getCacheTxCommits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheTxRollbacks() {
-        return cache.metrics0().getCacheTxRollbacks();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getKeyType() {
-        return cache.metrics0().getKeyType();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getValueType() {
-        return cache.metrics0().getValueType();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isStoreByValue() {
-        return cache.metrics0().isStoreByValue();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isStatisticsEnabled() {
-        return cache.metrics0().isStatisticsEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isManagementEnabled() {
-        return cache.metrics0().isManagementEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isReadThrough() {
-        return cache.metrics0().isReadThrough();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWriteThrough() {
-        return cache.metrics0().isWriteThrough();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 a1f0f28..44c8b57 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
@@ -137,6 +137,7 @@ import org.apache.ignite.mxbean.CacheMetricsMXBean;
 import org.apache.ignite.plugin.security.SecurityPermission;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.apache.ignite.resources.JobContextResource;
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
@@ -253,8 +254,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     /** Cache metrics. */
     protected CacheMetricsImpl metrics;
 
+    /** Cache localMxBean. */
+    protected CacheMetricsMXBean localMxBean;
+
     /** Cache mxBean. */
-    protected CacheMetricsMXBean mxBean;
+    protected CacheMetricsMXBean clusterMxBean;
 
     /** Logger. */
     protected IgniteLogger log;
@@ -324,7 +328,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         metrics = new CacheMetricsImpl(ctx);
 
-        mxBean = new CacheMetricsMXBeanImpl(this);
+        localMxBean = new CacheLocalMetricsMXBeanImpl(this);
+        clusterMxBean = new CacheClusterMetricsMXBeanImpl(this);
 
         FileSystemConfiguration[] igfsCfgs = gridCfg.getFileSystemConfiguration();
 
@@ -3294,13 +3299,41 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetrics metrics() {
+    @Override public CacheMetrics clusterMetrics() {
+        return clusterMetrics(ctx.grid().cluster().forCacheNodes(ctx.name()));
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+        List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
+
+        for (ClusterNode node : grp.nodes()) {
+            Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+
+            if (nodeCacheMetrics != null) {
+                CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+
+                if (e != null)
+                    metrics.add(e);
+            }
+        }
+
+        return new CacheMetricsSnapshot(ctx.cache().localMetrics(), metrics);
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics localMetrics() {
         return new CacheMetricsSnapshot(metrics);
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetricsMXBean mxBean() {
-        return mxBean;
+    @Override public CacheMetricsMXBean localMxBean() {
+        return localMxBean;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetricsMXBean clusterMxBean() {
+        return clusterMxBean;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 f5ebc0d..67d6a6c 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
@@ -549,8 +549,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         cleanup(cfg, cfg.getAffinityMapper(), false);
         cleanup(cfg, cctx.store().configuredStore(), false);
 
-        if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName()))
-            unregisterMbean(cctx.cache().mxBean(), cfg.getName(), false);
+        if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName())) {
+            unregisterMbean(cctx.cache().localMxBean(), cfg.getName(), false);
+            unregisterMbean(cctx.cache().clusterMxBean(), cfg.getName(), false);
+        }
 
         NearCacheConfiguration nearCfg = cfg.getNearConfiguration();
 
@@ -1488,8 +1490,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             cacheCtx.cache(dht);
         }
 
-        if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name()))
-            registerMbean(cache.mxBean(), cache.name(), false);
+        if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name())) {
+            registerMbean(cache.localMxBean(), cache.name(), false);
+            registerMbean(cache.clusterMxBean(), cache.name(), false);
+        }
 
         return ret;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 9b4aff3..cbe16c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -35,6 +35,7 @@ import org.apache.ignite.cache.CacheEntry;
 import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -143,16 +144,52 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
     }
 
     /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics() {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.clusterMetrics();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.clusterMetrics(grp);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public CacheConfiguration configuration() {
         return delegate.configuration();
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetrics metrics() {
+    @Override public CacheMetrics localMetrics() {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.localMetrics();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetricsMXBean clusterMxBean() {
         CacheOperationContext prev = gate.enter(opCtx);
 
         try {
-            return delegate.metrics();
+            return delegate.clusterMxBean();
         }
         finally {
             gate.leave(prev);
@@ -160,11 +197,11 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetricsMXBean mxBean() {
+    @Override public CacheMetricsMXBean localMxBean() {
         CacheOperationContext prev = gate.enter(opCtx);
 
         try {
-            return delegate.mxBean();
+            return delegate.localMxBean();
         }
         finally {
             gate.leave(prev);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 6e8bcbf..5b78271 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
@@ -222,7 +222,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            return ctx.cache().metrics();
+            return ctx.cache().clusterMetrics();
         }
         finally {
             onLeave(gate, prev);
@@ -236,20 +236,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
-
-            for (ClusterNode node : grp.nodes()) {
-                Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+            return ctx.cache().clusterMetrics(grp);
+        }
+        finally {
+            onLeave(gate, prev);
+        }
+    }
 
-                if (nodeCacheMetrics != null) {
-                    CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+    @Override public CacheMetrics localMetrics() {
+        GridCacheGateway<K, V> gate = this.gate;
 
-                    if (e != null)
-                        metrics.add(e);
-                }
-            }
+        CacheOperationContext prev = onEnter(gate, opCtx);
 
-            return new CacheMetricsSnapshot(ctx.cache().metrics(), metrics);
+        try {
+            return ctx.cache().localMetrics();
         }
         finally {
             onLeave(gate, prev);
@@ -263,7 +263,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            return ctx.cache().mxBean();
+            return ctx.cache().clusterMxBean();
+        }
+        finally {
+            onLeave(gate, prev);
+        }
+    }
+
+    @Override public CacheMetricsMXBean localMxBean() {
+        GridCacheGateway<K, V> gate = this.gate;
+
+        CacheOperationContext prev = onEnter(gate, opCtx);
+
+        try {
+            return ctx.cache().localMxBean();
         }
         finally {
             onLeave(gate, prev);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 68d0f06..d2e0101 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -38,6 +38,7 @@ import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.affinity.Affinity;
 import org.apache.ignite.cache.affinity.AffinityKeyMapped;
 import org.apache.ignite.cache.store.CacheStore;
+import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
@@ -1543,18 +1544,40 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
     public Affinity<K> affinity();
 
     /**
-     * Gets metrics (statistics) for this cache.
+     * Gets whole cluster metrics (statistics) for this cache.
      *
      * @return Cache metrics.
      */
-    public CacheMetrics metrics();
+    public CacheMetrics clusterMetrics();
 
     /**
-     * Gets metrics (statistics) for this cache.
+     * Gets cluster group metrics (statistics) for this cache.
      *
+     * @param grp Cluster group.
      * @return Cache metrics.
      */
-    public CacheMetricsMXBean mxBean();
+    public CacheMetrics clusterMetrics(ClusterGroup grp);
+
+    /**
+     * Gets local metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetrics localMetrics();
+
+    /**
+     * Gets whole cluster metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetricsMXBean clusterMxBean();
+
+    /**
+     * Gets local metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetricsMXBean localMxBean();
 
     /**
      * Gets size (in bytes) of all entries swapped to disk.

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index 35ccd19..75683a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -482,7 +482,7 @@ public class PlatformCache extends PlatformAbstractTarget {
                 break;
 
             case OP_METRICS:
-                CacheMetrics metrics = cache.metrics();
+                CacheMetrics metrics = cache.localMetrics();
 
                 writer.writeLong(metrics.getCacheGets());
                 writer.writeLong(metrics.getCachePuts());

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index a89913f..85611de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -1486,7 +1486,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter {
 
         /** {@inheritDoc} */
         @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) {
-            CacheMetrics metrics = c.cache().metrics();
+            CacheMetrics metrics = c.cache().localMetrics();
 
             assert metrics != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 1a88813..0a77dc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -179,7 +179,7 @@ public class VisorCacheMetrics implements Serializable {
         mode = cacheProcessor.cacheMode(cacheName);
         sys = cacheProcessor.systemCache(cacheName);
 
-        CacheMetrics m = c.metrics();
+        CacheMetrics m = c.localMetrics();
 
         size = m.getSize();
         keySize = m.getKeySize();

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
index 9ff4dae..ccec241 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
@@ -56,7 +56,7 @@ public class VisorCacheResetMetricsTask extends VisorOneNodeTask<String, Void> {
             IgniteInternalCache cache = ignite.cachex(cacheName);
 
             if (cache != null)
-                cache.mxBean().clear();
+                cache.localMxBean().clear();
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index c0075ad..9c24feb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -213,7 +213,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
             CacheMetrics metrics = cache.metrics(grid(i).cluster().forCacheNodes(cache.getName()));
 
             for (int j = 0; j < GRID_CNT; j++)
-                ms[j] = grid(j).cache(cache.getName()).metrics();
+                ms[j] = grid(j).cache(cache.getName()).localMetrics();
 
             // Static metrics
             for (int j = 0; j < GRID_CNT; j++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
index 214beb6..7fe1f34 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
@@ -264,7 +264,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
                     ", offheap=" + cache.localSize(CachePeekMode.OFFHEAP) +
                     ", swap=" + cache.localSize(CachePeekMode.SWAP) +
                     ", total=" + cache.localSize() +
-                    ", offheapMem=" + cache.metrics().getOffHeapAllocatedSize() + ']');
+                    ", offheapMem=" + cache.localMetrics().getOffHeapAllocatedSize() + ']');
             }
 
             done.set(true);
@@ -282,7 +282,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
             int offheapSize = cache.localSize(CachePeekMode.OFFHEAP);
             int swapSize = cache.localSize(CachePeekMode.SWAP);
             int total = cache.localSize();
-            long offheapMem = cache.metrics().getOffHeapAllocatedSize();
+            long offheapMem = cache.localMetrics().getOffHeapAllocatedSize();
 
             log.info("Cache size [heap=" + onheapSize +
                 ", offheap=" + offheapSize +

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index 4c04df0..13bd081 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -97,7 +97,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).mxBean().clear();
+            g.cache(null).localMxBean().clear();
 
             g.transactions().resetMetrics();
         }
@@ -141,7 +141,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Assert that statistics is clear.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             assertEquals(m.getCacheGets(), 0);
             assertEquals(m.getCachePuts(), 0);
@@ -162,7 +162,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testGetMetricsSnapshot() throws Exception {
         IgniteCache<Object, Object> cache = grid(0).cache(null);
 
-        assertNotSame("Method metrics() should return snapshot.", cache.metrics(), cache.metrics());
+        assertNotSame("Method metrics() should return snapshot.", cache.localMetrics(), cache.localMetrics());
     }
 
     /**
@@ -176,7 +176,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         for (int i = 0; i < KEY_CNT; i++) {
             cacheAsync.getAndRemove(i);
@@ -186,7 +186,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             fut.get();
         }
 
-        assert cache.metrics().getAverageRemoveTime() > 0;
+        assert cache.localMetrics().getAverageRemoveTime() > 0;
     }
 
     /**
@@ -206,7 +206,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         cache.put(key, key);
 
@@ -216,7 +216,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         assertTrue(fut.get());
 
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
     /**
@@ -228,12 +228,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.remove(i);
 
-        assert cache.metrics().getAverageRemoveTime() > 0;
+        assert cache.localMetrics().getAverageRemoveTime() > 0;
     }
 
     /**
@@ -246,7 +246,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         Set<Integer> keys = new HashSet<>(4, 1);
         keys.add(1);
@@ -255,7 +255,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.removeAll(keys);
 
-        float averageRemoveTime = cache.metrics().getAverageRemoveTime();
+        float averageRemoveTime = cache.localMetrics().getAverageRemoveTime();
 
         assert averageRemoveTime >= 0;
     }
@@ -280,7 +280,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         cacheAsync.removeAll(keys);
 
@@ -288,7 +288,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         fut.get();
 
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
 
@@ -300,17 +300,17 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.put(1, 1);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.get(1);
 
-        float averageGetTime = cache.metrics().getAverageGetTime();
+        float averageGetTime = cache.localMetrics().getAverageGetTime();
 
         assert averageGetTime > 0;
 
         cache.get(2);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -319,13 +319,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testGetAllAvgTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.put(1, 1);
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         Set<Integer> keys = new TreeSet<>();
         keys.add(1);
@@ -334,7 +334,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.getAll(keys);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -344,13 +344,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         IgniteCache<Object, Object> cache = grid(0).cache(null);
         IgniteCache<Object, Object> cacheAsync = cache.withAsync();
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.put(1, 1);
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         Set<Integer> keys = new TreeSet<>();
         keys.add(1);
@@ -365,24 +365,24 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testPutAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
 
-        assertEquals(KEY_CNT, cache.metrics().getCachePuts());
+        assertEquals(KEY_CNT, cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -392,8 +392,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         IgniteCache<Object, Object> cache = grid(0).cache(null);
         IgniteCache<Object, Object> cacheAsync = cache.withAsync();
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         cacheAsync.put(1, 1);
 
@@ -401,7 +401,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -421,8 +421,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cacheAsync.getAndPut(key, key);
 
@@ -432,8 +432,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -453,7 +453,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0f, cache.metrics().getAveragePutTime());
+        assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
 
         cacheAsync.putIfAbsent(key, key);
 
@@ -463,7 +463,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -483,7 +483,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0f, cache.metrics().getAveragePutTime());
+        assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
 
         cacheAsync.getAndPutIfAbsent(key, key);
 
@@ -493,7 +493,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -502,8 +502,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testPutAllAvgTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         Map<Integer, Integer> values = new HashMap<>();
 
@@ -513,10 +513,10 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.putAll(values);
 
-        float averagePutTime = cache.metrics().getAveragePutTime();
+        float averagePutTime = cache.localMetrics().getAveragePutTime();
 
         assert averagePutTime >= 0;
-        assertEquals(values.size(), cache.metrics().getCachePuts());
+        assertEquals(values.size(), cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -539,12 +539,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             expReads += expectedReadsPerPut(isPrimary);
             expMisses += expectedMissesPerPut(isPrimary);
 
-            info("Puts: " + cache0.metrics().getCachePuts());
+            info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
                 IgniteCache<Integer, Integer> cache = grid(j).cache(null);
 
-                int cacheWrites = (int)cache.metrics().getCachePuts();
+                int cacheWrites = (int)cache.localMetrics().getCachePuts();
 
                 assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
             }
@@ -561,7 +561,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         int misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -583,18 +583,18 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMissHitPercentage() throws Exception {
         IgniteCache<Integer, Integer> cache0 = grid(0).cache(null);
 
-        int keyCnt = keyCount();
+        final int keyCnt = keyCount();
 
         // Put and get a few keys.
         for (int i = 0; i < keyCnt; i++) {
             cache0.getAndPut(i, i); // +1 read
 
-            info("Puts: " + cache0.metrics().getCachePuts());
+            info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
                 IgniteCache<Integer, Integer> cache = grid(j).cache(null);
 
-                long cacheWrites = cache.metrics().getCachePuts();
+                long cacheWrites = cache.localMetrics().getCachePuts();
 
                 assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
             }
@@ -604,7 +604,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Check metrics for the whole cache.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             assertEquals(m.getCacheHits() * 100f / m.getCacheGets(), m.getCacheHitPercentage(), 0.1f);
             assertEquals(m.getCacheMisses() * 100f / m.getCacheGets(), m.getCacheMissPercentage(), 0.1f);
@@ -639,7 +639,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         long misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -659,8 +659,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMissesOnEmptyCache() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals("Expected 0 read", 0, cache.metrics().getCacheGets());
-        assertEquals("Expected 0 miss", 0, cache.metrics().getCacheMisses());
+        assertEquals("Expected 0 read", 0, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 0 miss", 0, cache.localMetrics().getCacheMisses());
 
         Integer key =  null;
 
@@ -676,19 +676,19 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.get(key);
 
-        assertEquals("Expected 1 read", 1, cache.metrics().getCacheGets());
-        assertEquals("Expected 1 miss", 1, cache.metrics().getCacheMisses());
+        assertEquals("Expected 1 read", 1, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 1 miss", 1, cache.localMetrics().getCacheMisses());
 
         cache.getAndPut(key, key); // +1 read, +1 miss.
 
-        assertEquals("Expected 2 reads", 2, cache.metrics().getCacheGets());
+        assertEquals("Expected 2 reads", 2, cache.localMetrics().getCacheGets());
 
         cache.get(key);
 
-        assertEquals("Expected 1 write", 1, cache.metrics().getCachePuts());
-        assertEquals("Expected 3 reads", 3, cache.metrics().getCacheGets());
-        assertEquals("Expected 2 misses", 2, cache.metrics().getCacheMisses());
-        assertEquals("Expected 1 hit", 1, cache.metrics().getCacheHits());
+        assertEquals("Expected 1 write", 1, cache.localMetrics().getCachePuts());
+        assertEquals("Expected 3 reads", 3, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 2 misses", 2, cache.localMetrics().getCacheMisses());
+        assertEquals("Expected 1 hit", 1, cache.localMetrics().getCacheHits());
     }
 
     /**
@@ -702,7 +702,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         // +1 remove
         cache.remove(1);
 
-        assertEquals(1L, cache.metrics().getCacheRemovals());
+        assertEquals(1L, cache.localMetrics().getCacheRemovals());
     }
 
     /**
@@ -718,8 +718,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.localEvict(Collections.singleton(1));
 
-        assertEquals(0L, cache.metrics().getCacheRemovals());
-        assertEquals(1L, cache.metrics().getCacheEvictions());
+        assertEquals(0L, cache.localMetrics().getCacheRemovals());
+        assertEquals(1L, cache.localMetrics().getCacheEvictions());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
index a3cc785..108ee90 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
@@ -103,9 +103,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.ONHEAP));
         assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP), cache.size(CachePeekMode.SWAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
     }
 
     /**
@@ -143,9 +143,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP) - cache.size(CachePeekMode.OFFHEAP),
             cache.size(CachePeekMode.SWAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
     }
 
     /**
@@ -181,9 +181,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertTrue(MAX_VALS_AMOUNT >= cache.size(CachePeekMode.OFFHEAP));
         assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.OFFHEAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
     }
 
     /** Fill cache with values. */


[26/27] ignite git commit: Merge branch 'master' into ignite-2004

Posted by nt...@apache.org.
Merge branch 'master' into ignite-2004


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

Branch: refs/heads/ignite-2004
Commit: 1c5e96d14e530d5c90d9dc7809b488bfa8e01bd2
Parents: 116c6ce 732abda
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Mar 29 11:01:51 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Mar 29 11:02:05 2016 +0300

----------------------------------------------------------------------
 .../store/CacheLoadOnlyStoreExample.java        | 171 ++++++
 examples/src/main/resources/person.csv          |  20 +
 .../ignite/examples/CacheExamplesSelfTest.java  |   8 +
 .../rest/RestBinaryProtocolSelfTest.java        |   4 +-
 .../rest/RestMemcacheProtocolSelfTest.java      |   4 +-
 .../java/org/apache/ignite/IgniteCache.java     |  20 +-
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   2 +-
 .../igfs/IgfsIpcEndpointConfiguration.java      |  28 +
 .../ignite/internal/binary/BinaryContext.java   |   2 +
 .../ignite/internal/binary/BinaryUtils.java     |  16 -
 .../binary/builder/BinaryObjectBuilderImpl.java | 107 ++--
 .../managers/communication/GridIoManager.java   |  54 +-
 .../managers/communication/GridIoPolicy.java    |   3 +
 .../discovery/GridDiscoveryManager.java         |   2 +-
 .../cache/CacheClusterMetricsMXBeanImpl.java    | 410 +++++++++++++++
 .../cache/CacheLocalMetricsMXBeanImpl.java      | 410 +++++++++++++++
 .../cache/CacheMetricsMXBeanImpl.java           | 410 ---------------
 .../processors/cache/GridCacheAdapter.java      |  45 +-
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../GridCachePartitionExchangeManager.java      |   2 +-
 .../processors/cache/GridCacheProcessor.java    |  15 +-
 .../processors/cache/GridCacheProxyImpl.java    |  45 +-
 .../processors/cache/IgniteCacheProxy.java      |  39 +-
 .../processors/cache/IgniteInternalCache.java   |  31 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  17 +-
 .../continuous/GridContinuousProcessor.java     |   2 +-
 .../datastreamer/DataStreamProcessor.java       |   8 +-
 .../datastreamer/DataStreamerImpl.java          |  37 +-
 .../internal/processors/igfs/IgfsBlockKey.java  |  30 +-
 .../processors/igfs/IgfsDataManager.java        |  29 +-
 .../processors/igfs/IgfsDeleteWorker.java       |   2 +-
 .../processors/igfs/IgfsDirectoryInfo.java      |  33 +-
 .../internal/processors/igfs/IgfsEntryInfo.java |   8 +-
 .../igfs/IgfsFragmentizerManager.java           |   4 +-
 .../processors/igfs/IgfsIpcHandler.java         |  81 ++-
 .../internal/processors/igfs/IgfsProcessor.java |  11 +-
 .../internal/processors/igfs/IgfsServer.java    |   2 +-
 .../internal/processors/igfs/IgfsUtils.java     | 127 +++++
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |  24 +-
 .../IgfsMetaDirectoryListingAddProcessor.java   |   6 +-
 ...gfsMetaDirectoryListingReplaceProcessor.java |   4 +-
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  |  16 +-
 .../meta/IgfsMetaUpdatePropertiesProcessor.java |   5 +-
 .../platform/cache/PlatformCache.java           |   2 +-
 .../datastreamer/PlatformDataStreamer.java      |   7 +-
 .../handlers/cache/GridCacheCommandHandler.java |   2 +-
 .../util/offheap/unsafe/GridUnsafeMap.java      |   4 +-
 .../internal/visor/cache/VisorCacheMetrics.java |   2 +-
 .../visor/cache/VisorCacheResetMetricsTask.java |   2 +-
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 144 ++++-
 ...naryObjectBuilderDefaultMappersSelfTest.java |   2 +-
 .../CacheMetricsForClusterGroupSelfTest.java    |   2 +-
 .../cache/CacheSwapUnswapGetTest.java           |   4 +-
 .../cache/GridCacheAbstractMetricsSelfTest.java | 124 ++---
 .../GridCacheOffHeapValuesEvictionSelfTest.java |  18 +-
 ...cheTransactionalAbstractMetricsSelfTest.java |   4 +-
 .../cache/IgniteCacheAbstractTest.java          |   6 +
 .../IgniteCacheEntryListenerAbstractTest.java   |  16 +-
 .../distributed/IgniteCacheManyClientsTest.java |   6 +
 .../dht/GridCacheColocatedDebugTest.java        |   2 +-
 ...ePartitionedNearDisabledMetricsSelfTest.java |   2 +-
 ...AtomicPartitionedTckMetricsSelfTestImpl.java |  92 ++--
 .../near/GridCacheNearMetricsSelfTest.java      | 152 +++---
 ...idCachePartitionedHitsAndMissesSelfTest.java |   2 +-
 ...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 380 ++++++-------
 ...dCacheAtomicLocalTckMetricsSelfTestImpl.java |  92 ++--
 ...usQueryFactoryFilterRandomOperationTest.java |   6 +-
 ...ContinuousQueryFailoverAbstractSelfTest.java |  13 +-
 ...acheContinuousQueryRandomOperationsTest.java | 527 +++++++++++++++++--
 ...inuousQueryRandomOperationsTwoNodesTest.java |  28 +
 .../processors/igfs/IgfsAbstractSelfTest.java   |  42 +-
 ...lockMessageSystemPoolStarvationSelfTest.java | 299 +++++++++++
 .../igfs/IgfsPrimaryMultiNodeSelfTest.java      |  28 +
 .../IgfsPrimaryOptimziedMarshallerSelfTest.java |  28 +
 ...maryRelaxedConsistencyMultiNodeSelfTest.java |  28 +
 .../IgfsPrimaryRelaxedConsistencySelfTest.java  |  28 +
 .../igfs/IgfsPrimaryRelaxedSelfTest.java        |  28 -
 .../igfs/IgfsProcessorValidationSelfTest.java   |  16 +
 .../platform/PlatformAttributeNodeFilter.java   |  31 ++
 .../multijvm/IgniteCacheProcessProxy.java       |   8 +
 .../IgniteCacheDataStructuresSelfTestSuite.java |   8 +-
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |  17 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |   3 +-
 .../IgniteBinaryCacheQueryTestSuite2.java       |  39 ++
 .../IgniteBinaryCacheQueryTestSuite3.java       |  39 ++
 .../IgniteBinaryCacheQueryTestSuite4.java       |  39 ++
 .../IgniteCacheQuerySelfTestSuite.java          | 160 ------
 .../IgniteCacheQuerySelfTestSuite2.java         | 109 ++++
 .../IgniteCacheQuerySelfTestSuite3.java         | 101 ++++
 .../IgniteCacheQuerySelfTestSuite4.java         |  49 ++
 modules/platforms/cpp/common/src/java.cpp       |  74 ++-
 .../impl/binary/binary_type_updater_impl.cpp    |   2 +
 .../Apache.Ignite.Core.Tests.csproj             |  15 +
 .../Binary/BinaryBuilderSelfTest.cs             |  60 ++-
 .../Query/CacheQueriesCodeConfigurationTest.cs  |  16 +-
 .../Config/Apache.Ignite.exe.config.test2       |  58 ++
 .../Config/Apache.Ignite.exe.config.test3       |  34 ++
 .../Config/cache-local-node.xml                 |  65 +++
 .../Config/ignite-dotnet-cfg.xml                |  52 ++
 .../Dataload/DataStreamerTestTopologyChange.cs  | 104 ++++
 .../Examples/ExamplesTest.cs                    |   3 +-
 .../Apache.Ignite.Core.Tests/ExecutableTest.cs  |  89 +++-
 .../IgniteConfigurationSerializerTest.cs        |   3 +-
 .../Apache.Ignite.Core.Tests/JavaHomeTest.cs    |  69 +++
 .../Cache/Configuration/QueryEntity.cs          |   9 +-
 .../Apache.Ignite.Core/IgniteConfiguration.cs   |  10 +-
 .../IgniteConfigurationSection.xsd              |   8 +
 .../Impl/Datastream/DataStreamerImpl.cs         |   9 +-
 .../Apache.Ignite.Core/Impl/IgniteUtils.cs      |  34 ++
 modules/platforms/dotnet/Apache.Ignite.sln      |   5 +-
 .../dotnet/Apache.Ignite/Apache.Ignite.csproj   |   2 +-
 .../Config/AppSettingsConfigurator.cs           |  97 +---
 .../Apache.Ignite/Config/ArgsConfigurator.cs    | 145 +----
 .../dotnet/Apache.Ignite/Config/Configurator.cs | 168 ++++++
 .../Apache.Ignite/Config/IConfigurator.cs       |  34 --
 .../dotnet/Apache.Ignite/IgniteRunner.cs        |  24 +-
 .../Apache.Ignite/Service/IgniteService.cs      |  21 +-
 .../Compute/ClosureExample.cs                   |   6 +-
 .../Compute/TaskExample.cs                      |   6 +-
 .../Datagrid/ContinuousQueryExample.cs          |  11 +-
 .../Datagrid/DataStreamerExample.cs             |   8 +-
 .../Datagrid/PutGetExample.cs                   |   8 +-
 .../Datagrid/QueryExample.cs                    |  22 +-
 .../Datagrid/StoreExample.cs                    |  18 +-
 .../Datagrid/TransactionExample.cs              |  16 +-
 .../Events/EventsExample.cs                     |   6 +-
 .../Messaging/MessagingExample.cs               |   6 +-
 .../Misc/LifecycleExample.cs                    |   4 +-
 .../Services/ServicesExample.cs                 |   6 +-
 .../Apache.Ignite.ExamplesDll.csproj            |   1 +
 .../Apache.Ignite.ExamplesDll/Binary/Account.cs |   1 -
 .../Apache.Ignite.ExamplesDll/Binary/Address.cs |   5 +-
 .../Binary/Employee.cs                          |   4 +
 .../Binary/EmployeeKey.cs                       |   4 +-
 .../Binary/Organization.cs                      |  11 +-
 .../Binary/OrganizationType.cs                  |   3 -
 .../Datagrid/EmployeeStoreFactory.cs            |  38 ++
 .../examples/Config/example-cache-query.xml     | 118 -----
 .../examples/Config/example-cache-store.xml     |  59 ---
 .../dotnet/examples/Config/example-cache.xml    |  87 ---
 .../dotnet/examples/Config/example-compute.xml  |  70 ---
 .../dotnet/examples/Config/examples-config.xml  |  98 ++++
 parent/pom.xml                                  |   2 +
 143 files changed, 4830 insertions(+), 2035 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1c5e96d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 932ef83,c5df29b..2d58b15
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@@ -2096,8 -2092,7 +2096,8 @@@ public abstract class GridCacheMapEntr
                              null,
                              null,
                              false,
-                             updateCntr0 == null ? 0 : updateCntr0,
 -                            0);
++                            0,
 +                            null);
                      }
                  }
                  else

http://git-wip-us.apache.org/repos/asf/ignite/blob/1c5e96d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/1c5e96d1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java
index 9befb0d,0000000..8fe088a
mode 100644,000000..100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java
@@@ -1,723 -1,0 +1,723 @@@
 +/*
 + * 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.query.continuous;
 +
 +import java.io.Externalizable;
 +import java.io.IOException;
 +import java.io.ObjectInput;
 +import java.io.ObjectOutput;
 +import java.util.ArrayList;
 +import java.util.Collection;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Random;
 +import java.util.UUID;
 +import java.util.concurrent.ArrayBlockingQueue;
 +import java.util.concurrent.BlockingQueue;
 +import java.util.concurrent.ConcurrentHashMap;
 +import java.util.concurrent.ConcurrentMap;
 +import java.util.concurrent.CountDownLatch;
 +import java.util.concurrent.ThreadLocalRandom;
 +import javax.cache.configuration.CacheEntryListenerConfiguration;
 +import javax.cache.configuration.Factory;
 +import javax.cache.configuration.FactoryBuilder;
 +import javax.cache.configuration.MutableCacheEntryListenerConfiguration;
 +import javax.cache.event.CacheEntryCreatedListener;
 +import javax.cache.event.CacheEntryEvent;
 +import javax.cache.event.CacheEntryEventFilter;
 +import javax.cache.event.CacheEntryExpiredListener;
 +import javax.cache.event.CacheEntryListenerException;
 +import javax.cache.event.CacheEntryRemovedListener;
 +import javax.cache.event.CacheEntryUpdatedListener;
 +import org.apache.ignite.Ignite;
 +import org.apache.ignite.IgniteCache;
 +import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
 +import org.apache.ignite.cache.affinity.Affinity;
 +import org.apache.ignite.cache.query.CacheQueryEntryEvent;
 +import org.apache.ignite.cache.query.ContinuousQuery;
 +import org.apache.ignite.cache.query.QueryCursor;
 +import org.apache.ignite.configuration.CacheConfiguration;
 +import org.apache.ignite.internal.util.typedef.T2;
 +import org.apache.ignite.transactions.Transaction;
 +import org.apache.ignite.transactions.TransactionConcurrency;
 +import org.apache.ignite.transactions.TransactionIsolation;
 +import org.jetbrains.annotations.NotNull;
 +
 +import static java.util.concurrent.TimeUnit.MILLISECONDS;
 +import static java.util.concurrent.TimeUnit.SECONDS;
 +import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 +import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 +import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 +import static org.apache.ignite.cache.CacheMode.REPLICATED;
 +import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterRandomOperationTest.NonSerializableFilter.isAccepted;
 +import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest.ContinuousDeploy.CLIENT;
 +import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest.ContinuousDeploy.SERVER;
 +import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
 +import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 +import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE;
 +
 +/**
 + *
 + */
 +public class CacheContinuousQueryFactoryFilterRandomOperationTest extends CacheContinuousQueryRandomOperationsTest {
 +    /** */
 +    private static final int NODES = 5;
 +
 +    /** */
 +    private static final int KEYS = 50;
 +
 +    /** */
 +    private static final int VALS = 10;
 +
 +    /** */
 +    public static final int ITERATION_CNT = 40;
 +
 +    /**
 +     * @throws Exception If failed.
 +     */
 +    public void testInternalQuery() throws Exception {
 +        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
 +            1,
 +            ATOMIC,
 +            ONHEAP_TIERED,
 +            false);
 +
-         final IgniteCache<Object, Object> cache = grid(0).getOrCreateCache(ccfg);
++        final IgniteCache<Object, Object> cache = grid(0).createCache(ccfg);
 +
 +        UUID uuid = null;
 +
 +        try {
 +            for (int i = 0; i < 10; i++)
 +                cache.put(i, i);
 +
 +            final CountDownLatch latch = new CountDownLatch(5);
 +
 +            CacheEntryUpdatedListener lsnr = new CacheEntryUpdatedListener() {
 +                @Override public void onUpdated(Iterable iterable) throws CacheEntryListenerException {
 +                    for (Object evt : iterable) {
 +                        latch.countDown();
 +
 +                        log.info("Received event: " + evt);
 +                    }
 +                }
 +            };
 +
 +            uuid = grid(0).context().cache().cache(cache.getName()).context().continuousQueries()
 +                .executeInternalQuery(lsnr, new SerializableFilter(), false, true, true);
 +
 +            for (int i = 10; i < 20; i++)
 +                cache.put(i, i);
 +
 +            assertTrue(latch.await(3, SECONDS));
 +        }
 +        finally {
 +            if (uuid != null)
 +                grid(0).context().cache().cache(cache.getName()).context().continuousQueries()
 +                    .cancelInternalQuery(uuid);
 +
-             cache.destroy();
++            grid(0).destroyCache(ccfg.getName());
 +        }
 +    }
 +
 +    /** {@inheritDoc} */
-     @Override protected void testContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
++    @Override protected void doTestContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
 +        throws Exception {
 +        ignite(0).createCache(ccfg);
 +
 +        try {
 +            long seed = System.currentTimeMillis();
 +
 +            Random rnd = new Random(seed);
 +
 +            log.info("Random seed: " + seed);
 +
 +            List<BlockingQueue<CacheEntryEvent<?, ?>>> evtsQueues = new ArrayList<>();
 +
 +            Collection<QueryCursor<?>> curs = new ArrayList<>();
 +
 +            Collection<T2<Integer, MutableCacheEntryListenerConfiguration>> lsnrCfgs = new ArrayList<>();
 +
 +            if (deploy == CLIENT)
 +                evtsQueues.add(registerListener(ccfg.getName(), NODES - 1, curs, lsnrCfgs, rnd.nextBoolean()));
 +            else if (deploy == SERVER)
 +                evtsQueues.add(registerListener(ccfg.getName(), rnd.nextInt(NODES - 1), curs, lsnrCfgs,
 +                    rnd.nextBoolean()));
 +            else {
 +                boolean isSync = rnd.nextBoolean();
 +
 +                for (int i = 0; i < NODES - 1; i++)
 +                    evtsQueues.add(registerListener(ccfg.getName(), i, curs, lsnrCfgs, isSync));
 +            }
 +
 +            ConcurrentMap<Object, Object> expData = new ConcurrentHashMap<>();
 +
 +            Map<Integer, Long> partCntr = new ConcurrentHashMap<>();
 +
 +            try {
 +                for (int i = 0; i < ITERATION_CNT; i++) {
 +                    if (i % 10 == 0)
 +                        log.info("Iteration: " + i);
 +
 +                    for (int idx = 0; idx < NODES; idx++)
 +                        randomUpdate(rnd, evtsQueues, expData, partCntr, grid(idx).cache(ccfg.getName()));
 +                }
 +            }
 +            finally {
 +                for (QueryCursor<?> cur : curs)
 +                    cur.close();
 +
 +                for (T2<Integer, MutableCacheEntryListenerConfiguration> e : lsnrCfgs)
 +                    grid(e.get1()).cache(ccfg.getName()).deregisterCacheEntryListener(e.get2());
 +            }
 +        }
 +        finally {
 +            ignite(0).destroyCache(ccfg.getName());
 +        }
 +    }
 +
 +    /**
 +     * @param cacheName Cache name.
 +     * @param nodeIdx Node index.
 +     * @param curs Cursors.
 +     * @param lsnrCfgs Listener configurations.
 +     * @return Event queue
 +     */
 +    private BlockingQueue<CacheEntryEvent<?, ?>> registerListener(String cacheName,
 +        int nodeIdx,
 +        Collection<QueryCursor<?>> curs,
 +        Collection<T2<Integer, MutableCacheEntryListenerConfiguration>> lsnrCfgs,
 +        boolean sync) {
 +        final BlockingQueue<CacheEntryEvent<?, ?>> evtsQueue = new ArrayBlockingQueue<>(50_000);
 +
 +        if (ThreadLocalRandom.current().nextBoolean()) {
 +            MutableCacheEntryListenerConfiguration<QueryTestKey, QueryTestValue> lsnrCfg =
 +                new MutableCacheEntryListenerConfiguration<>(
 +                    FactoryBuilder.factoryOf(new LocalNonSerialiseListener() {
 +                        @Override protected void onEvents(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +                            ? extends QueryTestValue>> evts) {
 +                            for (CacheEntryEvent<?, ?> evt : evts)
 +                                evtsQueue.add(evt);
 +                        }
 +                    }),
 +                    createFilterFactory(),
 +                    true,
 +                    sync
 +                );
 +
 +            grid(nodeIdx).cache(cacheName).registerCacheEntryListener((CacheEntryListenerConfiguration)lsnrCfg);
 +
 +            lsnrCfgs.add(new T2<Integer, MutableCacheEntryListenerConfiguration>(nodeIdx, lsnrCfg));
 +        }
 +        else {
 +            ContinuousQuery<QueryTestKey, QueryTestValue> qry = new ContinuousQuery<>();
 +
 +            qry.setLocalListener(new CacheEntryUpdatedListener<QueryTestKey, QueryTestValue>() {
 +                @Override public void onUpdated(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +                    ? extends QueryTestValue>> evts) throws CacheEntryListenerException {
 +                    for (CacheEntryEvent<?, ?> evt : evts)
 +                        evtsQueue.add(evt);
 +                }
 +            });
 +
 +            qry.setRemoteFilterFactory(createFilterFactory());
 +
 +            QueryCursor<?> cur = grid(nodeIdx).cache(cacheName).query(qry);
 +
 +            curs.add(cur);
 +        }
 +
 +        return evtsQueue;
 +    }
 +
 +    /**
 +     * @return Filter factory.
 +     */
 +    @NotNull protected Factory<? extends CacheEntryEventFilter<QueryTestKey, QueryTestValue>> createFilterFactory() {
 +        return new FilterFactory();
 +    }
 +
 +    /**
 +     * @param rnd Random generator.
 +     * @param evtsQueues Events queue.
 +     * @param expData Expected cache data.
 +     * @param partCntr Partition counter.
 +     * @param cache Cache.
 +     * @throws Exception If failed.
 +     */
 +    private void randomUpdate(
 +        Random rnd,
 +        List<BlockingQueue<CacheEntryEvent<?, ?>>> evtsQueues,
 +        ConcurrentMap<Object, Object> expData,
 +        Map<Integer, Long> partCntr,
 +        IgniteCache<Object, Object> cache)
 +        throws Exception {
 +        Object key = new QueryTestKey(rnd.nextInt(KEYS));
 +        Object newVal = value(rnd);
 +        Object oldVal = expData.get(key);
 +
 +        int op = rnd.nextInt(11);
 +
 +        Ignite ignite = cache.unwrap(Ignite.class);
 +
 +        Transaction tx = null;
 +
 +        if (cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() == TRANSACTIONAL && rnd.nextBoolean())
 +            tx = ignite.transactions().txStart(txRandomConcurrency(rnd), txRandomIsolation(rnd));
 +
 +        try {
 +            // log.info("Random operation [key=" + key + ", op=" + op + ']');
 +
 +            switch (op) {
 +                case 0: {
 +                    cache.put(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                    expData.put(key, newVal);
 +
 +                    break;
 +                }
 +
 +                case 1: {
 +                    cache.getAndPut(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                    expData.put(key, newVal);
 +
 +                    break;
 +                }
 +
 +                case 2: {
 +                    cache.remove(key);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, null, oldVal);
 +
 +                    expData.remove(key);
 +
 +                    break;
 +                }
 +
 +                case 3: {
 +                    cache.getAndRemove(key);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, null, oldVal);
 +
 +                    expData.remove(key);
 +
 +                    break;
 +                }
 +
 +                case 4: {
 +                    cache.invoke(key, new EntrySetValueProcessor(newVal, rnd.nextBoolean()));
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                    expData.put(key, newVal);
 +
 +                    break;
 +                }
 +
 +                case 5: {
 +                    cache.invoke(key, new EntrySetValueProcessor(null, rnd.nextBoolean()));
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    updatePartitionCounter(cache, key, partCntr);
 +
 +                    waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, null, oldVal);
 +
 +                    expData.remove(key);
 +
 +                    break;
 +                }
 +
 +                case 6: {
 +                    cache.putIfAbsent(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    if (oldVal == null) {
 +                        updatePartitionCounter(cache, key, partCntr);
 +
 +                        waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, null);
 +
 +                        expData.put(key, newVal);
 +                    }
 +                    else
 +                        checkNoEvent(evtsQueues);
 +
 +                    break;
 +                }
 +
 +                case 7: {
 +                    cache.getAndPutIfAbsent(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    if (oldVal == null) {
 +                        updatePartitionCounter(cache, key, partCntr);
 +
 +                        waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, null);
 +
 +                        expData.put(key, newVal);
 +                    }
 +                    else
 +                        checkNoEvent(evtsQueues);
 +
 +                    break;
 +                }
 +
 +                case 8: {
 +                    cache.replace(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    if (oldVal != null) {
 +                        updatePartitionCounter(cache, key, partCntr);
 +
 +                        waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                        expData.put(key, newVal);
 +                    }
 +                    else
 +                        checkNoEvent(evtsQueues);
 +
 +                    break;
 +                }
 +
 +                case 9: {
 +                    cache.getAndReplace(key, newVal);
 +
 +                    if (tx != null)
 +                        tx.commit();
 +
 +                    if (oldVal != null) {
 +                        updatePartitionCounter(cache, key, partCntr);
 +
 +                        waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                        expData.put(key, newVal);
 +                    }
 +                    else
 +                        checkNoEvent(evtsQueues);
 +
 +                    break;
 +                }
 +
 +                case 10: {
 +                    if (oldVal != null) {
 +                        Object replaceVal = value(rnd);
 +
 +                        boolean success = replaceVal.equals(oldVal);
 +
 +                        if (success) {
 +                            cache.replace(key, replaceVal, newVal);
 +
 +                            if (tx != null)
 +                                tx.commit();
 +
 +                            updatePartitionCounter(cache, key, partCntr);
 +
 +                            waitAndCheckEvent(evtsQueues, partCntr, affinity(cache), key, newVal, oldVal);
 +
 +                            expData.put(key, newVal);
 +                        }
 +                        else {
 +                            cache.replace(key, replaceVal, newVal);
 +
 +                            if (tx != null)
 +                                tx.commit();
 +
 +                            checkNoEvent(evtsQueues);
 +                        }
 +                    }
 +                    else {
 +                        cache.replace(key, value(rnd), newVal);
 +
 +                        if (tx != null)
 +                            tx.commit();
 +
 +                        checkNoEvent(evtsQueues);
 +                    }
 +
 +                    break;
 +                }
 +
 +                default:
 +                    fail("Op:" + op);
 +            }
 +        } finally {
 +            if (tx != null)
 +                tx.close();
 +        }
 +    }
 +
 +    /**
 +     * @param rnd {@link Random}.
 +     * @return {@link TransactionIsolation}.
 +     */
 +    private TransactionIsolation txRandomIsolation(Random rnd) {
 +        int val = rnd.nextInt(3);
 +
 +        if (val == 0)
 +            return READ_COMMITTED;
 +        else if (val == 1)
 +            return REPEATABLE_READ;
 +        else
 +            return SERIALIZABLE;
 +    }
 +
 +    /**
 +     * @param rnd {@link Random}.
 +     * @return {@link TransactionConcurrency}.
 +     */
 +    private TransactionConcurrency txRandomConcurrency(Random rnd) {
 +        return rnd.nextBoolean() ? TransactionConcurrency.OPTIMISTIC : TransactionConcurrency.PESSIMISTIC;
 +    }
 +
 +    /**
 +     * @param cache Cache.
 +     * @param key Key
 +     * @param cntrs Partition counters.
 +     */
 +    private void updatePartitionCounter(IgniteCache<Object, Object> cache, Object key, Map<Integer, Long> cntrs) {
 +        Affinity<Object> aff = cache.unwrap(Ignite.class).affinity(cache.getName());
 +
 +        int part = aff.partition(key);
 +
 +        Long partCntr = cntrs.get(part);
 +
 +        if (partCntr == null)
 +            partCntr = 0L;
 +
 +        cntrs.put(part, ++partCntr);
 +    }
 +
 +    /**
 +     * @param rnd Random generator.
 +     * @return Cache value.
 +     */
 +    private static Object value(Random rnd) {
 +        return new QueryTestValue(rnd.nextInt(VALS));
 +    }
 +
 +    /**
 +     * @param evtsQueues Event queue.
 +     * @param partCntrs Partition counters.
 +     * @param aff Affinity function.
 +     * @param key Key.
 +     * @param val Value.
 +     * @param oldVal Old value.
 +     * @throws Exception If failed.
 +     */
 +    private void waitAndCheckEvent(List<BlockingQueue<CacheEntryEvent<?, ?>>> evtsQueues,
 +        Map<Integer, Long> partCntrs,
 +        Affinity<Object> aff,
 +        Object key,
 +        Object val,
 +        Object oldVal)
 +        throws Exception {
 +        if ((val == null && oldVal == null
 +            || (val != null && !isAccepted((QueryTestValue)val)))) {
 +            checkNoEvent(evtsQueues);
 +
 +            return;
 +        }
 +
 +        for (BlockingQueue<CacheEntryEvent<?, ?>> evtsQueue : evtsQueues) {
 +            CacheEntryEvent<?, ?> evt = evtsQueue.poll(5, SECONDS);
 +
 +            assertNotNull("Failed to wait for event [key=" + key + ", val=" + val + ", oldVal=" + oldVal + ']', evt);
 +            assertEquals(key, evt.getKey());
 +            assertEquals(val, evt.getValue());
 +            assertEquals(oldVal, evt.getOldValue());
 +
 +            long cntr = partCntrs.get(aff.partition(key));
 +            CacheQueryEntryEvent qryEntryEvt = evt.unwrap(CacheQueryEntryEvent.class);
 +
 +            assertNotNull(cntr);
 +            assertNotNull(qryEntryEvt);
 +
 +            assertEquals(cntr, qryEntryEvt.getPartitionUpdateCounter());
 +        }
 +    }
 +
 +    /**
 +     * @param evtsQueues Event queue.
 +     * @throws Exception If failed.
 +     */
 +    private void checkNoEvent(List<BlockingQueue<CacheEntryEvent<?, ?>>> evtsQueues) throws Exception {
 +        for (BlockingQueue<CacheEntryEvent<?, ?>> evtsQueue : evtsQueues) {
 +            CacheEntryEvent<?, ?> evt = evtsQueue.poll(50, MILLISECONDS);
 +
 +            assertNull(evt);
 +        }
 +    }
 +
 +    /**
 +     *
 +     */
 +    protected static class NonSerializableFilter
 +        implements CacheEntryEventSerializableFilter<CacheContinuousQueryRandomOperationsTest.QueryTestKey,
 +            CacheContinuousQueryRandomOperationsTest.QueryTestValue>, Externalizable {
 +        /** */
 +        public NonSerializableFilter() {
 +            // No-op.
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> event)
 +            throws CacheEntryListenerException {
 +            return isAccepted(event.getValue());
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void writeExternal(ObjectOutput out) throws IOException {
 +            fail("Entry filter should not be marshaled.");
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
 +            fail("Entry filter should not be marshaled.");
 +        }
 +
 +        /**
 +         * @return {@code True} if value is even.
 +         */
 +        public static boolean isAccepted(QueryTestValue val) {
 +            return val == null || val.val1 % 2 == 0;
 +        }
 +    }
 +
 +    /**
 +     *
 +     */
 +    protected static class SerializableFilter implements CacheEntryEventSerializableFilter<Integer, Integer> {
 +        /** */
 +        public SerializableFilter() {
 +            // No-op.
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public boolean evaluate(CacheEntryEvent<? extends Integer, ? extends Integer> event)
 +            throws CacheEntryListenerException {
 +            return isAccepted(event.getValue());
 +        }
 +
 +        /**
 +         * @return {@code True} if value is even.
 +         */
 +        public static boolean isAccepted(Integer val) {
 +            return val == null || val % 2 == 0;
 +        }
 +    }
 +
 +    /**
 +     *
 +     */
 +    protected static class FilterFactory implements Factory<NonSerializableFilter> {
 +        @Override public NonSerializableFilter create() {
 +            return new NonSerializableFilter();
 +        }
 +    }
 +
 +    /**
 +     *
 +     */
 +    public abstract class LocalNonSerialiseListener implements
 +        CacheEntryUpdatedListener<QueryTestKey, QueryTestValue>,
 +        CacheEntryCreatedListener<QueryTestKey, QueryTestValue>,
 +        CacheEntryExpiredListener<QueryTestKey, QueryTestValue>,
 +        CacheEntryRemovedListener<QueryTestKey, QueryTestValue>,
 +        Externalizable {
 +        /** */
 +        public LocalNonSerialiseListener() {
 +            // No-op.
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void onCreated(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +            ? extends QueryTestValue>> evts) throws CacheEntryListenerException {
 +            onEvents(evts);
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void onExpired(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +            ? extends QueryTestValue>> evts) throws CacheEntryListenerException {
 +            onEvents(evts);
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void onRemoved(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +            ? extends QueryTestValue>> evts) throws CacheEntryListenerException {
 +            onEvents(evts);
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void onUpdated(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +            ? extends QueryTestValue>> evts) throws CacheEntryListenerException {
 +            onEvents(evts);
 +        }
 +
 +        /**
 +         * @param evts Events.
 +         */
 +        protected abstract void onEvents(Iterable<CacheEntryEvent<? extends QueryTestKey,
 +            ? extends QueryTestValue>> evts);
 +
 +        /** {@inheritDoc} */
 +        @Override public void writeExternal(ObjectOutput out) throws IOException {
 +            throw new UnsupportedOperationException("Failed. Listener should not be marshaled.");
 +        }
 +
 +        /** {@inheritDoc} */
 +        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
 +            throw new UnsupportedOperationException("Failed. Listener should not be unmarshaled.");
 +        }
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/ignite/blob/1c5e96d1/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index 0000000,73c856b..912c8f9
mode 000000,100644..100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@@ -1,0 -1,97 +1,101 @@@
+ /*
+  * 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.testsuites;
+ 
+ import junit.framework.TestSuite;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchAckTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchForceServerModeAckTest;
 -import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterTest;
++import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryAsyncFilterListenerTest;
++import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryAsyncFilterRandomOperationTest;
++import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterRandomOperationTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTwoNodesTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryConcurrentTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalAtomicSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionAtomicOneNodeTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionTxOneNodeTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedOnlySelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedP2PDisabledSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicOneNodeTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedP2PDisabledSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedTxOneNodeTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapTieredTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxOffheapValuesTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryTxSelfTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientReconnectTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTest;
+ import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTxReconnectTest;
+ 
+ /**
+  * Test suite for cache queries.
+  */
+ public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
+     /**
+      * @return Test suite.
+      * @throws Exception If failed.
+      */
+     public static TestSuite suite() throws Exception {
+         TestSuite suite = new TestSuite("Ignite Cache Queries Test Suite 3");
+ 
+         // Continuous queries.
+         suite.addTestSuite(GridCacheContinuousQueryLocalSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryReplicatedSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryReplicatedP2PDisabledSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryPartitionedSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryPartitionedOnlySelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryPartitionedP2PDisabledSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryTxSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryTxOffheapTieredTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryTxOffheapValuesTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapTieredTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryAtomicOffheapValuesTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryReplicatedTxOneNodeTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicOneNodeTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryPartitionTxOneNodeTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryPartitionAtomicOneNodeTest.class);
+         suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
+         suite.addTestSuite(IgniteCacheContinuousQueryClientReconnectTest.class);
+         suite.addTestSuite(IgniteCacheContinuousQueryClientTxReconnectTest.class);
+         suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
+         suite.addTestSuite(CacheContinuousQueryRandomOperationsTwoNodesTest.class);
 -        suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);
+         suite.addTestSuite(GridCacheContinuousQueryConcurrentTest.class);
++        suite.addTestSuite(CacheContinuousQueryAsyncFilterListenerTest.class);
++        suite.addTestSuite(CacheContinuousQueryFactoryFilterRandomOperationTest.class);
++        suite.addTestSuite(CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.class);;
+         suite.addTestSuite(CacheContinuousQueryOperationP2PTest.class);
+         suite.addTestSuite(CacheContinuousBatchAckTest.class);
+         suite.addTestSuite(CacheContinuousBatchForceServerModeAckTest.class);
+ 
+         return suite;
+     }
+ }


[14/27] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-2004
Commit: 2cfe0cb5a0d84caede8b528b0a515ab4ba92bbc6
Parents: b4f0dab ddd9f0f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Mar 25 17:14:03 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Mar 25 17:14:03 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/offheap/unsafe/GridUnsafeMap.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[21/27] ignite git commit: NPE fix (in case cache creation failed)

Posted by nt...@apache.org.
NPE fix (in case cache creation failed)


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

Branch: refs/heads/ignite-2004
Commit: 134f26e0d020bad9cc6dbff046bb2c38a939c018
Parents: 7a5024c
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 17:42:42 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 17:42:42 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCachePartitionExchangeManager.java       | 2 +-
 .../ignite/internal/processors/cache/GridCacheProcessor.java      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/134f26e0/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 1681f2f..54580fd 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
@@ -1258,7 +1258,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                     boolean preloadFinished = true;
 
                     for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
-                        preloadFinished &= cacheCtx.preloader().syncFuture().isDone();
+                        preloadFinished &= cacheCtx.preloader() != null && cacheCtx.preloader().syncFuture().isDone();
 
                         if (!preloadFinished)
                             break;

http://git-wip-us.apache.org/repos/asf/ignite/blob/134f26e0/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 c0fc32a..f5ebc0d 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
@@ -1721,7 +1721,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             GridCacheContext<?, ?> cacheCtx = cache.context();
 
             if (F.eq(cacheCtx.startTopologyVersion(), topVer)) {
-                cacheCtx.preloader().onInitialExchangeComplete(err);
+                if (cacheCtx.preloader() != null)
+                    cacheCtx.preloader().onInitialExchangeComplete(err);
 
                 String masked = maskNull(cacheCtx.name());
 


[17/27] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-2004
Commit: f03b6c30a55249d8e3824f66df3aa811f994f122
Parents: 2987728 4df7418
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 14:33:17 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 14:33:17 2016 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   2 +-
 .../ignite/internal/binary/BinaryUtils.java     |  16 --
 .../binary/builder/BinaryObjectBuilderImpl.java | 107 +++++++-----
 .../managers/communication/GridIoManager.java   |  43 ++++-
 .../processors/cache/GridCacheAdapter.java      |   2 +-
 .../datastreamer/DataStreamProcessor.java       |   8 +-
 .../datastreamer/DataStreamerImpl.java          |  37 +++-
 .../datastreamer/PlatformDataStreamer.java      |   7 +-
 .../util/offheap/unsafe/GridUnsafeMap.java      |   4 +-
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 144 ++++++++++++++--
 ...naryObjectBuilderDefaultMappersSelfTest.java |   2 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |  33 +++-
 .../igfs/IgfsPrimaryMultiNodeSelfTest.java      |  28 ++++
 ...maryRelaxedConsistencyMultiNodeSelfTest.java |  28 ++++
 .../IgfsPrimaryRelaxedConsistencySelfTest.java  |  28 ++++
 .../igfs/IgfsPrimaryRelaxedSelfTest.java        |  28 ----
 .../platform/PlatformAttributeNodeFilter.java   |  31 ++++
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |  12 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |   3 +-
 modules/platforms/cpp/common/src/java.cpp       |  74 ++++++--
 .../Apache.Ignite.Core.Tests.csproj             |  15 ++
 .../Binary/BinaryBuilderSelfTest.cs             |  60 ++++++-
 .../Query/CacheQueriesCodeConfigurationTest.cs  |  16 +-
 .../Config/Apache.Ignite.exe.config.test2       |  58 +++++++
 .../Config/Apache.Ignite.exe.config.test3       |  34 ++++
 .../Config/cache-local-node.xml                 |  65 +++++++
 .../Config/ignite-dotnet-cfg.xml                |  52 ++++++
 .../Dataload/DataStreamerTestTopologyChange.cs  | 104 ++++++++++++
 .../Examples/ExamplesTest.cs                    |   3 +-
 .../Apache.Ignite.Core.Tests/ExecutableTest.cs  |  89 +++++++---
 .../IgniteConfigurationSerializerTest.cs        |   3 +-
 .../Apache.Ignite.Core.Tests/JavaHomeTest.cs    |  69 ++++++++
 .../Cache/Configuration/QueryEntity.cs          |   9 +-
 .../Apache.Ignite.Core/IgniteConfiguration.cs   |  10 +-
 .../IgniteConfigurationSection.xsd              |   8 +
 .../Impl/Datastream/DataStreamerImpl.cs         |   9 +-
 .../Apache.Ignite.Core/Impl/IgniteUtils.cs      |  34 ++++
 .../dotnet/Apache.Ignite/Apache.Ignite.csproj   |   2 +-
 .../Config/AppSettingsConfigurator.cs           |  97 +++--------
 .../Apache.Ignite/Config/ArgsConfigurator.cs    | 145 ++--------------
 .../dotnet/Apache.Ignite/Config/Configurator.cs | 168 +++++++++++++++++++
 .../Apache.Ignite/Config/IConfigurator.cs       |  34 ----
 .../dotnet/Apache.Ignite/IgniteRunner.cs        |  24 +--
 .../Apache.Ignite/Service/IgniteService.cs      |  21 +--
 .../Compute/ClosureExample.cs                   |   2 +-
 .../Compute/TaskExample.cs                      |   2 +-
 .../Datagrid/ContinuousQueryExample.cs          |   2 +-
 .../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               |   2 +-
 .../Misc/LifecycleExample.cs                    |   2 +-
 .../Services/ServicesExample.cs                 |   2 +-
 parent/pom.xml                                  |   2 +
 57 files changed, 1329 insertions(+), 463 deletions(-)
----------------------------------------------------------------------



[03/27] ignite git commit: IGNITE-2866 .NET: Added automatic JAVA_HOME detection. This closes #577.

Posted by nt...@apache.org.
IGNITE-2866 .NET: Added automatic JAVA_HOME detection. This closes #577.


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

Branch: refs/heads/ignite-2004
Commit: afe453ff6d219134685f5e5b8224156e8d6673b9
Parents: 7b63eee
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Mar 24 16:57:55 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 24 16:57:55 2016 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.Tests.csproj             |  1 +
 .../Apache.Ignite.Core.Tests/JavaHomeTest.cs    | 69 ++++++++++++++++++++
 .../Apache.Ignite.Core/Impl/IgniteUtils.cs      | 34 ++++++++++
 3 files changed, 104 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/afe453ff/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 0dcd1f0..fedbd63 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -130,6 +130,7 @@
     <Compile Include="IgniteConfigurationSerializerTest.cs" />
     <Compile Include="IgniteConfigurationTest.cs" />
     <Compile Include="IgniteTestBase.cs" />
+    <Compile Include="JavaHomeTest.cs" />
     <Compile Include="LifecycleTest.cs" />
     <Compile Include="LoadDllTest.cs" />
     <Compile Include="IgniteManagerTest.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/afe453ff/modules/platforms/dotnet/Apache.Ignite.Core.Tests/JavaHomeTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/JavaHomeTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/JavaHomeTest.cs
new file mode 100644
index 0000000..b229557
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/JavaHomeTest.cs
@@ -0,0 +1,69 @@
+/*
+ * 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.Tests
+{
+    using System;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests the JAVA_HOME detection.
+    /// </summary>
+    public class JavaHomeTest
+    {
+        /** Environment variable: JAVA_HOME. */
+        private const string EnvJavaHome = "JAVA_HOME";
+
+        /** Backed up value. */
+        private string _javaHomeBackup;
+
+        /// <summary>
+        /// Fixture set up.
+        /// </summary>
+        [TestFixtureSetUp]
+        public void FixtureSetUp()
+        {
+            _javaHomeBackup = Environment.GetEnvironmentVariable(EnvJavaHome);
+
+            Environment.SetEnvironmentVariable(EnvJavaHome, null);
+        }
+
+        /// <summary>
+        /// Fixture tear down.
+        /// </summary>
+        [TestFixtureTearDown]
+        public void FixtureTearDown()
+        {
+            Environment.SetEnvironmentVariable(EnvJavaHome, _javaHomeBackup);
+        }
+
+        /// <summary>
+        /// Tests the detection.
+        /// </summary>
+        [Test]
+        public void TestDetection([Values(null, "c:\\invalid111")] string javaHome)
+        {
+            Environment.SetEnvironmentVariable(EnvJavaHome, javaHome);
+
+            using (var ignite = Ignition.Start(TestUtils.GetTestConfiguration()))
+            {
+                Assert.IsNotNull(ignite);
+                Console.WriteLine("Detected JVM dll path: " + ignite.GetConfiguration().JvmDllPath);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/afe453ff/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
index 3206fc8..7f6fab8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
@@ -33,6 +33,7 @@ namespace Apache.Ignite.Core.Impl
     using Apache.Ignite.Core.Impl.Cluster;
     using Apache.Ignite.Core.Impl.Common;
     using Apache.Ignite.Core.Impl.Unmanaged;
+    using Microsoft.Win32;
     using BinaryReader = Apache.Ignite.Core.Impl.Binary.BinaryReader;
 
     /// <summary>
@@ -46,6 +47,13 @@ namespace Apache.Ignite.Core.Impl
         /** Lookup paths. */
         private static readonly string[] JvmDllLookupPaths = {@"jre\bin\server", @"jre\bin\default"};
 
+        /** Registry lookup paths. */
+        private static readonly string[] JreRegistryKeys =
+        {
+            @"Software\JavaSoft\Java Runtime Environment",
+            @"Software\Wow6432Node\JavaSoft\Java Runtime Environment"
+        };
+
         /** File: jvm.dll. */
         internal const string FileJvmDll = "jvm.dll";
 
@@ -256,6 +264,32 @@ namespace Apache.Ignite.Core.Impl
                 foreach (var path in JvmDllLookupPaths)
                     yield return
                         new KeyValuePair<string, string>(EnvJavaHome, Path.Combine(javaHomeDir, path, FileJvmDll));
+
+            // Get paths from the Windows Registry
+            foreach (var regPath in JreRegistryKeys)
+            {
+                using (var jSubKey = Registry.LocalMachine.OpenSubKey(regPath))
+                {
+                    if (jSubKey == null)
+                        continue;
+
+                    var curVer = jSubKey.GetValue("CurrentVersion") as string;
+
+                    // Current version comes first
+                    var versions = new[] {curVer}.Concat(jSubKey.GetSubKeyNames().Where(x => x != curVer));
+
+                    foreach (var ver in versions)
+                    {
+                        using (var verKey = jSubKey.OpenSubKey(ver))
+                        {
+                            var dllPath = verKey == null ? null : verKey.GetValue("RuntimeLib") as string;
+
+                            if (dllPath != null)
+                                yield return new KeyValuePair<string, string>(verKey.Name, dllPath);
+                        }
+                    }
+                }
+            }
         }
 
         /// <summary>


[27/27] ignite git commit: Merge remote-tracking branch 'origin/ignite-2004' into ignite-2004

Posted by nt...@apache.org.
Merge remote-tracking branch 'origin/ignite-2004' into ignite-2004


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

Branch: refs/heads/ignite-2004
Commit: 3f2c2e65d84e1eff28678348689ee7b0064dfd88
Parents: 1c5e96d d0c7b51
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Mar 29 11:04:34 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Mar 29 11:04:34 2016 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------



[13/27] ignite git commit: IGNITE-2830: IGFS: Added multi-node tests. This closes #564.

Posted by nt...@apache.org.
IGNITE-2830: IGFS: Added multi-node tests. This closes #564.


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

Branch: refs/heads/ignite-2004
Commit: b4f0dab089b0acae1542b7a397bfd3f7ce2e29e6
Parents: fb9e9b7
Author: iveselovskiy <iv...@gridgain.com>
Authored: Fri Mar 25 17:13:49 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Mar 25 17:13:49 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsAbstractSelfTest.java   | 33 ++++++++++++++++----
 .../igfs/IgfsPrimaryMultiNodeSelfTest.java      | 28 +++++++++++++++++
 ...maryRelaxedConsistencyMultiNodeSelfTest.java | 28 +++++++++++++++++
 .../IgfsPrimaryRelaxedConsistencySelfTest.java  | 28 +++++++++++++++++
 .../igfs/IgfsPrimaryRelaxedSelfTest.java        | 28 -----------------
 .../ignite/testsuites/IgniteIgfsTestSuite.java  | 12 +++++--
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |  3 +-
 7 files changed, 123 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/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 2f6c7bf..748a771 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
@@ -55,6 +55,7 @@ import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+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 org.jetbrains.annotations.Nullable;
@@ -189,6 +190,9 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
     /** Memory mode. */
     protected final CacheMemoryMode memoryMode;
 
+    /** Ignite nodes of cluster, excluding the secondary file system node, if any. */
+    protected Ignite[] nodes;
+
     static {
         PRIMARY_REST_CFG = new IgfsIpcEndpointConfiguration();
 
@@ -233,13 +237,20 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
     }
 
     /**
-     * @return Use optimzied marshaller flag.
+     * @return Use optimized marshaller flag.
      */
     protected boolean useOptimizedMarshaller() {
         return false;
     }
 
     /**
+     * @return Amount of nodes to start.
+     */
+    protected int nodeCount() {
+        return 1;
+    }
+
+    /**
      * Data chunk.
      *
      * @param len Length.
@@ -258,9 +269,17 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
     @Override protected void beforeTestsStarted() throws Exception {
         igfsSecondaryFileSystem = createSecondaryFileSystemStack();
 
-        Ignite ignite = startGridWithIgfs("ignite", "igfs", mode, igfsSecondaryFileSystem, PRIMARY_REST_CFG);
+        TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+        nodes = new Ignite[nodeCount()];
+
+        for (int i = 0; i < nodes.length; i++) {
+            String nodeName = i == 0 ? "ignite" : "ignite" + i;
+
+            nodes[i] = startGridWithIgfs(nodeName, "igfs", mode, igfsSecondaryFileSystem, PRIMARY_REST_CFG, ipFinder);
+        }
 
-        igfs = (IgfsImpl) ignite.fileSystem("igfs");
+        igfs = (IgfsImpl) nodes[0].fileSystem("igfs");
     }
 
     /**
@@ -271,7 +290,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
      */
     protected IgfsSecondaryFileSystem createSecondaryFileSystemStack() throws Exception {
         Ignite igniteSecondary = startGridWithIgfs("ignite-secondary", "igfs-secondary", PRIMARY, null,
-            SECONDARY_REST_CFG);
+            SECONDARY_REST_CFG, new TcpDiscoveryVmIpFinder(true));
 
         IgfsEx secondaryIgfsImpl = (IgfsEx) igniteSecondary.fileSystem("igfs-secondary");
 
@@ -300,12 +319,14 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
      * @param mode IGFS mode.
      * @param secondaryFs Secondary file system (optional).
      * @param restCfg Rest configuration string (optional).
+     * @param ipFinder IP finder.
      * @return Started grid instance.
      * @throws Exception If failed.
      */
     @SuppressWarnings("unchecked")
     protected Ignite startGridWithIgfs(String gridName, String igfsName, IgfsMode mode,
-        @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
+        @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg,
+        TcpDiscoveryIpFinder ipFinder) throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
         igfsCfg.setDataCacheName("dataCache");
@@ -347,7 +368,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
-        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+        discoSpi.setIpFinder(ipFinder);
 
         prepareCacheConfigurations(dataCacheCfg, metaCacheCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryMultiNodeSelfTest.java
new file mode 100644
index 0000000..1ee6d5a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryMultiNodeSelfTest.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.igfs;
+
+/**
+ * Multinode test for PRIMARY mode.
+ */
+public class IgfsPrimaryMultiNodeSelfTest extends IgfsPrimarySelfTest {
+    /** {@inheritDoc} */
+    @Override protected int nodeCount() {
+        return 4;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest.java
new file mode 100644
index 0000000..73a14c3
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest.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.igfs;
+
+/**
+ * Tests for PRIMARY mode and relaxed consistency model.
+ */
+public class IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest extends IgfsPrimaryRelaxedConsistencySelfTest {
+    /** {@inheritDoc} */
+    @Override protected int nodeCount() {
+        return 4;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencySelfTest.java
new file mode 100644
index 0000000..0e8dd20
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencySelfTest.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.igfs;
+
+/**
+ * Tests for PRIMARY mode and relaxed consistency model.
+ */
+public class IgfsPrimaryRelaxedConsistencySelfTest extends IgfsPrimarySelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean relaxedConsistency() {
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedSelfTest.java
deleted file mode 100644
index 6691df5..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedSelfTest.java
+++ /dev/null
@@ -1,28 +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.igfs;
-
-/**
- * Tests for PRIMARY mode and relaxed consistency model.
- */
-public class IgfsPrimaryRelaxedSelfTest extends IgfsPrimarySelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean relaxedConsistency() {
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 25c54e4..0047edb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -38,11 +38,13 @@ import org.apache.ignite.internal.processors.igfs.IgfsMetaManagerSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsMetricsSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsModeResolverSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsModesSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryMultiNodeSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsOneClientNodeTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapTieredSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapValuesSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOptimziedMarshallerSelfTest;
-import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencySelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimarySelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsProcessorSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsProcessorValidationSelfTest;
@@ -70,10 +72,16 @@ public class IgniteIgfsTestSuite extends TestSuite {
         TestSuite suite = new TestSuite("Ignite FS Test Suite For Platform Independent Tests");
 
         suite.addTest(new TestSuite(IgfsPrimarySelfTest.class));
-        suite.addTest(new TestSuite(IgfsPrimaryRelaxedSelfTest.class));
+        suite.addTest(new TestSuite(IgfsPrimaryMultiNodeSelfTest.class));
+
+        suite.addTest(new TestSuite(IgfsPrimaryRelaxedConsistencySelfTest.class));
+        suite.addTest(new TestSuite(IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest.class));
+
         suite.addTest(new TestSuite(IgfsPrimaryOptimziedMarshallerSelfTest.class));
+
         suite.addTest(new TestSuite(IgfsPrimaryOffheapTieredSelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryOffheapValuesSelfTest.class));
+
         suite.addTest(new TestSuite(IgfsDualSyncSelfTest.class));
         suite.addTest(new TestSuite(IgfsDualAsyncSelfTest.class));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4f0dab0/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 10b1bcd..f4c1cb7 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
@@ -23,6 +23,7 @@ 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;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 
 import static org.apache.ignite.igfs.HadoopSecondaryFileSystemConfigurationTest.IGFS_SCHEME;
 import static org.apache.ignite.igfs.HadoopSecondaryFileSystemConfigurationTest.SECONDARY_CFG_PATH;
@@ -93,7 +94,7 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
      * @throws IOException On failure.
      */
     protected void startUnderlying() throws Exception {
-        startGridWithIgfs(GRID_NAME, IGFS_NAME, PRIMARY, null, SECONDARY_REST_CFG);
+        startGridWithIgfs(GRID_NAME, IGFS_NAME, PRIMARY, null, SECONDARY_REST_CFG, new TcpDiscoveryVmIpFinder(true));
     }
 
     /**


[18/27] ignite git commit: Added semaphore tests to data structures suite

Posted by nt...@apache.org.
Added semaphore tests to data structures suite


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

Branch: refs/heads/ignite-2004
Commit: 9cd2f09021c735468896bfdfc29d4410cb48f123
Parents: f03b6c3
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Mar 28 15:57:16 2016 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Mar 28 15:57:16 2016 +0300

----------------------------------------------------------------------
 .../testsuites/IgniteCacheDataStructuresSelfTestSuite.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9cd2f090/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
index 519d3c1..f008a29 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.cache.datastructures.local.GridCach
 import org.apache.ignite.internal.processors.cache.datastructures.local.GridCacheLocalSetSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.local.IgniteLocalAtomicLongApiSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.local.IgniteLocalCountDownLatchSelfTest;
+import org.apache.ignite.internal.processors.cache.datastructures.local.IgniteLocalSemaphoreSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.GridCachePartitionedAtomicOffheapQueueApiSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.GridCachePartitionedAtomicOffheapQueueMultiNodeSelfTest;
@@ -66,6 +67,7 @@ import org.apache.ignite.internal.processors.cache.datastructures.partitioned.Gr
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.IgnitePartitionedAtomicLongApiSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.IgnitePartitionedCountDownLatchSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.IgnitePartitionedQueueNoBackupsTest;
+import org.apache.ignite.internal.processors.cache.datastructures.partitioned.IgnitePartitionedSemaphoreSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.partitioned.IgnitePartitionedSetNoBackupsSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.replicated.GridCacheReplicatedAtomicReferenceApiSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.replicated.GridCacheReplicatedAtomicStampedApiSelfTest;
@@ -78,6 +80,7 @@ import org.apache.ignite.internal.processors.cache.datastructures.replicated.Gri
 import org.apache.ignite.internal.processors.cache.datastructures.replicated.GridCacheReplicatedSetSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.replicated.IgniteReplicatedAtomicLongApiSelfTest;
 import org.apache.ignite.internal.processors.cache.datastructures.replicated.IgniteReplicatedCountDownLatchSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheAtomicReplicatedNodeRestartSelfTest;
 
 /**
  * Test suite for cache data structures.
@@ -102,6 +105,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheLocalOffheapQueueApiSelfTest.class));
         suite.addTest(new TestSuite(GridCacheLocalAtomicQueueApiSelfTest.class));
         suite.addTest(new TestSuite(IgniteLocalCountDownLatchSelfTest.class));
+        suite.addTest(new TestSuite(IgniteLocalSemaphoreSelfTest.class));
 
         suite.addTest(new TestSuite(GridCacheReplicatedSequenceApiSelfTest.class));
         suite.addTest(new TestSuite(GridCacheReplicatedSequenceMultiNodeSelfTest.class));
@@ -111,6 +115,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheReplicatedSetSelfTest.class));
         suite.addTest(new TestSuite(GridCacheReplicatedDataStructuresFailoverSelfTest.class));
         suite.addTest(new TestSuite(IgniteReplicatedCountDownLatchSelfTest.class));
+        suite.addTest(new TestSuite(IgniteCacheAtomicReplicatedNodeRestartSelfTest.class));
 
         suite.addTest(new TestSuite(GridCachePartitionedSequenceApiSelfTest.class));
         suite.addTest(new TestSuite(GridCachePartitionedSequenceMultiNodeSelfTest.class));
@@ -131,6 +136,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCachePartitionedAtomicSetSelfTest.class));
         suite.addTest(new TestSuite(IgnitePartitionedCountDownLatchSelfTest.class));
         suite.addTest(new TestSuite(IgniteDataStructureWithJobTest.class));
+        suite.addTest(new TestSuite(IgnitePartitionedSemaphoreSelfTest.class));
 
         suite.addTest(new TestSuite(GridCachePartitionedSetFailoverSelfTest.class));
         suite.addTest(new TestSuite(GridCachePartitionedOffheapSetFailoverSelfTest.class));
@@ -170,4 +176,4 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
 
         return suite;
     }
-}
\ No newline at end of file
+}


[05/27] ignite git commit: IGNITE-2873: .NET: Added support for app configuration from executable. This closes #576.

Posted by nt...@apache.org.
IGNITE-2873: .NET: Added support for app configuration from executable. This closes #576.


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

Branch: refs/heads/ignite-2004
Commit: e3ba037a6a912c54ec378facc9a66d9a6b320752
Parents: 7864826
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Mar 24 17:18:16 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 24 17:18:16 2016 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.Tests.csproj             |   9 +
 .../Config/Apache.Ignite.exe.config.test2       |  58 +++++++
 .../Config/Apache.Ignite.exe.config.test3       |  34 ++++
 .../Config/ignite-dotnet-cfg.xml                |  52 ++++++
 .../Apache.Ignite.Core.Tests/ExecutableTest.cs  |  89 +++++++---
 .../IgniteConfigurationSerializerTest.cs        |   3 +-
 .../IgniteConfigurationSection.xsd              |   8 +
 .../dotnet/Apache.Ignite/Apache.Ignite.csproj   |   2 +-
 .../Config/AppSettingsConfigurator.cs           |  97 +++--------
 .../Apache.Ignite/Config/ArgsConfigurator.cs    | 145 ++--------------
 .../dotnet/Apache.Ignite/Config/Configurator.cs | 168 +++++++++++++++++++
 .../Apache.Ignite/Config/IConfigurator.cs       |  34 ----
 .../dotnet/Apache.Ignite/IgniteRunner.cs        |  24 +--
 .../Apache.Ignite/Service/IgniteService.cs      |  21 +--
 14 files changed, 448 insertions(+), 296 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index fedbd63..7cc9296 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -265,6 +265,15 @@
     <None Include="Apache.Ignite.Core.Tests.nunit" />
     <None Include="Apache.Ignite.Core.Tests.snk" />
     <None Include="app.config" />
+    <Content Include="Config\ignite-dotnet-cfg.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <None Include="Config\Apache.Ignite.exe.config.test3">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="Config\Apache.Ignite.exe.config.test2">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test2
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test2 b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test2
new file mode 100644
index 0000000..ecfce18
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test2
@@ -0,0 +1,58 @@
+<?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.
+-->
+
+<configuration>
+    <configSections>
+        <section name="igniteConfiguration" type="Apache.Ignite.Core.IgniteConfigurationSection, Apache.Ignite.Core" />
+    </configSections>
+
+    <startup>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
+    </startup>
+
+    <runtime>
+        <gcServer enabled="true" />
+    </runtime>
+
+    <igniteConfiguration xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection">
+        <discoverySpi type="TcpDiscoverySpi">
+            <ipFinder type="TcpDiscoveryStaticIpFinder">
+                <endpoints>
+                    <string>127.0.0.1:47500..47501</string>
+                </endpoints>
+            </ipFinder>
+        </discoverySpi>
+
+        <jvmOptions>
+            <string>-Xms1g</string>
+            <string>-Xmx702m</string>
+        </jvmOptions>
+    </igniteConfiguration>
+
+    <appSettings>
+        <add key="Ignite.SpringConfigUrl" value="config\compute\compute-standalone.xml" />
+        <add key="Ignite.Assembly.1" value="test-1.dll" />
+        <add key="Ignite.Assembly.2" value="test-2.dll" />
+        <add key="Ignite.JvmOption.1" value="-DOPT1" />
+        <add key="Ignite.JvmOption.2" value="-DOPT2" />
+        <add key="Ignite.JvmOption.3" value="-Xms601m" />
+        <add key="Ignite.ConfigSectionName" value="igniteConfiguration" />
+    </appSettings>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test3
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test3 b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test3
new file mode 100644
index 0000000..c09f3f4
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Apache.Ignite.exe.config.test3
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<configuration>
+    <startup>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
+    </startup>
+
+    <runtime>
+        <gcServer enabled="true" />
+    </runtime>
+
+    <appSettings>
+        <add key="Ignite.ConfigFileName" value="config\ignite-dotnet-cfg.xml" />
+        <add key="Ignite.ConfigSectionName" value="igniteConfiguration" />
+    </appSettings>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/ignite-dotnet-cfg.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/ignite-dotnet-cfg.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/ignite-dotnet-cfg.xml
new file mode 100644
index 0000000..53f2f0f
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/ignite-dotnet-cfg.xml
@@ -0,0 +1,52 @@
+<?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.
+-->
+
+<configuration>
+    <configSections>
+        <section name="igniteConfiguration" type="Apache.Ignite.Core.IgniteConfigurationSection, Apache.Ignite.Core" />
+    </configSections>
+
+    <igniteConfiguration xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection" 
+                         localhost="127.0.0.1">
+        <discoverySpi type="TcpDiscoverySpi">
+            <ipFinder type="TcpDiscoveryStaticIpFinder">
+                <endpoints>
+                    <string>127.0.0.1:47500..47501</string>
+                </endpoints>
+            </ipFinder>
+        </discoverySpi>
+
+        <jvmOptions>
+            <string>-Xms512m</string>
+            <string>-Xmx702m</string>
+            <string>-DOPT25</string>
+        </jvmOptions>
+
+        <cacheConfiguration>
+            <cacheConfiguration name='testCache' cacheMode='Replicated' />
+        </cacheConfiguration>
+
+        <binaryConfiguration>
+            <types>
+                <string>Apache.Ignite.Core.Tests.ExecutableTest+RemoteConfiguration, Apache.Ignite.Core.Tests</string>
+                <string>Apache.Ignite.Core.Tests.ExecutableTest+RemoteConfigurationClosure, Apache.Ignite.Core.Tests</string>
+            </types>
+        </binaryConfiguration>
+    </igniteConfiguration>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ExecutableTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ExecutableTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ExecutableTest.cs
index e34e0ba..9e6de05 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ExecutableTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ExecutableTest.cs
@@ -17,6 +17,8 @@
 
 // ReSharper disable UnusedVariable
 // ReSharper disable UnusedAutoPropertyAccessor.Global
+// ReSharper disable UnusedAutoPropertyAccessor.Local
+//#pragma warning disable 618
 namespace Apache.Ignite.Core.Tests
 {
     using System;
@@ -27,7 +29,6 @@ namespace Apache.Ignite.Core.Tests
     using Apache.Ignite.Core.Impl;
     using Apache.Ignite.Core.Resource;
     using Apache.Ignite.Core.Tests.Process;
-    using Microsoft.CSharp;
     using NUnit.Framework;
 
     /// <summary>
@@ -77,7 +78,7 @@ namespace Apache.Ignite.Core.Tests
         {
             TestUtils.KillProcesses();
 
-            Assert.IsTrue(_grid.WaitTopology(1, 30000));
+            Assert.IsTrue(_grid.WaitTopology(1));
 
             IgniteProcess.SaveConfigurationBackup();
         }
@@ -106,7 +107,7 @@ namespace Apache.Ignite.Core.Tests
                 "-jvmClasspath=" + TestUtils.CreateTestClasspath()
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var cfg = RemoteConfig();
 
@@ -133,7 +134,7 @@ namespace Apache.Ignite.Core.Tests
                 "-assembly=test-2.dll"
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var cfg = RemoteConfig();
 
@@ -153,7 +154,7 @@ namespace Apache.Ignite.Core.Tests
                 "-J-DOPT2"
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var cfg = RemoteConfig();
 
@@ -173,7 +174,7 @@ namespace Apache.Ignite.Core.Tests
                 "-J-Xmx607m"
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var minMem = _grid.GetCluster().ForRemotes().GetCompute().ExecuteJavaTask<long>(MinMemTask, null);
             Assert.AreEqual((long) 506*1024*1024, minMem);
@@ -195,7 +196,7 @@ namespace Apache.Ignite.Core.Tests
                 "-JvmMaxMemoryMB=863"
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var minMem = _grid.GetCluster().ForRemotes().GetCompute().ExecuteJavaTask<long>(MinMemTask, null);
             Assert.AreEqual((long) 615*1024*1024, minMem);
@@ -208,16 +209,17 @@ namespace Apache.Ignite.Core.Tests
         /// Test JVM memory options passing from application configuration.
         /// </summary>
         [Test]
-        public void TestJvmMemoryOptsAppConfig()
+        public void TestJvmMemoryOptsAppConfig(
+            [Values("config\\Apache.Ignite.exe.config.test", "config\\Apache.Ignite.exe.config.test2")] string config)
         {
-            IgniteProcess.ReplaceConfiguration("config\\Apache.Ignite.exe.config.test");
+            IgniteProcess.ReplaceConfiguration(config);
 
             GenerateDll("test-1.dll");
             GenerateDll("test-2.dll");
 
             var proc = new IgniteProcess("-jvmClasspath=" + TestUtils.CreateTestClasspath());
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             var minMem = _grid.GetCluster().ForRemotes().GetCompute().ExecuteJavaTask<long>(MinMemTask, null);
             Assert.AreEqual((long) 601*1024*1024, minMem);
@@ -227,14 +229,14 @@ namespace Apache.Ignite.Core.Tests
 
             proc.Kill();
 
-            Assert.IsTrue(_grid.WaitTopology(1, 30000));
+            Assert.IsTrue(_grid.WaitTopology(1));
 
             // Command line options overwrite config file options
             // ReSharper disable once RedundantAssignment
             proc = new IgniteProcess("-jvmClasspath=" + TestUtils.CreateTestClasspath(),
                 "-J-Xms605m", "-J-Xmx706m");
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             minMem = _grid.GetCluster().ForRemotes().GetCompute().ExecuteJavaTask<long>(MinMemTask, null);
             Assert.AreEqual((long) 605*1024*1024, minMem);
@@ -258,7 +260,7 @@ namespace Apache.Ignite.Core.Tests
                 "-JvmMaxMemoryMB=256"
                 );
 
-            Assert.IsTrue(_grid.WaitTopology(2, 30000));
+            Assert.IsTrue(_grid.WaitTopology(2));
 
             // Raw JVM options (Xms/Xmx) should override custom options
             var minMem = _grid.GetCluster().ForRemotes().GetCompute().ExecuteJavaTask<long>(MinMemTask, null);
@@ -269,6 +271,45 @@ namespace Apache.Ignite.Core.Tests
         }
 
         /// <summary>
+        /// Tests the .NET XML configuration specified in app.config.
+        /// </summary>
+        [Test]
+        public void TestXmlConfigurationAppConfig()
+        {
+            IgniteProcess.ReplaceConfiguration("config\\Apache.Ignite.exe.config.test3");
+
+            var proc = new IgniteProcess("-jvmClasspath=" + TestUtils.CreateTestClasspath());
+
+            Assert.IsTrue(_grid.WaitTopology(2));
+
+            var remoteCfg = RemoteConfig();
+            Assert.IsTrue(remoteCfg.JvmOptions.Contains("-DOPT25"));
+
+            proc.Kill();
+
+            Assert.IsTrue(_grid.WaitTopology(1));
+        }
+
+        /// <summary>
+        /// Tests the .NET XML configuration specified in command line.
+        /// </summary>
+        [Test]
+        public void TestXmlConfigurationCmd()
+        {
+            var proc = new IgniteProcess("-jvmClasspath=" + TestUtils.CreateTestClasspath(),
+                "-configFileName=config\\ignite-dotnet-cfg.xml");
+
+            Assert.IsTrue(_grid.WaitTopology(2));
+
+            var remoteCfg = RemoteConfig();
+            Assert.IsTrue(remoteCfg.JvmOptions.Contains("-DOPT25"));
+
+            proc.Kill();
+
+            Assert.IsTrue(_grid.WaitTopology(1));
+        }
+
+        /// <summary>
         /// Get remote node configuration.
         /// </summary>
         /// <returns>Configuration.</returns>
@@ -325,21 +366,15 @@ namespace Apache.Ignite.Core.Tests
         /// <param name="outputPath"></param>
         private static void GenerateDll(string outputPath)
         {
-            var codeProvider = new CSharpCodeProvider();
-
-#pragma warning disable 0618
-
-            var icc = codeProvider.CreateCompiler();
-
-#pragma warning restore 0618
-
-            var parameters = new CompilerParameters();
-            parameters.GenerateExecutable = false;
-            parameters.OutputAssembly = outputPath;
+            var parameters = new CompilerParameters
+            {
+                GenerateExecutable = false,
+                OutputAssembly = outputPath
+            };
 
             var src = "namespace Apache.Ignite.Client.Test { public class Foo {}}";
 
-            var results = icc.CompileAssemblyFromSource(parameters, src);
+            var results = CodeDomProvider.CreateProvider("CSharp").CompileAssemblyFromSource(parameters, src);
 
             Assert.False(results.Errors.HasErrors);
         }
@@ -357,7 +392,7 @@ namespace Apache.Ignite.Core.Tests
         /// <summary>
         /// Closure which extracts configuration and passes it back.
         /// </summary>
-        public class RemoteConfigurationClosure : IComputeFunc<RemoteConfiguration>
+        private class RemoteConfigurationClosure : IComputeFunc<RemoteConfiguration>
         {
 
 #pragma warning disable 0649
@@ -396,7 +431,7 @@ namespace Apache.Ignite.Core.Tests
         /// <summary>
         /// Configuration.
         /// </summary>
-        public class RemoteConfiguration
+        private class RemoteConfiguration
         {
             /// <summary>
             /// GG home.

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
index e221a55..6e9effe 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -307,6 +307,7 @@ namespace Apache.Ignite.Core.Tests
                             Serializer = new TestSerializer()
                         }
                     },
+                    Types = new [] {typeof(string).FullName },
                     DefaultIdMapper = new IdMapper(),
                     DefaultKeepDeserialized = true,
                     DefaultNameMapper = new NameMapper(),
@@ -319,7 +320,7 @@ namespace Apache.Ignite.Core.Tests
                         AtomicWriteOrderMode = CacheAtomicWriteOrderMode.Primary,
                         AtomicityMode = CacheAtomicityMode.Transactional,
                         Backups = 15,
-                        CacheMode = CacheMode.Partitioned,
+                        CacheMode = CacheMode.Replicated,
                         CacheStoreFactory = new TestCacheStoreFactory(),
                         CopyOnRead = true,
                         EagerTtl = true,

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index 8902d3a..c7b6cf2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -61,6 +61,13 @@
                                     </xs:sequence>
                                 </xs:complexType>
                             </xs:element>
+                            <xs:element name="types" minOccurs="0">
+                                <xs:complexType>
+                                    <xs:sequence>
+                                        <xs:element maxOccurs="unbounded" name="string" type="xs:string" />
+                                    </xs:sequence>
+                                </xs:complexType>
+                            </xs:element>
                             <xs:element name="defaultNameMapper" minOccurs="0">
                                 <xs:complexType>
                                     <xs:attribute name="type" type="xs:string" use="required" />
@@ -161,6 +168,7 @@
                                         </xs:element>
                                     </xs:all>
                                     <xs:attribute name="name" type="xs:string" />
+                                    <xs:attribute name="cacheMode" type="xs:string" />
                                     <xs:attribute name="writeSynchronizationMode" type="xs:string" />
                                     <xs:attribute name="evictSynchronized" type="xs:boolean" />
                                     <xs:attribute name="evictSynchronizedKeyBufferSize" type="xs:int" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
index e2dae25..ccebbfe 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
@@ -51,8 +51,8 @@
   <ItemGroup>
     <Compile Include="Config\AppSettingsConfigurator.cs" />
     <Compile Include="Config\ArgsConfigurator.cs" />
+    <Compile Include="Config\Configurator.cs" />
     <Compile Include="Config\ConfigValueParser.cs" />
-    <Compile Include="Config\IConfigurator.cs" />
     <Compile Include="IgniteRunner.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Service\IgniteService.cs">

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Config/AppSettingsConfigurator.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Config/AppSettingsConfigurator.cs b/modules/platforms/dotnet/Apache.Ignite/Config/AppSettingsConfigurator.cs
index b2e827e..c15f29f 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Config/AppSettingsConfigurator.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Config/AppSettingsConfigurator.cs
@@ -17,97 +17,50 @@
 
 namespace Apache.Ignite.Config
 {
+    using System;
     using System.Collections.Generic;
     using System.Collections.Specialized;
-    using Apache.Ignite.Core;
+    using System.Linq;
 
     /// <summary>
     /// Configurator which uses application configuration.
     /// </summary>
-    internal class AppSettingsConfigurator : IConfigurator<NameValueCollection>
+    internal static class AppSettingsConfigurator
     {
         /** Common configuration property prefix. */
-        private static readonly string CfgPrefix = "Ignite.".ToLower();
+        private const string CfgPrefix = "Ignite.";
 
         /** Configuration property: Ignite home. */
-        private static readonly string CfgHome = "Home".ToLower();
-
-        /** Configuration property: Spring config URL. */
-        private static readonly string CfgSpringCfgUrl = "SpringConfigUrl".ToLower();
-
-        /** Configuration property: Path to JVM dll. */
-        private static readonly string CfgJvmDll = "JvmDll".ToLower();
-
-        /** Configuration property: JVM classpath. */
-        private static readonly string CfgJvmClasspath = "JvmClasspath".ToLower();
-
-        /** Configuration property: suppress warnings flag. */
-        private static readonly string CfgSuppressWarn = "SuppressWarnings".ToLower();
+        private const string CfgHome = "Home";
 
         /** Configuration property: JVM option prefix. */
-        private static readonly string CfgJvmOptPrefix = "JvmOption".ToLower();
+        private const string CfgJvmOptPrefix = "JvmOption";
 
         /** Configuration property: assembly prefix. */
-        private static readonly string CfgAssemblyPrefix = "Assembly".ToLower();
-
-        /** Configuration property: JVM min memory. */
-        private static readonly string CfgJvmMinMem = "JvmInitialMemoryMB".ToLower();
-
-        /** Configuration property: JVM max memory. */
-        private static readonly string CfgJvmMaxMem = "JvmMaxMemoryMB".ToLower();
+        private const string CfgAssemblyPrefix = "Assembly";
 
-        /** <inheritDoc /> */
-        public void Configure(IgniteConfiguration cfg, NameValueCollection src)
+        /// <summary>
+        /// Gets the arguments in split form.
+        /// </summary>
+        public static IEnumerable<Tuple<string, string>> GetArgs(NameValueCollection args)
         {
-            var jvmOpts = new List<string>();
-            var assemblies = new List<string>();
-
-            foreach (string key in src.Keys)
-            {
-                var key0 = key.ToLower();
-
-                if (key0.StartsWith(CfgPrefix))
-                {
-                    key0 = key0.Substring(CfgPrefix.Length);
-
-                    var val = src[key];
+            return args.AllKeys
+                .Where(x => x.StartsWith(CfgPrefix, StringComparison.OrdinalIgnoreCase))
+                .Select(k => Tuple.Create(Replace(k), args[k]));
+        }
 
-                    if (CfgHome.Equals(key0))
-                        cfg.IgniteHome = val;
-                    else if (CfgSpringCfgUrl.Equals(key0))
-                        cfg.SpringConfigUrl = val;
-                    else if (CfgJvmDll.Equals(key0))
-                        cfg.JvmDllPath = val;
-                    else if (CfgJvmClasspath.Equals(key0))
-                        cfg.JvmClasspath = val;
-                    else if (CfgSuppressWarn.Equals(key0))
-                        cfg.SuppressWarnings = val != null && bool.TrueString.ToLower().Equals(val.ToLower());
-                    else if (key0.StartsWith(CfgJvmOptPrefix))
-                        jvmOpts.Add(val);
-                    else if (key0.StartsWith(CfgAssemblyPrefix))
-                        assemblies.Add(val);
-                    else if (CfgJvmMinMem.Equals(key0))
-                        cfg.JvmInitialMemoryMb = ConfigValueParser.ParseInt(val, key);
-                    else if (CfgJvmMaxMem.Equals(key0))
-                        cfg.JvmMaxMemoryMb = ConfigValueParser.ParseInt(val, key);
-                }
-            }
+        /// <summary>
+        /// Replaces the appsettings-specific keys with common arg name.
+        /// </summary>
+        private static string Replace(string key)
+        {
+            key = key.Substring(CfgPrefix.Length);
 
-            if (jvmOpts.Count > 0)
-            {
-                if (cfg.JvmOptions == null)
-                    cfg.JvmOptions = jvmOpts;
-                else
-                    jvmOpts.ForEach(val => cfg.JvmOptions.Add(val));
-            }
+            key = key.Equals(CfgHome, StringComparison.OrdinalIgnoreCase) ? Configurator.CmdIgniteHome : key;
+            key = key.StartsWith(CfgJvmOptPrefix, StringComparison.OrdinalIgnoreCase) ? Configurator.CmdJvmOpt : key;
+            key = key.StartsWith(CfgAssemblyPrefix, StringComparison.OrdinalIgnoreCase) ? Configurator.CmdAssembly : key;
 
-            if (assemblies.Count > 0)
-            {
-                if (cfg.Assemblies == null)
-                    cfg.Assemblies = assemblies;
-                else
-                    assemblies.ForEach(val => cfg.Assemblies.Add(val));
-            }
+            return key;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Config/ArgsConfigurator.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Config/ArgsConfigurator.cs b/modules/platforms/dotnet/Apache.Ignite/Config/ArgsConfigurator.cs
index b0651d7..c7dae66 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Config/ArgsConfigurator.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Config/ArgsConfigurator.cs
@@ -17,148 +17,27 @@
 
 namespace Apache.Ignite.Config
 {
+    using System;
     using System.Collections.Generic;
-    using Apache.Ignite.Core;
+    using System.Linq;
 
     /// <summary>
     /// Configurator which uses arguments array.
     /// </summary>
-    internal class ArgsConfigurator : IConfigurator<string[]>
+    internal static class ArgsConfigurator
     {
-        /** Command line argument: Ignite home. */
-        private static readonly string CmdIgniteHome = "-IgniteHome=".ToLower();
-
-        /** Command line argument: Spring config URL. */
-        private static readonly string CmdSpringCfgUrl = "-SpringConfigUrl=".ToLower();
-
-        /** Command line argument: Path to JVM dll. */
-        private static readonly string CmdJvmDll = "-JvmDll=".ToLower();
-
-        /** Command line argument: JVM classpath. */
-        private static readonly string CmdJvmClasspath = "-JvmClasspath=".ToLower();
-
-        /** Command line argument: suppress warnings flag. */
-        private static readonly string CmdSuppressWarn = "-SuppressWarnings=".ToLower();
-
-        /** Command line argument: JVM option prefix. */
-        private static readonly string CmdJvmOpt = "-J".ToLower();
-
-        /** Command line argument: assembly. */
-        private static readonly string CmdAssembly = "-Assembly=".ToLower();
-
-        /** Command line argument: JvmInitialMemoryMB. */
-        private static readonly string CmdJvmMinMem = "-JvmInitialMemoryMB=".ToLower();
-
-        /** Command line argument: JvmMaxMemoryMB. */
-        private static readonly string CmdJvmMaxMem = "-JvmMaxMemoryMB=".ToLower();
-
-        /// <summary>
-        /// Convert configuration to arguments.
-        /// </summary>
-        /// <param name="cfg"></param>
-        /// <returns></returns>
-        internal static string[] ToArgs(IgniteConfiguration cfg)
-        {
-            var args = new List<string>();
-
-            if (cfg.IgniteHome != null)
-                args.Add(CmdIgniteHome + cfg.IgniteHome);
-
-            if (cfg.SpringConfigUrl != null)
-                args.Add(CmdSpringCfgUrl + cfg.SpringConfigUrl);
-
-            if (cfg.JvmDllPath != null)
-                args.Add(CmdJvmDll + cfg.JvmDllPath);
-
-            if (cfg.JvmClasspath != null)
-                args.Add(CmdJvmClasspath + cfg.JvmClasspath);
-            
-            if (cfg.SuppressWarnings)
-                args.Add(CmdSuppressWarn + bool.TrueString);
-
-            if (cfg.JvmOptions != null)
-            {
-                foreach (var jvmOpt in cfg.JvmOptions)
-                    args.Add(CmdJvmOpt + jvmOpt);
-            }
-
-            if (cfg.Assemblies != null)
-            {
-                foreach (var assembly in cfg.Assemblies)
-                    args.Add(CmdAssembly + assembly);
-            }
-
-            args.Add(CmdJvmMinMem + cfg.JvmInitialMemoryMb);
-            args.Add(CmdJvmMaxMem + cfg.JvmMaxMemoryMb);
-
-            return args.ToArray();
-        }
-
         /// <summary>
-        /// Convert arguments to configuration.
+        /// Gets the arguments in split form.
         /// </summary>
-        /// <param name="args">Arguments.</param>
-        /// <returns>Configuration.</returns>
-        internal static IgniteConfiguration FromArgs(string[] args)
-        {
-            var cfg = new IgniteConfiguration();
-
-            new ArgsConfigurator().Configure(cfg, args);
-
-            return cfg;
-        }
-
-        /** <inheritDoc /> */
-        public void Configure(IgniteConfiguration cfg, string[] src)
+        public static IEnumerable<Tuple<string, string>> GetArgs(IEnumerable<string> args)
         {
-            var jvmOpts = new List<string>();
-            var assemblies = new List<string>();
-
-            foreach (var arg in src)
-            {
-                var argLow = arg.ToLower();
-
-                if (argLow.StartsWith(CmdIgniteHome))
-                    cfg.IgniteHome = arg.Substring(CmdIgniteHome.Length);
-                else if (argLow.StartsWith(CmdSpringCfgUrl))
-                    cfg.SpringConfigUrl = arg.Substring(CmdSpringCfgUrl.Length);
-                else if (argLow.StartsWith(CmdJvmDll))
-                    cfg.JvmDllPath = arg.Substring(CmdJvmDll.Length);
-                else if (argLow.StartsWith(CmdJvmClasspath))
-                    cfg.JvmClasspath = arg.Substring(CmdJvmClasspath.Length);
-                else if (argLow.StartsWith(CmdSuppressWarn))
-                {
-                    var val = arg.Substring(CmdSuppressWarn.Length);
-
-                    cfg.SuppressWarnings = bool.TrueString.ToLower().Equals(val.ToLower());
-                }
-                else if (argLow.StartsWith(CmdJvmMinMem))
-                    cfg.JvmInitialMemoryMb = ConfigValueParser.ParseInt(arg.Substring(CmdJvmMinMem.Length),
-                        CmdJvmMinMem);
-                else if (argLow.StartsWith(CmdJvmMaxMem))
-                    cfg.JvmMaxMemoryMb = ConfigValueParser.ParseInt(arg.Substring(CmdJvmMaxMem.Length),
-                        CmdJvmMaxMem);
-                else if (argLow.StartsWith(CmdJvmOpt))
-                    jvmOpts.Add(arg.Substring(CmdJvmOpt.Length));
-                else if (argLow.StartsWith(CmdAssembly))
-                    assemblies.Add(arg.Substring(CmdAssembly.Length));
-            }
-
-            if (jvmOpts.Count > 0)
-            {
-                if (cfg.JvmOptions == null)
-                    cfg.JvmOptions = jvmOpts;
-                else
-                    jvmOpts.ForEach(val => cfg.JvmOptions.Add(val));
-            }
-
-            if (assemblies.Count > 0)
-            {
-                if (cfg.Assemblies == null)
-                    cfg.Assemblies = assemblies;
-                else
-                    assemblies.ForEach(val => cfg.Assemblies.Add(val));
-            }
+            return args
+                .Select(x => x.TrimStart('-'))
+                .Select(x => x.StartsWith(Configurator.CmdJvmOpt + "-")
+                    ? new[] {Configurator.CmdJvmOpt, x.Substring(Configurator.CmdJvmOpt.Length)}
+                    : x.Split('='))
+                .Where(x => x.Length == 2)
+                .Select(x => Tuple.Create(x[0], x[1]));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Config/Configurator.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Config/Configurator.cs b/modules/platforms/dotnet/Apache.Ignite/Config/Configurator.cs
new file mode 100644
index 0000000..af009e8
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite/Config/Configurator.cs
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache.Ignite.Config
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Configuration;
+    using System.IO;
+    using System.Linq;
+    using Apache.Ignite.Core;
+
+    /// <summary>
+    /// Configurator which uses arguments array.
+    /// </summary>
+    internal static class Configurator
+    {
+        /** Command line argument: Ignite home. */
+        public const string CmdIgniteHome = "IgniteHome";
+
+        /** Command line argument: Spring config URL. */
+        private const string CmdSpringCfgUrl = "SpringConfigUrl";
+
+        /** Command line argument: Path to JVM dll. */
+        private const string CmdJvmDll = "JvmDll";
+
+        /** Command line argument: JVM classpath. */
+        private const string CmdJvmClasspath = "JvmClasspath";
+
+        /** Command line argument: suppress warnings flag. */
+        private const string CmdSuppressWarn = "SuppressWarnings";
+
+        /** Command line argument: JVM option prefix. */
+        public const string CmdJvmOpt = "J";
+
+        /** Command line argument: assembly. */
+        public const string CmdAssembly = "Assembly";
+
+        /** Command line argument: JvmInitialMemoryMB. */
+        private const string CmdJvmMinMem = "JvmInitialMemoryMB";
+
+        /** Command line argument: JvmMaxMemoryMB. */
+        private const string CmdJvmMaxMem = "JvmMaxMemoryMB";
+
+        /** Command line argument: Config section name to read config from. */
+        private const string CmdConfigSection = "ConfigSectionName";
+
+        /** Command line argument: Config file name to read config section from. */
+        private const string CmdConfigFile = "ConfigFileName";
+
+        /** <inheritDoc /> */
+        public static IgniteConfiguration GetConfiguration(Tuple<string, string>[] args)
+        {
+            var jvmOpts = new List<string>();
+            var assemblies = new List<string>();
+
+            var cfg = ReadConfigurationSection(args) ?? new IgniteConfiguration();
+
+            foreach (var arg in args)
+            {
+                Func<string, bool> argIs = x => arg.Item1.Equals(x, StringComparison.OrdinalIgnoreCase);
+
+                if (argIs(CmdIgniteHome))
+                    cfg.IgniteHome = arg.Item2;
+                else if (argIs(CmdSpringCfgUrl))
+                    cfg.SpringConfigUrl = arg.Item2;
+                else if (argIs(CmdJvmDll))
+                    cfg.JvmDllPath = arg.Item2;
+                else if (argIs(CmdJvmClasspath))
+                    cfg.JvmClasspath = arg.Item2;
+                else if (argIs(CmdSuppressWarn))
+                {
+                    cfg.SuppressWarnings = bool.TrueString.Equals(arg.Item2, StringComparison.OrdinalIgnoreCase);
+                }
+                else if (argIs(CmdJvmMinMem))
+                    cfg.JvmInitialMemoryMb = ConfigValueParser.ParseInt(arg.Item2, CmdJvmMinMem);
+                else if (argIs(CmdJvmMaxMem))
+                    cfg.JvmMaxMemoryMb = ConfigValueParser.ParseInt(arg.Item2, CmdJvmMaxMem);
+                else if (argIs(CmdJvmOpt))
+                    jvmOpts.Add(arg.Item2);
+                else if (argIs(CmdAssembly))
+                    assemblies.Add(arg.Item2);
+            }
+
+            if (jvmOpts.Count > 0)
+            {
+                if (cfg.JvmOptions == null)
+                    cfg.JvmOptions = jvmOpts;
+                else
+                    jvmOpts.ForEach(val => cfg.JvmOptions.Add(val));
+            }
+
+            if (assemblies.Count > 0)
+            {
+                if (cfg.Assemblies == null)
+                    cfg.Assemblies = assemblies;
+                else
+                    assemblies.ForEach(val => cfg.Assemblies.Add(val));
+            }
+
+            return cfg;
+        }
+
+        /// <summary>
+        /// Reads the configuration section.
+        /// </summary>
+        private static IgniteConfiguration ReadConfigurationSection(Tuple<string, string>[] args)
+        {
+            var fileName = FindValue(args, CmdConfigFile);
+            var sectionName = FindValue(args, CmdConfigSection);
+
+            if (string.IsNullOrEmpty(fileName) && string.IsNullOrEmpty(sectionName))
+                return null;
+
+            var cfg = string.IsNullOrEmpty(fileName)
+                ? ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
+                : ConfigurationManager.OpenMappedExeConfiguration(GetConfigMap(fileName), ConfigurationUserLevel.None);
+
+            var section = string.IsNullOrEmpty(sectionName)
+                ? cfg.Sections.OfType<IgniteConfigurationSection>().FirstOrDefault()
+                : (IgniteConfigurationSection) cfg.GetSection(sectionName);
+
+            if (section == null)
+                throw new ConfigurationErrorsException(
+                    string.Format("Could not find {0} in current application configuration",
+                        typeof(IgniteConfigurationSection).Name));
+
+            return section.IgniteConfiguration;
+        }
+
+        /// <summary>
+        /// Gets the configuration file map.
+        /// </summary>
+        private static ExeConfigurationFileMap GetConfigMap(string fileName)
+        {
+            fileName = Path.GetFullPath(fileName);
+
+            if (!File.Exists(fileName))
+                throw new InvalidOperationException("Specified config file does not exist: " + fileName);
+
+            return new ExeConfigurationFileMap {ExeConfigFilename = fileName};
+        }
+
+        /// <summary>
+        /// Finds the config value.
+        /// </summary>
+        private static string FindValue(IEnumerable<Tuple<string, string>> args, string name)
+        {
+            return args.Where(x => name.Equals(x.Item1, StringComparison.OrdinalIgnoreCase))
+                    .Select(x => x.Item2)
+                    .FirstOrDefault();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Config/IConfigurator.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Config/IConfigurator.cs b/modules/platforms/dotnet/Apache.Ignite/Config/IConfigurator.cs
deleted file mode 100644
index f5c0acf..0000000
--- a/modules/platforms/dotnet/Apache.Ignite/Config/IConfigurator.cs
+++ /dev/null
@@ -1,34 +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.
- */
-
-namespace Apache.Ignite.Config
-{
-    using Apache.Ignite.Core;
-
-    /// <summary>
-    /// Configurator which is capable of setting configuration properties taken from somewhere.
-    /// </summary>
-    internal interface IConfigurator<in T>
-    {
-        /// <summary>
-        /// Set configuration.
-        /// </summary>
-        /// <param name="cfg">Configuration.</param>
-        /// <param name="src">Source.</param>
-        void Configure(IgniteConfiguration cfg, T src);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs b/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
index 122994f..68a8445 100644
--- a/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/IgniteRunner.cs
@@ -49,8 +49,6 @@ namespace Apache.Ignite
         /// </summary>
         internal static void Main(string[] args)
         {
-            IgniteConfiguration cfg;
-
             bool svc = false;
             bool install = false;
 
@@ -59,7 +57,7 @@ namespace Apache.Ignite
                 // Check for special cases.
                 if (args.Length > 0)
                 {
-                    string first = args[0].ToLower();
+                    string first = args[0].ToLowerInvariant();
 
                     if (Help.Contains(first))
                     {
@@ -91,19 +89,15 @@ namespace Apache.Ignite
 
                 if (!svc)
                 {
-                    // Pick application configuration.
-                    cfg = new IgniteConfiguration();
-
-                    new AppSettingsConfigurator().Configure(cfg, ConfigurationManager.AppSettings);
-
-                    // Pick command line arguments.
-                    new ArgsConfigurator().Configure(cfg, args);
+                    // Pick application configuration first, command line arguments second.
+                    var allArgs = AppSettingsConfigurator.GetArgs(ConfigurationManager.AppSettings)
+                        .Concat(ArgsConfigurator.GetArgs(args)).ToArray();
 
                     if (install)
-                        IgniteService.DoInstall(cfg);
+                        IgniteService.DoInstall(allArgs);
                     else
                     {
-                        Ignition.Start(cfg);
+                        Ignition.Start(Configurator.GetConfiguration(allArgs));
 
                         IgniteManager.DestroyJvm();
                     }
@@ -113,16 +107,14 @@ namespace Apache.Ignite
             }
             catch (Exception e)
             {
-                Console.WriteLine("ERROR: " + e.Message);
+                Console.WriteLine("ERROR: " + e);
 
                 Environment.Exit(-1);
             }
 
             // If we are here, then this is a service call.
-            cfg = new IgniteConfiguration();
-
             // Use only arguments, not app.config.
-            new ArgsConfigurator().Configure(cfg, args);
+            var cfg = Configurator.GetConfiguration(ArgsConfigurator.GetArgs(args).ToArray());
 
             ServiceBase.Run(new IgniteService(cfg));
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e3ba037a/modules/platforms/dotnet/Apache.Ignite/Service/IgniteService.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Service/IgniteService.cs b/modules/platforms/dotnet/Apache.Ignite/Service/IgniteService.cs
index 49cce44..c64c7bf 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Service/IgniteService.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Service/IgniteService.cs
@@ -25,7 +25,6 @@ namespace Apache.Ignite.Service
     using System.Runtime.InteropServices;
     using System.ServiceProcess;
     using System.Text;
-    using Apache.Ignite.Config;
     using Apache.Ignite.Core;
     using Apache.Ignite.Core.Common;
 
@@ -35,21 +34,21 @@ namespace Apache.Ignite.Service
     internal class IgniteService : ServiceBase
     {
         /** Service name. */
-        internal static readonly string SvcName = "Apache Ignite.NET";
+        private static readonly string SvcName = "Apache Ignite.NET";
 
         /** Service display name. */
-        internal static readonly string SvcDisplayName = "Apache Ignite.NET " + 
+        private static readonly string SvcDisplayName = "Apache Ignite.NET " + 
             Assembly.GetExecutingAssembly().GetName().Version.ToString(4);
 
         /** Service description. */
-        internal static readonly string SvcDesc = "Apache Ignite.NET Service.";
+        private static readonly string SvcDesc = "Apache Ignite.NET Service.";
 
         /** Current executable name. */
-        internal static readonly string ExeName =
+        private static readonly string ExeName =
             new FileInfo(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath).FullName;
 
         /** Current executable fully qualified name. */
-        internal static readonly string FullExeName = Path.GetFileName(FullExeName);
+        private static readonly string FullExeName = Path.GetFileName(FullExeName);
 
         /** Ignite configuration to start with. */
         private readonly IgniteConfiguration _cfg;
@@ -81,8 +80,8 @@ namespace Apache.Ignite.Service
         /// <summary>
         /// Install service programmatically.
         /// </summary>
-        /// <param name="cfg">Ignite configuration.</param>
-        internal static void DoInstall(IgniteConfiguration cfg)
+        /// <param name="args">The arguments.</param>
+        internal static void DoInstall(Tuple<string, string>[] args)
         {
             // 1. Check if already defined.
             if (ServiceController.GetServices().Any(svc => SvcName.Equals(svc.ServiceName)))
@@ -92,8 +91,6 @@ namespace Apache.Ignite.Service
             }
 
             // 2. Create startup arguments.
-            var args = ArgsConfigurator.ToArgs(cfg);
-
             if (args.Length > 0)
             {
                 Console.WriteLine("Installing \"" + SvcName + "\" service with the following startup " +
@@ -140,13 +137,13 @@ namespace Apache.Ignite.Service
         /// Native service installation.
         /// </summary>
         /// <param name="args">Arguments.</param>
-        private static void Install0(string[] args)
+        private static void Install0(Tuple<string, string>[] args)
         {
             // 1. Prepare arguments.
             var binPath = new StringBuilder(FullExeName).Append(" ").Append(IgniteRunner.Svc);
 
             foreach (var arg in args)
-                binPath.Append(" ").Append(arg);
+                binPath.Append(" ").AppendFormat("-{0}={1}", arg.Item1, arg.Item2);
 
             // 2. Get SC manager.
             var scMgr = OpenServiceControlManager();


[25/27] ignite git commit: IGNITE-2900: CPP: Fixed metadata write routine. This closes #581.

Posted by nt...@apache.org.
IGNITE-2900: CPP: Fixed metadata write routine. This closes #581.


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

Branch: refs/heads/ignite-2004
Commit: 732abda9ed471ae7c8b80da7676838709ed3dc2b
Parents: fc34e51
Author: isapego <is...@gridgain.com>
Authored: Tue Mar 29 10:06:04 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Mar 29 10:06:04 2016 +0300

----------------------------------------------------------------------
 .../cpp/core/src/impl/binary/binary_type_updater_impl.cpp          | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/732abda9/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
index 6c3bf7f..aedd73b 100644
--- a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
@@ -80,6 +80,8 @@ namespace ignite
 
                 rawWriter.WriteBool(false); // Enums are not supported for now.
 
+                rawWriter.WriteInt32(0); // Schema size. Compact schema footer is not yet supported.
+
                 out.Synchronize();
 
                 long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, OP_METADATA, mem.Get()->PointerLong(), &jniErr);


[15/27] ignite git commit: Support optional IO policy resolver in DataStreamer.

Posted by nt...@apache.org.
Support optional IO policy resolver in DataStreamer.


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

Branch: refs/heads/ignite-2004
Commit: 4df74187072d839bdd09eb3b6163e2612fadc1c3
Parents: 2cfe0cb
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Mar 28 12:24:16 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Mar 28 12:24:16 2016 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 43 +++++++++++++++++---
 .../processors/cache/GridCacheAdapter.java      |  2 +-
 .../datastreamer/DataStreamProcessor.java       |  8 +++-
 .../datastreamer/DataStreamerImpl.java          | 37 ++++++++++++++++-
 4 files changed, 81 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4df74187/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 4577dc8..4bc2eea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -115,6 +115,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
     /** Direct protocol version. */
     public static final byte DIRECT_PROTO_VER = 2;
 
+    /** Current IO policy. */
+    private static final ThreadLocal<Byte> CUR_PLC = new ThreadLocal<>();
+
     /** Listeners by topic. */
     private final ConcurrentMap<Object, GridMessageListener> lsnrMap = new ConcurrentHashMap8<>();
 
@@ -764,7 +767,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
                     assert obj != null;
 
-                    lsnr.onMessage(nodeId, obj);
+                    invokeListener(msg.policy(), lsnr, nodeId, obj);
                 }
                 finally {
                     threadProcessingMessage(false);
@@ -841,7 +844,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
         assert obj != null;
 
-        lsnr.onMessage(nodeId, obj);
+        invokeListener(msg.policy(), lsnr, nodeId, obj);
     }
 
     /**
@@ -1197,6 +1200,38 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
     }
 
     /**
+     * Invoke message listener.
+     *
+     * @param plc Policy.
+     * @param lsnr Listener.
+     * @param nodeId Node ID.
+     * @param msg Message.
+     */
+    private void invokeListener(Byte plc, GridMessageListener lsnr, UUID nodeId, Object msg) {
+        Byte oldPlc = CUR_PLC.get();
+
+        boolean change = F.eq(oldPlc, plc);
+
+        if (change)
+            CUR_PLC.set(plc);
+
+        try {
+            lsnr.onMessage(nodeId, msg);
+        }
+        finally {
+            if (change)
+                CUR_PLC.set(oldPlc);
+        }
+    }
+
+    /**
+     * @return Current IO policy
+     */
+    @Nullable public static Byte currentPolicy() {
+        return CUR_PLC.get();
+    }
+
+    /**
      * @param node Destination node.
      * @param topic Topic to send the message to.
      * @param topicOrd GridTopic enumeration ordinal.
@@ -2418,9 +2453,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
 
             for (GridTuple3<GridIoMessage, Long, IgniteRunnable> t = msgs.poll(); t != null; t = msgs.poll()) {
                 try {
-                    lsnr.onMessage(
-                        nodeId,
-                        t.get1().message());
+                    invokeListener(plc, lsnr, nodeId, t.get1().message());
                 }
                 finally {
                     if (t.get3() != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/4df74187/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 86036ac..a1f0f28 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
@@ -5920,7 +5920,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                 ctx.toCacheObject(val),
                 ttl,
                 0,
-                ver);
+                ver.conflictVersion());
 
             e.prepareDirectMarshal(ctx.cacheObjectContext());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/4df74187/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
index d899c67..c7c1f5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
@@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.managers.communication.GridIoManager;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
@@ -339,7 +340,12 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
         DataStreamerResponse res = new DataStreamerResponse(reqId, errBytes, forceLocDep);
 
         try {
-            ctx.io().send(nodeId, resTopic, res, PUBLIC_POOL);
+            Byte plc = GridIoManager.currentPolicy();
+
+            if (plc == null)
+                plc = PUBLIC_POOL;
+
+            ctx.io().send(nodeId, resTopic, res, plc);
         }
         catch (IgniteCheckedException e) {
             if (ctx.discovery().alive(nodeId))

http://git-wip-us.apache.org/repos/asf/ignite/blob/4df74187/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index 7564376..4599060 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -57,6 +57,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
+import org.apache.ignite.internal.managers.communication.GridIoPolicy;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
@@ -91,6 +92,7 @@ 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.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgniteUuid;
@@ -109,6 +111,9 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUB
  */
 @SuppressWarnings("unchecked")
 public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed {
+    /** Default policy reoslver. */
+    private static final DefaultIoPolicyResolver DFLT_IO_PLC_RSLVR = new DefaultIoPolicyResolver();
+
     /** Isolated receiver. */
     private static final StreamReceiver ISOLATED_UPDATER = new IsolatedUpdater();
 
@@ -118,6 +123,9 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
     /** */
     private byte[] updaterBytes;
 
+    /** IO policy resovler for data load request. */
+    private IgniteClosure<ClusterNode, Byte> ioPlcRslvr = DFLT_IO_PLC_RSLVR;
+
     /** Max remap count before issuing an error. */
     private static final int DFLT_MAX_REMAP_CNT = 32;
 
@@ -602,6 +610,13 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
     }
 
     /**
+     * @param ioPlcRslvr IO policy resolver.
+     */
+    public void ioPolicyResolver(IgniteClosure<ClusterNode, Byte> ioPlcRslvr) {
+        this.ioPlcRslvr = ioPlcRslvr;
+    }
+
+    /**
      * @param entries Entries.
      * @param resFut Result future.
      * @param activeKeys Active keys.
@@ -1257,7 +1272,12 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
 
             IgniteInternalFuture<Object> fut;
 
-            if (isLocNode) {
+            Byte plc = ioPlcRslvr.apply(node);
+
+            if (plc == null)
+                plc = PUBLIC_POOL;
+
+            if (isLocNode && plc == GridIoPolicy.PUBLIC_POOL) {
                 fut = ctx.closure().callLocalSafe(
                     new DataStreamerUpdateJob(ctx, log, cacheName, entries, false, skipStore, keepBinary, rcvr), false);
 
@@ -1355,7 +1375,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
                     topVer);
 
                 try {
-                    ctx.io().send(node, TOPIC_DATASTREAM, req, PUBLIC_POOL);
+                    ctx.io().send(node, TOPIC_DATASTREAM, req, plc);
 
                     if (log.isDebugEnabled())
                         log.debug("Sent request to node [nodeId=" + node.id() + ", req=" + req + ']');
@@ -1620,4 +1640,17 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
             }
         }
     }
+
+    /**
+     * Default IO policy resolver.
+     */
+    private static class DefaultIoPolicyResolver implements IgniteClosure<ClusterNode, Byte> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** {@inheritDoc} */
+        @Override public Byte apply(ClusterNode gridNode) {
+            return PUBLIC_POOL;
+        }
+    }
 }


[09/27] ignite git commit: IGNITE-2882: .NET: Decreased amount of memory consumed by examples to allow the to run smoothly on 32-bit environment. Improved error messages when JVM fails to start. This closes #573.

Posted by nt...@apache.org.
IGNITE-2882: .NET: Decreased amount of memory consumed by examples to allow the to run smoothly on 32-bit environment. Improved error messages when JVM fails to start. This closes #573.


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

Branch: refs/heads/ignite-2004
Commit: 090144c4578952335ea30ba9ce266ac0569af8c0
Parents: c63faf6
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Fri Mar 25 09:21:51 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Mar 25 09:21:51 2016 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/common/src/java.cpp       | 74 ++++++++++++++++----
 .../Examples/ExamplesTest.cs                    |  3 +-
 .../Compute/ClosureExample.cs                   |  2 +-
 .../Compute/TaskExample.cs                      |  2 +-
 .../Datagrid/ContinuousQueryExample.cs          |  2 +-
 .../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               |  2 +-
 .../Misc/LifecycleExample.cs                    |  2 +-
 .../Services/ServicesExample.cs                 |  2 +-
 14 files changed, 72 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/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 89f4713..ae06c30 100644
--- a/modules/platforms/cpp/common/src/java.cpp
+++ b/modules/platforms/cpp/common/src/java.cpp
@@ -788,7 +788,7 @@ namespace ignite
             /**
              * Create JVM.
              */
-            void CreateJvm(char** opts, int optsLen, JavaVM** jvm, JNIEnv** env) {
+            jint CreateJvm(char** opts, int optsLen, JavaVM** jvm, JNIEnv** env) {
                 JavaVMOption* opts0 = new JavaVMOption[optsLen];
 
                 for (int i = 0; i < optsLen; i++)
@@ -805,8 +805,7 @@ namespace ignite
 
                 delete[] opts0;
 
-                if (res != JNI_OK)
-                    throw JvmException();
+                return res;
             }
 
             void RegisterNatives(JNIEnv* env) {
@@ -903,6 +902,40 @@ namespace ignite
                 return Create(opts, optsLen, hnds, NULL);
             }
 
+            void GetJniErrorMessage(std::string& errMsg, jint res)
+            {
+                switch (res)
+                {
+                    case JNI_ERR:
+                        errMsg = "Unknown error (JNI_ERR).";
+                        break;
+
+                    case JNI_EDETACHED:
+                        errMsg = "Thread detached from the JVM.";
+                        break;
+
+                    case JNI_EVERSION:
+                        errMsg = "JNI version error.";
+                        break;
+
+                    case JNI_ENOMEM:
+                        errMsg = "Could not reserve enough space for object heap. Check Xmx option.";
+                        break;
+
+                    case JNI_EEXIST:
+                        errMsg = "JVM already created.";
+                        break;
+
+                    case JNI_EINVAL:
+                        errMsg = "Invalid JVM arguments.";
+                        break;
+
+                    default:
+                        errMsg = "Unexpected JNI_CreateJavaVM result.";
+                        break;
+                }
+            }
+
             JniContext* JniContext::Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo)
             {
                 // Acquire global lock to instantiate the JVM.
@@ -926,25 +959,36 @@ namespace ignite
                 int errMsgLen = 0;
 
                 try {
-                    if (!JVM.GetJvm()) {
+                    if (!JVM.GetJvm()) 
+                    {
                         // 1. Create JVM itself.
-                        CreateJvm(opts, optsLen, &jvm, &env);
+                        jint res = CreateJvm(opts, optsLen, &jvm, &env);
 
-                        // 2. Populate members;
-                        javaMembers.Initialize(env);
-                        members.Initialize(env);
+                        if (res == JNI_OK)
+                        {
+                            // 2. Populate members;
+                            javaMembers.Initialize(env);
+                            members.Initialize(env);
 
-                        // 3. Register native functions.
-                        RegisterNatives(env);
+                            // 3. Register native functions.
+                            RegisterNatives(env);
 
-                        // 4. Create JNI JVM.
-                        JVM = JniJvm(jvm, javaMembers, members);
+                            // 4. Create JNI JVM.
+                            JVM = JniJvm(jvm, javaMembers, members);
 
-                        char* printStack = getenv("IGNITE_CPP_PRINT_STACK");
-                        PRINT_EXCEPTION = printStack && strcmp("true", printStack) == 0;
+                            char* printStack = getenv("IGNITE_CPP_PRINT_STACK");
+                            PRINT_EXCEPTION = printStack && strcmp("true", printStack) == 0;
+                        }
+                        else
+                        {
+                            GetJniErrorMessage(errMsg, res);
+
+                            errMsgLen = errMsg.length();
+                        }
                     }
 
-                    ctx = new JniContext(&JVM, hnds);
+                    if (JVM.GetJvm())
+                        ctx = new JniContext(&JVM, hnds);
                 }
                 catch (JvmException)
                 {

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ExamplesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ExamplesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ExamplesTest.cs
index 4e8a036..7cf0d57 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ExamplesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ExamplesTest.cs
@@ -20,7 +20,6 @@ namespace Apache.Ignite.Core.Tests.Examples
     using System;
     using System.Collections.Generic;
     using System.IO;
-    using System.Linq;
     using Apache.Ignite.Core.Tests.Process;
     using Apache.Ignite.ExamplesDll.Compute;
     using NUnit.Framework;
@@ -104,7 +103,7 @@ namespace Apache.Ignite.Core.Tests.Examples
 
                     var proc = new IgniteProcess(args.ToArray());
 
-                    Assert.IsTrue(ignite.WaitTopology(i + 2, 30000));
+                    Assert.IsTrue(ignite.WaitTopology(i + 2));
                     Assert.IsTrue(proc.Alive);
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
index aeb352f..e1194f8 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
@@ -48,7 +48,7 @@ namespace Apache.Ignite.Examples.Compute
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
             
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
index 38faf59..f0bcf13 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
@@ -49,7 +49,7 @@ namespace Apache.Ignite.Examples.Compute
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
index ca7f852..8dad1f4 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
@@ -50,7 +50,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
+                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
index 1db89fe..08a670f 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
@@ -58,7 +58,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
+                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
index 4d38ad9..e2502e8 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
@@ -55,7 +55,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
index d961f11..809eb65 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
@@ -49,7 +49,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-query.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
index 421d3bc..1654b41 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
@@ -49,7 +49,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-store.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
index c2b6e98..e814f8c 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
@@ -49,7 +49,7 @@ namespace Apache.Ignite.Examples.Datagrid
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
index 42b1777..3b068e8 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
@@ -52,7 +52,7 @@ namespace Apache.Ignite.Examples.Events
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
+                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
index 3fafd8f..6438b95 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
@@ -45,7 +45,7 @@ namespace Apache.Ignite.Examples.Messaging
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
index 4a1162b..bba6719 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
@@ -51,7 +51,7 @@ namespace Apache.Ignite.Examples.Misc
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" },
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" },
                 LifecycleBeans = new List<ILifecycleBean> { lifecycleExampleBean }
             };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/090144c4/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
index d513305..e57774c 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Services
             var cfg = new IgniteConfiguration
             {
                 SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
+                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m"}
             };
 
             using (var ignite = Ignition.Start(cfg))


[06/27] ignite git commit: IGNITE-2849: BinaryObjectBuilder doesn't properly check metadata

Posted by nt...@apache.org.
IGNITE-2849: BinaryObjectBuilder doesn't properly check metadata


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

Branch: refs/heads/ignite-2004
Commit: 093623eb4ca69fdb8ff705ebc50d4b867be8b2e9
Parents: e3ba037
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Mar 24 20:07:48 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Mar 24 20:07:48 2016 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   2 +-
 .../ignite/internal/binary/BinaryUtils.java     |  16 ---
 .../binary/builder/BinaryObjectBuilderImpl.java | 107 ++++++++------
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 144 +++++++++++++++++--
 ...naryObjectBuilderDefaultMappersSelfTest.java |   2 +-
 5 files changed, 197 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/093623eb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index 200aa0f..b9a3118 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -248,7 +248,7 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> {
 
                 Object colVal = getColumnValue(rs, colIdx, field.getJavaFieldType());
 
-                builder.setField(field.getJavaFieldName(), colVal);
+                builder.setField(field.getJavaFieldName(), colVal, (Class<Object>)field.getJavaFieldType());
 
                 if (calcHash)
                     hashValues.add(colVal);

http://git-wip-us.apache.org/repos/asf/ignite/blob/093623eb/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index 727501a..37f1d6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -320,22 +320,6 @@ public class BinaryUtils {
     }
 
     /**
-     * @param typeName Field type name.
-     * @return Field type ID;
-     */
-    @SuppressWarnings("StringEquality")
-    public static int fieldTypeId(String typeName) {
-        for (int i = 0; i < FIELD_TYPE_NAMES.length; i++) {
-            String typeName0 = FIELD_TYPE_NAMES[i];
-
-            if (typeName.equals(typeName0))
-                return i;
-        }
-
-        throw new IllegalArgumentException("Invalid metadata type name: " + typeName);
-    }
-
-    /**
      * @param typeId Field type ID.
      * @return Field type name.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/093623eb/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
index 9043a8b..16c51b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
@@ -195,6 +195,10 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
             Set<Integer> remainsFlds = null;
 
+            BinaryType meta = ctx.metadata(typeId);
+
+            Map<String, Integer> fieldsMeta = null;
+
             if (reader != null) {
                 BinarySchema schema = reader.schema();
 
@@ -204,9 +208,15 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                     assignedFldsById = U.newHashMap(assignedVals.size());
 
                     for (Map.Entry<String, Object> entry : assignedVals.entrySet()) {
-                        int fieldId = ctx.fieldId(typeId, entry.getKey());
+                        String name = entry.getKey();
+                        Object val = entry.getValue();
+
+                        int fieldId = ctx.fieldId(typeId, name);
 
-                        assignedFldsById.put(fieldId, entry.getValue());
+                        assignedFldsById.put(fieldId, val);
+
+                        if (val != REMOVED_FIELD_MARKER)
+                            fieldsMeta = checkMetadata(meta, fieldsMeta, val, name);
                     }
 
                     remainsFlds = assignedFldsById.keySet();
@@ -280,10 +290,6 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                 }
             }
 
-            BinaryType meta = ctx.metadata(typeId);
-
-            Map<String, Integer> fieldsMeta = null;
-
             if (assignedVals != null && (remainsFlds == null || !remainsFlds.isEmpty())) {
                 for (Map.Entry<String, Object> entry : assignedVals.entrySet()) {
                     Object val = entry.getValue();
@@ -302,43 +308,9 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
                     serializer.writeValue(writer, val);
 
-                    String oldFldTypeName = meta == null ? null : meta.fieldTypeName(name);
-
-                    boolean nullObjField = false;
-
-                    int newFldTypeId;
-
-                    if (val instanceof BinaryValueWithType) {
-                        newFldTypeId = ((BinaryValueWithType)val).typeId();
-
-                        if (newFldTypeId == GridBinaryMarshaller.OBJ && ((BinaryValueWithType)val).value() == null)
-                            nullObjField = true;
-                    }
-                    else
-                        newFldTypeId = BinaryUtils.typeByClass(val.getClass());
-
-                    String newFldTypeName = BinaryUtils.fieldTypeName(newFldTypeId);
-
-                    if (oldFldTypeName == null) {
-                        // It's a new field, we have to add it to metadata.
-                        if (fieldsMeta == null)
-                            fieldsMeta = new HashMap<>();
-
-                        fieldsMeta.put(name, BinaryUtils.fieldTypeId(newFldTypeName));
-                    }
-                    else if (!nullObjField) {
-                        String objTypeName = BinaryUtils.fieldTypeName(GridBinaryMarshaller.OBJ);
-
-                        if (!objTypeName.equals(oldFldTypeName) && !oldFldTypeName.equals(newFldTypeName)) {
-                            throw new BinaryObjectException(
-                                "Wrong value has been set [" +
-                                    "typeName=" + (typeName == null ? meta.typeName() : typeName) +
-                                    ", fieldName=" + name +
-                                    ", fieldType=" + oldFldTypeName +
-                                    ", assignedValueType=" + newFldTypeName + ']'
-                            );
-                        }
-                    }
+                    if (reader == null)
+                        // Metadata has already been checked.
+                        fieldsMeta = checkMetadata(meta, fieldsMeta, val, name);
                 }
             }
 
@@ -386,6 +358,55 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         }
     }
 
+    /**
+     * Checks metadata when a BinaryObject is being serialized.
+     *
+     * @param meta Current metadata.
+     * @param fieldsMeta Map holding metadata information that has to be updated.
+     * @param newVal Field value being serialized.
+     * @param name Field name.
+     */
+    private Map<String, Integer> checkMetadata(BinaryType meta, Map<String, Integer> fieldsMeta, Object newVal,
+        String name) {
+        String oldFldTypeName = meta == null ? null : meta.fieldTypeName(name);
+
+        boolean nullFieldVal = false;
+
+        int newFldTypeId;
+
+        if (newVal instanceof BinaryValueWithType) {
+            newFldTypeId = ((BinaryValueWithType)newVal).typeId();
+
+            if (((BinaryValueWithType)newVal).value() == null)
+                nullFieldVal = true;
+        }
+        else
+            newFldTypeId = BinaryUtils.typeByClass(newVal.getClass());
+
+        if (oldFldTypeName == null) {
+            // It's a new field, we have to add it to metadata.
+            if (fieldsMeta == null)
+                fieldsMeta = new HashMap<>();
+
+            fieldsMeta.put(name, newFldTypeId);
+        }
+        else if (!nullFieldVal) {
+            String newFldTypeName = BinaryUtils.fieldTypeName(newFldTypeId);
+
+            if (!F.eq(newFldTypeName, oldFldTypeName)) {
+                throw new BinaryObjectException(
+                    "Wrong value has been set [" +
+                        "typeName=" + (typeName == null ? meta.typeName() : typeName) +
+                        ", fieldName=" + name +
+                        ", fieldType=" + oldFldTypeName +
+                        ", assignedValueType=" + newFldTypeName + ']'
+                );
+            }
+        }
+
+        return fieldsMeta;
+    }
+
     /** {@inheritDoc} */
     @Override public BinaryObjectBuilderImpl hashCode(int hashCode) {
         this.hashCode = hashCode;

http://git-wip-us.apache.org/repos/asf/ignite/blob/093623eb/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
index 804c060..e3e538b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.IgniteBinary;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.configuration.BinaryConfiguration;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -234,7 +235,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     public void testDateArrayModification() {
         GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
-        obj.dateArr =  new Date[] {new Date(11111), new Date(11111), new Date(11111)};
+        obj.dateArr = new Date[] {new Date(11111), new Date(11111), new Date(11111)};
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
@@ -498,7 +499,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         Object[] createdArr = {mutObj, "a", 1, new String[] {"s", "s"}, new byte[] {1, 2}, new UUID(3, 0)};
 
-        mutObj.setField("foo", createdArr.clone());
+        mutObj.setField("foo", createdArr.clone(), Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
@@ -555,7 +556,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         ArrayList<Object> list = Lists.newArrayList(mutObj, "a", Lists.newArrayList(1, 2));
 
-        mutObj.setField("foo", list);
+        mutObj.setField("foo", list, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
@@ -653,7 +654,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         List<Object> list = Lists.newLinkedList(Arrays.asList(mutObj, "a", Lists.newLinkedList(Arrays.asList(1, 2))));
 
-        mutObj.setField("foo", list);
+        mutObj.setField("foo", list, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
@@ -736,7 +737,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         Set<Object> c = Sets.newHashSet(mutObj, "a", Sets.newHashSet(1, 2));
 
-        mutObj.setField("foo", c);
+        mutObj.setField("foo", c, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
@@ -815,7 +816,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         Map<Object, Object> map = Maps.newHashMap(ImmutableMap.of(mutObj, "a", "b", mutObj));
 
-        mutObj.setField("foo", map);
+        mutObj.setField("foo", map, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
@@ -995,6 +996,123 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     /**
      *
      */
+    public void testWrongMetadataNullField() {
+        BinaryObjectBuilder builder = binaries().builder("SomeType");
+
+        builder.setField("dateField", null);
+
+        builder.setField("objectField", null, Integer.class);
+
+        builder.build();
+
+        try {
+            builder = binaries().builder("SomeType");
+
+            builder.setField("dateField", new Date());
+
+            builder.build();
+        }
+        catch (BinaryObjectException ex) {
+            assertTrue(ex.getMessage().startsWith("Wrong value has been set"));
+        }
+
+        builder = binaries().builder("SomeType");
+
+        try {
+            builder.setField("objectField", new GridBinaryTestClasses.Company());
+
+            builder.build();
+
+            fail("BinaryObjectBuilder accepted wrong metadata");
+        }
+        catch (BinaryObjectException ex) {
+            assertTrue(ex.getMessage().startsWith("Wrong value has been set"));
+        }
+    }
+
+    /**
+     *
+     */
+    public void testWrongMetadataNullField2() {
+        BinaryObjectBuilder builder = binaries().builder("SomeType1");
+
+        builder.setField("dateField", null);
+
+        builder.setField("objectField", null, Integer.class);
+
+        BinaryObject obj = builder.build();
+
+        try {
+            builder = binaries().builder(obj);
+
+            builder.setField("dateField", new Date());
+
+            builder.build();
+        }
+        catch (BinaryObjectException ex) {
+            assertTrue(ex.getMessage().startsWith("Wrong value has been set"));
+        }
+
+        builder = binaries().builder(obj);
+
+        try {
+            builder.setField("objectField", new GridBinaryTestClasses.Company());
+
+            builder.build();
+
+            fail("BinaryObjectBuilder accepted wrong metadata");
+        }
+        catch (BinaryObjectException ex) {
+            assertTrue(ex.getMessage().startsWith("Wrong value has been set"));
+        }
+    }
+
+    /**
+     *
+     */
+    public void testCorrectMetadataNullField() {
+        BinaryObjectBuilder builder = binaries().builder("SomeType2");
+
+        builder.setField("dateField", null, Date.class);
+
+        builder.setField("objectField", null, GridBinaryTestClasses.Company.class);
+
+        builder.build();
+
+        builder = binaries().builder("SomeType2");
+
+        builder.setField("dateField", new Date());
+
+        builder.setField("objectField", new GridBinaryTestClasses.Company());
+
+        builder.build();
+
+    }
+
+    /**
+     *
+     */
+    public void testCorrectMetadataNullField2() {
+        BinaryObjectBuilder builder = binaries().builder("SomeType3");
+
+        builder.setField("dateField", null, Date.class);
+
+        builder.setField("objectField", null, GridBinaryTestClasses.Company.class);
+
+        BinaryObject obj = builder.build();
+
+        builder = binaries().builder(obj);
+
+        builder.setField("dateField", new Date());
+
+        builder.setField("objectField", new GridBinaryTestClasses.Company());
+
+        builder.build();
+    }
+
+    /**
+     *
+     */
     public void testDateInObjectField() {
         GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
@@ -1053,9 +1171,9 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
-        Date[] arr = { new Date() };
+        Date[] arr = {new Date()};
 
-        mutableObj.setField("foo", arr);
+        mutableObj.setField("foo", arr, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
 
@@ -1072,9 +1190,9 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
-        Timestamp[] arr = { new Timestamp(100020003) };
+        Timestamp[] arr = {new Timestamp(100020003)};
 
-        mutableObj.setField("foo", arr);
+        mutableObj.setField("foo", arr, Object.class);
 
         GridBinaryTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
 
@@ -1264,7 +1382,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         CacheObjectBinaryProcessorImpl processor = (CacheObjectBinaryProcessorImpl)(
             (IgniteBinaryImpl)binaries()).processor();
 
-        return new BinaryObjectBuilderImpl(processor.binaryContext(), processor.typeId(aCls.getName()), 
+        return new BinaryObjectBuilderImpl(processor.binaryContext(), processor.typeId(aCls.getName()),
             processor.binaryContext().userTypeName(aCls.getName()));
     }
 
@@ -1305,7 +1423,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         root.setField("linkedHashSet", linkedHashSet);
 
         root.setField("singletonList", Collections.singletonList(Integer.MAX_VALUE), Collection.class);
-        root.setField("singletonSet",  Collections.singleton(Integer.MAX_VALUE), Collection.class);
+        root.setField("singletonSet", Collections.singleton(Integer.MAX_VALUE), Collection.class);
 
         // maps
         root.setField("hashMap", hashMap);
@@ -1319,7 +1437,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         root.setField("asMap", Collections.singletonMap("key", "val"));
         root.setField("asListHint", Collections.singletonList(Integer.MAX_VALUE), List.class);
         root.setField("asSetHint", Collections.singleton(Integer.MAX_VALUE), Set.class);
-        root.setField("asMapHint", (AbstractMap) Collections.singletonMap("key", "val"), AbstractMap.class);
+        root.setField("asMapHint", (AbstractMap)Collections.singletonMap("key", "val"), AbstractMap.class);
 
         BinaryObject binaryObj = root.build();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/093623eb/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java
index 9659c39..4fc5c6c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderDefaultMappersSelfTest.java
@@ -146,7 +146,7 @@ public class BinaryObjectBuilderDefaultMappersSelfTest extends GridCommonAbstrac
 
         builder = builder(obj);
 
-        builder.setField("objField", "value");
+        builder.setField("objField", "value", Object.class);
         builder.setField("otherField", (Object)null);
 
         obj = builder.build();


[19/27] ignite git commit: Fix missed event notification in remove-remove case.

Posted by nt...@apache.org.
Fix missed event notification in remove-remove case.


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

Branch: refs/heads/ignite-2004
Commit: 35fd10d32a943c0cf5c9f0ddf901a15ef143a896
Parents: 9cd2f09
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Mar 28 16:31:39 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Mar 28 16:31:39 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  17 +-
 .../CacheContinuousQueryFactoryFilterTest.java  |   6 +-
 ...acheContinuousQueryRandomOperationsTest.java | 522 +++++++++++++++++--
 ...inuousQueryRandomOperationsTwoNodesTest.java |  28 +
 .../IgniteCacheQuerySelfTestSuite3.java         |   2 +
 6 files changed, 530 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index fb6aeef..c5df29b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2092,7 +2092,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                             null,
                             null,
                             false,
-                            updateCntr0 == null ? 0 : updateCntr0);
+                            0);
                     }
                 }
                 else

http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/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 e908c05..e8a2200 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
@@ -2115,7 +2115,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                                 "[entry=" + entry + ", filter=" + Arrays.toString(req.filter()) + ']');
                     }
                 }
-                else if (lsnrs != null && updRes.success()) {
+                else if (lsnrs != null && updRes.updateCounter() != 0) {
                     ctx.continuousQueries().onEntryUpdated(
                         lsnrs,
                         entry.key(),
@@ -2427,6 +2427,19 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                                 updRes.newTtl(),
                                 CU.EXPIRE_TIME_CALCULATE);
                     }
+                    else if (lsnrs != null && updRes.updateCounter() != 0) {
+                        ctx.continuousQueries().onEntryUpdated(
+                            lsnrs,
+                            entry.key(),
+                            updRes.newValue(),
+                            updRes.oldValue(),
+                            entry.isInternal() || !context().userCache(),
+                            entry.partition(),
+                            primary,
+                            false,
+                            updRes.updateCounter(),
+                            topVer);
+                    }
 
                     if (hasNear) {
                         if (primary) {
@@ -2868,7 +2881,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         if (updRes.removeVersion() != null)
                             ctx.onDeferredDelete(entry, updRes.removeVersion());
 
-                        if (lsnrs != null && updRes.success()) {
+                        if (lsnrs != null && updRes.updateCounter() != 0) {
                             ctx.continuousQueries().onEntryUpdated(
                                 lsnrs,
                                 entry.key(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterTest.java
index 6143fa9..55340d5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterTest.java
@@ -95,7 +95,7 @@ public class CacheContinuousQueryFactoryFilterTest extends CacheContinuousQueryR
             ONHEAP_TIERED,
             false);
 
-        final IgniteCache<Object, Object> cache = grid(0).getOrCreateCache(ccfg);
+        final IgniteCache<Object, Object> cache = grid(0).createCache(ccfg);
 
         UUID uuid = null;
 
@@ -128,12 +128,12 @@ public class CacheContinuousQueryFactoryFilterTest extends CacheContinuousQueryR
                 grid(0).context().cache().cache(cache.getName()).context().continuousQueries()
                     .cancelInternalQuery(uuid);
 
-            cache.destroy();
+            grid(0).destroyCache(ccfg.getName());
         }
     }
 
     /** {@inheritDoc} */
-    @Override protected void testContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
+    @Override protected void doTestContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
         throws Exception {
         ignite(0).createCache(ccfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
index cdf4ffd..b1316ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
@@ -31,12 +31,14 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 import javax.cache.Cache;
 import javax.cache.configuration.Factory;
 import javax.cache.event.CacheEntryEvent;
 import javax.cache.event.CacheEntryEventFilter;
 import javax.cache.event.CacheEntryListenerException;
 import javax.cache.event.CacheEntryUpdatedListener;
+import javax.cache.event.EventType;
 import javax.cache.integration.CacheLoaderException;
 import javax.cache.integration.CacheWriterException;
 import javax.cache.processor.EntryProcessor;
@@ -56,7 +58,10 @@ import org.apache.ignite.cache.store.CacheStore;
 import org.apache.ignite.cache.store.CacheStoreAdapter;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.PA;
 import org.apache.ignite.internal.util.typedef.internal.S;
+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.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -68,6 +73,8 @@ import org.apache.ignite.transactions.TransactionIsolation;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
+import static javax.cache.event.EventType.CREATED;
+import static javax.cache.event.EventType.REMOVED;
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -121,11 +128,11 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
     @Override protected void beforeTestsStarted() throws Exception {
         super.beforeTestsStarted();
 
-        startGridsMultiThreaded(NODES - 1);
+        startGridsMultiThreaded(getServerNodeCount());
 
         client = true;
 
-        startGrid(NODES - 1);
+        startGrid(getServerNodeCount());
     }
 
     /** {@inheritDoc} */
@@ -190,7 +197,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -203,7 +210,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -216,7 +223,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -229,7 +236,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -242,7 +249,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -255,7 +262,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -268,7 +275,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -281,7 +288,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -294,7 +301,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -307,7 +314,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -320,7 +327,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -333,7 +340,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -346,7 +353,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -359,7 +366,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -372,7 +379,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -385,7 +392,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -398,7 +405,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -411,7 +418,411 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomicWithoutBackup() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            0,
+            ATOMIC,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomicWithoutBackupWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            0,
+            ATOMIC,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomic() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            1,
+            ATOMIC,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomicWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            1,
+            ATOMIC,
+            ONHEAP_TIERED,
+            true);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomicOffheap() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            0,
+            ATOMIC,
+            OFFHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveAtomicOffheapWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            0,
+            ATOMIC,
+            OFFHEAP_TIERED,
+            true);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveTx() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            1,
+            TRANSACTIONAL,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveTxWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            1,
+            TRANSACTIONAL,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveReplicatedTx() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+            0,
+            TRANSACTIONAL,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveReplicatedTxWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+            0,
+            TRANSACTIONAL,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveReplicatedAtomic() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+            0,
+            ATOMIC,
+            ONHEAP_TIERED,
+            false);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemoveReplicatedAtomicWithStore() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+            0,
+            ATOMIC,
+            ONHEAP_TIERED,
+            true);
+
+        doTestNotModifyOperation(ccfg);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void doTestNotModifyOperation(CacheConfiguration ccfg) throws Exception {
+        singleOperation(ccfg);
+        batchOperation(ccfg);
+    }
+
+    /**
+     * @param ccfg Cache configuration.
+     * @throws Exception If failed.
+     */
+    private void singleOperation(CacheConfiguration ccfg) throws Exception {
+        IgniteCache<QueryTestKey, QueryTestValue> cache = grid(getClientIndex()).createCache(ccfg);
+
+        try {
+            ContinuousQuery<QueryTestKey, QueryTestValue> qry = new ContinuousQuery<>();
+
+            final List<CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> evts =
+                new CopyOnWriteArrayList<>();
+
+            qry.setLocalListener(new CacheEntryUpdatedListener<QueryTestKey, QueryTestValue>() {
+                @Override public void onUpdated(Iterable<CacheEntryEvent<? extends QueryTestKey,
+                    ? extends QueryTestValue>> events) throws CacheEntryListenerException {
+                    for (CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e : events)
+                        evts.add(e);
+                }
+            });
+
+            QueryTestKey key = new QueryTestKey(1);
+
+            try (QueryCursor qryCur = cache.query(qry)) {
+                for (int i = 0; i < ITERATION_CNT; i++) {
+                    log.info("Start iteration: " + i);
+                    // Not events.
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+
+                    // Get events.
+                    cache.put(key, new QueryTestValue(1));
+                    cache.remove(key);
+
+                    // Not events.
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(null, false));
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(null, false));
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+                    cache.remove(key);
+
+                    // Get events.
+                    cache.put(key, new QueryTestValue(2));
+
+                    // Not events.
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+
+                    // Get events.
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(null, false));
+
+                    // Not events.
+                    cache.remove(key);
+
+                    // Get events.
+                    cache.put(key, new QueryTestValue(3));
+                    cache.put(key, new QueryTestValue(4));
+
+                    // Not events.
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+                    cache.putIfAbsent(key, new QueryTestValue(5));
+                    cache.putIfAbsent(key, new QueryTestValue(5));
+                    cache.putIfAbsent(key, new QueryTestValue(5));
+                    cache.invoke(key, (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+                    cache.remove(key, new QueryTestValue(5));
+
+                    // Get events.
+                    cache.remove(key, new QueryTestValue(4));
+                    cache.putIfAbsent(key, new QueryTestValue(5));
+
+                    // Not events.
+                    cache.replace(key, new QueryTestValue(3), new QueryTestValue(2));
+                    cache.replace(key, new QueryTestValue(3), new QueryTestValue(2));
+                    cache.replace(key, new QueryTestValue(3), new QueryTestValue(2));
+
+                    // Get events.
+                    cache.replace(key, new QueryTestValue(5), new QueryTestValue(6));
+
+                    assert GridTestUtils.waitForCondition(new PA() {
+                        @Override public boolean apply() {
+                            return evts.size() == 9;
+                        }
+                    }, 5_000);
+
+                    checkSingleEvent(evts.get(0), CREATED, new QueryTestValue(1), null);
+                    checkSingleEvent(evts.get(1), REMOVED, null, new QueryTestValue(1));
+                    checkSingleEvent(evts.get(2), CREATED, new QueryTestValue(2), null);
+                    checkSingleEvent(evts.get(3), REMOVED, null, new QueryTestValue(2));
+                    checkSingleEvent(evts.get(4), CREATED, new QueryTestValue(3), null);
+                    checkSingleEvent(evts.get(5), EventType.UPDATED, new QueryTestValue(4), new QueryTestValue(3));
+                    checkSingleEvent(evts.get(6), REMOVED, null, new QueryTestValue(4));
+                    checkSingleEvent(evts.get(7), CREATED, new QueryTestValue(5), null);
+                    checkSingleEvent(evts.get(8), EventType.UPDATED, new QueryTestValue(6), new QueryTestValue(5));
+
+                    cache.remove(key);
+                    cache.remove(key);
+
+                    evts.clear();
+
+                    log.info("Finish iteration: " + i);
+                }
+            }
+        }
+        finally {
+            grid(getClientIndex()).destroyCache(ccfg.getName());
+        }
+    }
+
+    /**
+     * @param ccfg Cache configuration.
+     * @throws Exception If failed.
+     */
+    private void batchOperation(CacheConfiguration ccfg) throws Exception {
+        IgniteCache<QueryTestKey, QueryTestValue> cache = grid(getClientIndex()).createCache(ccfg);
+
+        try {
+            ContinuousQuery<QueryTestKey, QueryTestValue> qry = new ContinuousQuery<>();
+
+            final List<CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> evts =
+                new CopyOnWriteArrayList<>();
+
+            qry.setLocalListener(new CacheEntryUpdatedListener<QueryTestKey, QueryTestValue>() {
+                @Override public void onUpdated(Iterable<CacheEntryEvent<? extends QueryTestKey,
+                    ? extends QueryTestValue>> events) throws CacheEntryListenerException {
+                    for (CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e : events)
+                        evts.add(e);
+                }
+            });
+
+            Map<QueryTestKey, QueryTestValue> map = new TreeMap<>();
+
+            for (int i = 0; i < KEYS; i++)
+                map.put(new QueryTestKey(i), new QueryTestValue(i));
+
+            try (QueryCursor qryCur = cache.query(qry)) {
+                for (int i = 0; i < ITERATION_CNT / 2; i++) {
+                    log.info("Start iteration: " + i);
+                    // Not events.
+                    cache.removeAll(map.keySet());
+                    cache.invokeAll(map.keySet(), (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(null, false));
+                    cache.invokeAll(map.keySet(), (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+
+                    // Get events.
+                    cache.putAll(map);
+
+                    assert GridTestUtils.waitForCondition(new PA() {
+                        @Override public boolean apply() {
+                            return evts.size() == KEYS;
+                        }
+                    }, 5_000);
+
+                    checkEvents(evts, CREATED);
+
+                    evts.clear();
+
+                    // Not events.
+                    cache.invokeAll(map.keySet(), (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(true));
+
+                    U.sleep(100);
+
+                    assertEquals(0, evts.size());
+
+                    // Get events.
+                    cache.invokeAll(map.keySet(), (EntryProcessor<QueryTestKey, QueryTestValue, ? extends Object>)
+                        (Object)new EntrySetValueProcessor(null, false));
+
+                    // Not events.
+                    cache.removeAll(map.keySet());
+                    cache.removeAll(map.keySet());
+
+                    assert GridTestUtils.waitForCondition(new PA() {
+                        @Override public boolean apply() {
+                            return evts.size() == KEYS;
+                        }
+                    }, 5_000);
+
+                    checkEvents(evts, REMOVED);
+
+                    evts.clear();
+
+                    log.info("Finish iteration: " + i);
+                }
+            }
+        }
+        finally {
+            grid(getClientIndex()).destroyCache(ccfg.getName());
+        }
+    }
+
+    /**
+     * @param evts Events.
+     * @param evtType Event type.
+     */
+    private void checkEvents(List<CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> evts,
+        EventType evtType) {
+        for (int key = 0; key < KEYS; key++) {
+            QueryTestKey keyVal = new QueryTestKey(key);
+
+            for (CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e : evts) {
+                if (e.getKey().equals(keyVal)) {
+                    checkSingleEvent(e,
+                        evtType,
+                        evtType == CREATED ? new QueryTestValue(key) : null,
+                        evtType == REMOVED ? new QueryTestValue(key) : null);
+
+                    keyVal = null;
+
+                    break;
+                }
+            }
+
+            assertNull("Event for key not found.", keyVal);
+        }
+    }
+
+
+    /**
+     * @param event Event.
+     * @param type Event type.
+     * @param val Value.
+     * @param oldVal Old value.
+     */
+    private void checkSingleEvent(
+        CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> event,
+        EventType type,
+        QueryTestValue val,
+        QueryTestValue oldVal) {
+        assertEquals(event.getEventType(), type);
+        assertEquals(event.getValue(), val);
+        assertEquals(event.getOldValue(), oldVal);
     }
 
     /**
@@ -424,7 +835,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -437,7 +848,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -450,7 +861,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -463,7 +874,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -476,7 +887,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -489,7 +900,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -502,7 +913,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -515,7 +926,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_VALUES,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -528,7 +939,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -541,7 +952,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -554,7 +965,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -567,7 +978,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             OFFHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -580,7 +991,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -593,7 +1004,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, ALL);
+        doTestContinuousQuery(ccfg, ALL);
     }
 
     /**
@@ -606,7 +1017,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, SERVER);
+        doTestContinuousQuery(ccfg, SERVER);
     }
 
     /**
@@ -619,7 +1030,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
             ONHEAP_TIERED,
             false);
 
-        testContinuousQuery(ccfg, CLIENT);
+        doTestContinuousQuery(ccfg, CLIENT);
     }
 
     /**
@@ -627,7 +1038,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
      * @param deploy The place where continuous query will be started.
      * @throws Exception If failed.
      */
-    protected void testContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
+    protected void doTestContinuousQuery(CacheConfiguration<Object, Object> ccfg, ContinuousDeploy deploy)
         throws Exception {
         ignite(0).createCache(ccfg);
 
@@ -656,7 +1067,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
 
                 evtsQueues.add(evtsQueue);
 
-                QueryCursor<?> cur = grid(NODES - 1).cache(ccfg.getName()).query(qry);
+                QueryCursor<?> cur = grid(getClientIndex()).cache(ccfg.getName()).query(qry);
 
                 curs.add(cur);
             }
@@ -674,12 +1085,12 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
 
                 evtsQueues.add(evtsQueue);
 
-                QueryCursor<?> cur = grid(rnd.nextInt(NODES - 1)).cache(ccfg.getName()).query(qry);
+                QueryCursor<?> cur = grid(rnd.nextInt(getServerNodeCount())).cache(ccfg.getName()).query(qry);
 
                 curs.add(cur);
             }
             else {
-                for (int i = 0; i < NODES - 1; i++) {
+                for (int i = 0; i <= getServerNodeCount(); i++) {
                     ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
 
                     final BlockingQueue<CacheEntryEvent<?, ?>> evtsQueue = new ArrayBlockingQueue<>(50_000);
@@ -708,7 +1119,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
                     if (i % 20 == 0)
                         log.info("Iteration: " + i);
 
-                    for (int idx = 0; idx < NODES; idx++)
+                    for (int idx = 0; idx < getServerNodeCount(); idx++)
                         randomUpdate(rnd, evtsQueues, expData, partCntr, grid(idx).cache(ccfg.getName()));
                 }
             }
@@ -723,6 +1134,20 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
     }
 
     /**
+     * @return Client node index.
+     */
+    private int getClientIndex() {
+        return getServerNodeCount() - 1;
+    }
+
+    /**
+     * @return Count nodes.
+     */
+    protected int getServerNodeCount() {
+        return NODES;
+    }
+
+    /**
      * @param rnd Random generator.
      * @param evtsQueues Events queue.
      * @param expData Expected cache data.
@@ -1272,9 +1697,11 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
      */
     public static class QueryTestValue implements Serializable {
         /** */
+        @GridToStringInclude
         protected final Integer val1;
 
         /** */
+        @GridToStringInclude
         protected final String val2;
 
         /**
@@ -1323,6 +1750,16 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
         /** */
         private boolean retOld;
 
+        /** */
+        private boolean skipModify;
+
+        /**
+         * @param skipModify If {@code true} then entry will not be modified.
+         */
+        public EntrySetValueProcessor(boolean skipModify) {
+            this.skipModify = skipModify;
+        }
+
         /**
          * @param val Value to set.
          * @param retOld Return old value flag.
@@ -1334,6 +1771,9 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
 
         /** {@inheritDoc} */
         @Override public Object process(MutableEntry<Object, Object> e, Object... args) {
+            if (skipModify)
+                return null;
+
             Object old = retOld ? e.getValue() : null;
 
             if (val != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTwoNodesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTwoNodesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTwoNodesTest.java
new file mode 100644
index 0000000..ebb7861
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTwoNodesTest.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.cache.query.continuous;
+
+/**
+ *
+ */
+public class CacheContinuousQueryRandomOperationsTwoNodesTest extends CacheContinuousQueryRandomOperationsTest {
+    /** {@inheritDoc} */
+    @Override protected int getServerNodeCount() {
+        return 1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/35fd10d3/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index 3487421..b2cb50b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinu
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTwoNodesTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
@@ -106,6 +107,7 @@ public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
         suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
         suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
         suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
+        suite.addTestSuite(CacheContinuousQueryRandomOperationsTwoNodesTest.class);
         suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);
         suite.addTestSuite(GridCacheContinuousQueryConcurrentTest.class);
         suite.addTestSuite(CacheContinuousQueryOperationP2PTest.class);


[24/27] ignite git commit: IGNITE-2550: .NET: Simplified examples configuration. This closes #570.

Posted by nt...@apache.org.
IGNITE-2550: .NET: Simplified examples configuration. This closes #570.


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

Branch: refs/heads/ignite-2004
Commit: fc34e51a265e73675ff8768526c9f22c9cd9b6fb
Parents: f17b2ae
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Tue Mar 29 10:04:30 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Mar 29 10:04:30 2016 +0300

----------------------------------------------------------------------
 modules/platforms/dotnet/Apache.Ignite.sln      |   5 +-
 .../Compute/ClosureExample.cs                   |   4 +-
 .../Compute/TaskExample.cs                      |   4 +-
 .../Datagrid/ContinuousQueryExample.cs          |  11 +-
 .../Datagrid/DataStreamerExample.cs             |   8 +-
 .../Datagrid/PutGetExample.cs                   |   6 +-
 .../Datagrid/QueryExample.cs                    |  20 +++-
 .../Datagrid/StoreExample.cs                    |  16 ++-
 .../Datagrid/TransactionExample.cs              |  14 ++-
 .../Events/EventsExample.cs                     |   6 +-
 .../Messaging/MessagingExample.cs               |   4 +-
 .../Misc/LifecycleExample.cs                    |   2 +-
 .../Services/ServicesExample.cs                 |   6 +-
 .../Apache.Ignite.ExamplesDll.csproj            |   1 +
 .../Apache.Ignite.ExamplesDll/Binary/Account.cs |   1 -
 .../Apache.Ignite.ExamplesDll/Binary/Address.cs |   5 +-
 .../Binary/Employee.cs                          |   4 +
 .../Binary/EmployeeKey.cs                       |   4 +-
 .../Binary/Organization.cs                      |  11 +-
 .../Binary/OrganizationType.cs                  |   3 -
 .../Datagrid/EmployeeStoreFactory.cs            |  38 ++++++
 .../examples/Config/example-cache-query.xml     | 118 -------------------
 .../examples/Config/example-cache-store.xml     |  59 ----------
 .../dotnet/examples/Config/example-cache.xml    |  87 --------------
 .../dotnet/examples/Config/example-compute.xml  |  70 -----------
 .../dotnet/examples/Config/examples-config.xml  |  98 +++++++++++++++
 26 files changed, 217 insertions(+), 388 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index a28d714..12fd82b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -28,10 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		Apache.Ignite.sln.TeamCity.DotSettings = Apache.Ignite.sln.TeamCity.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
+		examples\Config\examples-config.xml = examples\Config\examples-config.xml
 		README.txt = README.txt
 	EndProjectSection
 EndProject

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
index e1194f8..7675b7e 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
@@ -34,7 +34,7 @@ namespace Apache.Ignite.Examples.Compute
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class ClosureExample
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Compute
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
             

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
index f0bcf13..7934e82 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
@@ -35,7 +35,7 @@ namespace Apache.Ignite.Examples.Compute
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class TaskExample
@@ -48,7 +48,7 @@ namespace Apache.Ignite.Examples.Compute
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
index 8dad1f4..b253b3f 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
@@ -36,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class ContinuousQueryExample
     {
+        /// <summary>Cache name.</summary>
+        private const string CacheName = "dotnet_cache_continuous_query";
+
         /// <summary>
         /// Runs the example.
         /// </summary>
@@ -49,8 +52,8 @@ namespace Apache.Ignite.Examples.Datagrid
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))
@@ -58,7 +61,7 @@ namespace Apache.Ignite.Examples.Datagrid
                 Console.WriteLine();
                 Console.WriteLine(">>> Cache continuous query example started.");
 
-                var cache = ignite.GetOrCreateCache<int, string>("cache_continuous_query");
+                var cache = ignite.GetOrCreateCache<int, string>(CacheName);
 
                 // Clean up caches on all nodes before run.
                 cache.Clear();

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
index 08a670f..9315f02 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
@@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class DataStreamerExample
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Datagrid
         private const int EntryCount = 500000;
 
         /// <summary>Cache name.</summary>
-        private const string CacheName = "cache_data_streamer";
+        private const string CacheName = "dotnet_cache_data_streamer";
 
         /// <summary>
         /// Runs the example.
@@ -57,8 +57,8 @@ namespace Apache.Ignite.Examples.Datagrid
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
index e2502e8..7d5ade6 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
@@ -38,13 +38,13 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class PutGetExample
     {
         /// <summary>Cache name.</summary>
-        private const string CacheName = "cache_put_get";
+        private const string CacheName = "dotnet_cache_put_get";
 
         /// <summary>
         /// Runs the example.
@@ -54,7 +54,7 @@ namespace Apache.Ignite.Examples.Datagrid
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
index 809eb65..c9166b2 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
@@ -24,6 +24,7 @@ using Apache.Ignite.Core.Cache.Query;
 
 namespace Apache.Ignite.Examples.Datagrid
 {
+    using Apache.Ignite.Core.Cache.Configuration;
     using Apache.Ignite.ExamplesDll.Binary;
 
     /// <summary>
@@ -38,17 +39,20 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-query.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class QueryExample
     {
+        /// <summary>Cache name.</summary>
+        private const string CacheName = "dotnet_cache_query";
+
         [STAThread]
         public static void Main()
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-query.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
@@ -57,7 +61,15 @@ namespace Apache.Ignite.Examples.Datagrid
                 Console.WriteLine();
                 Console.WriteLine(">>> Cache query example started.");
 
-                var cache = ignite.GetCache<object, object>(null);
+                var cache = ignite.GetOrCreateCache<object, object>(new CacheConfiguration
+                {
+                    Name = CacheName,
+                    QueryEntities = new[]
+                    {
+                        new QueryEntity(typeof(int), typeof(Organization)),
+                        new QueryEntity(typeof(EmployeeKey), typeof(Employee))
+                    }
+                });
 
                 // Clean up caches on all nodes before run.
                 cache.Clear();
@@ -66,7 +78,7 @@ namespace Apache.Ignite.Examples.Datagrid
                 PopulateCache(cache);
 
                 // Create cache that will work with specific types.
-                var employeeCache = ignite.GetCache<EmployeeKey, Employee>(null);
+                var employeeCache = ignite.GetCache<EmployeeKey, Employee>(CacheName);
 
                 // Run SQL query example.
                 SqlQueryExample(employeeCache);

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
index 1654b41..e3ccecc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
@@ -22,6 +22,7 @@ using Apache.Ignite.ExamplesDll.Datagrid;
 
 namespace Apache.Ignite.Examples.Datagrid
 {
+    using Apache.Ignite.Core.Cache.Configuration;
     using Apache.Ignite.ExamplesDll.Binary;
 
     /// <summary>
@@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-store.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     class StoreExample
     {
+        /// <summary>Cache name.</summary>
+        private const string CacheName = "dotnet_cache_with_store";
+
         /// <summary>
         /// Runs the example.
         /// </summary>
@@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-store.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
@@ -57,7 +61,13 @@ namespace Apache.Ignite.Examples.Datagrid
                 Console.WriteLine();
                 Console.WriteLine(">>> Cache store example started.");
 
-                var cache = ignite.GetCache<int, Employee>(null);
+                var cache = ignite.GetOrCreateCache<int, Employee>(new CacheConfiguration
+                {
+                    Name = CacheName,
+                    ReadThrough = true,
+                    WriteThrough = true,
+                    CacheStoreFactory = new EmployeeStoreFactory()
+                });
 
                 // Clean up caches on all nodes before run.
                 cache.Clear();

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
index e814f8c..2aa5fd7 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
@@ -22,6 +22,7 @@ using Apache.Ignite.Core.Transactions;
 
 namespace Apache.Ignite.Examples.Datagrid
 {
+    using Apache.Ignite.Core.Cache.Configuration;
     using Apache.Ignite.ExamplesDll.Binary;
 
     /// <summary>
@@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     class TransactionExample
     {
+        /// <summary>Cache name.</summary>
+        private const string CacheName = "dotnet_cache_tx";
+
         /// <summary>
         /// Runs the example.
         /// </summary>
@@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
@@ -57,7 +61,11 @@ namespace Apache.Ignite.Examples.Datagrid
                 Console.WriteLine();
                 Console.WriteLine(">>> Transaction example started.");
 
-                var cache = ignite.GetCache<int, Account>("tx");
+                var cache = ignite.GetOrCreateCache<int, Account>(new CacheConfiguration
+                {
+                    Name = CacheName,
+                    AtomicityMode = CacheAtomicityMode.Transactional
+                });
 
                 // Clean up caches on all nodes before run.
                 cache.Clear();

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
index 3b068e8..f571db5 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
@@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Events
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class EventsExample
@@ -51,8 +51,8 @@ namespace Apache.Ignite.Examples.Events
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
index 6438b95..0c94a7b 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
@@ -29,7 +29,7 @@ namespace Apache.Ignite.Examples.Messaging
     /// 1) Build the project Apache.Ignite.ExamplesDll (select it -> right-click -> Build).
     ///    Apache.Ignite.ExamplesDll.dll must appear in %IGNITE_HOME%/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/bin/${Platform]/${Configuration} folder;
     /// 2) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 3) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties ->
     ///     Application -> Startup object);
     /// 4) Start example (F5 or Ctrl+F5).
@@ -44,7 +44,7 @@ namespace Apache.Ignite.Examples.Messaging
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
index bba6719..3dc5820 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
@@ -50,7 +50,7 @@ namespace Apache.Ignite.Examples.Misc
 
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
                 JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" },
                 LifecycleBeans = new List<ILifecycleBean> { lifecycleExampleBean }
             };

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
index e57774c..c6c71dd 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
@@ -33,7 +33,7 @@ namespace Apache.Ignite.Examples.Services
     /// <para />
     /// This example can be run with standalone Apache Ignite.NET node:
     /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
-    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+    /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
     /// 2) Start example.
     /// </summary>
     public class ServicesExample
@@ -46,8 +46,8 @@ namespace Apache.Ignite.Examples.Services
         {
             var cfg = new IgniteConfiguration
             {
-                SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
-                JvmOptions = new List<string> {"-Xms512m", "-Xmx512m"}
+                SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+                JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
             };
 
             using (var ignite = Ignition.Start(cfg))

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
index ccbdf4b..1cf729b 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
@@ -55,6 +55,7 @@
     <Compile Include="Compute\AverageSalaryTask.cs" />
     <Compile Include="Compute\CharacterCountClosure.cs" />
     <Compile Include="Compute\CharacterCountReducer.cs" />
+    <Compile Include="Datagrid\EmployeeStoreFactory.cs" />
     <Compile Include="Datagrid\EmployeeStorePredicate.cs" />
     <Compile Include="Datagrid\ContinuousQueryFilter.cs" />
     <Compile Include="Datagrid\EmployeeStore.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
index f51c3c2..4d3fc35 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
@@ -22,7 +22,6 @@ namespace Apache.Ignite.ExamplesDll.Binary
     /// <summary>
     /// Account object. Used in transaction example.
     /// </summary>
-    [Serializable]
     public class Account
     {
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
index 0490f24..bb6ed7f 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
@@ -19,6 +19,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
 {
     using System;
     using Apache.Ignite.Core.Binary;
+    using Apache.Ignite.Core.Cache.Configuration;
 
     /// <summary>
     /// Address.
@@ -36,15 +37,17 @@ namespace Apache.Ignite.ExamplesDll.Binary
             Street = street;
             Zip = zip;
         }
-        
+
         /// <summary>
         /// Street.
         /// </summary>
+        [QueryTextField]
         public string Street { get; set; }
 
         /// <summary>
         /// ZIP code.
         /// </summary>
+        [QuerySqlField(IsIndexed = true)]
         public int Zip { get; set; }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
index 7d0af08..44a3f11 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
@@ -20,6 +20,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
     using System;
     using System.Collections.Generic;
     using System.Linq;
+    using Apache.Ignite.Core.Cache.Configuration;
 
     /// <summary>
     /// Employee.
@@ -45,16 +46,19 @@ namespace Apache.Ignite.ExamplesDll.Binary
         /// <summary>
         /// Name.
         /// </summary>
+        [QuerySqlField]
         public string Name { get; set; }
 
         /// <summary>
         /// Salary.
         /// </summary>
+        [QuerySqlField]
         public long Salary { get; set; }
 
         /// <summary>
         /// Address.
         /// </summary>
+        [QuerySqlField]
         public Address Address { get; set; }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
index 16e5469..9c1d8cc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
@@ -17,13 +17,12 @@
 
 namespace Apache.Ignite.ExamplesDll.Binary
 {
-    using System;
     using Apache.Ignite.Core.Cache.Affinity;
+    using Apache.Ignite.Core.Cache.Configuration;
 
     /// <summary>
     /// Employee key. Used in query example to co-locate employees with their organizations.
     /// </summary>
-    [Serializable]
     public class EmployeeKey
     {
         /// <summary>
@@ -46,6 +45,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
         /// Organization ID.
         /// </summary>
         [AffinityKeyMapped]
+        [QuerySqlField(IsIndexed = true)]
         public int OrganizationId { get; private set; }
         
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
index 060966a..16d4113 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
@@ -18,22 +18,14 @@
 namespace Apache.Ignite.ExamplesDll.Binary
 {
     using System;
+    using Apache.Ignite.Core.Cache.Configuration;
 
     /// <summary>
     /// Organization.
     /// </summary>
-    [Serializable]
     public class Organization
     {
         /// <summary>
-        /// Default constructor.
-        /// </summary>
-        public Organization()
-        {
-            // No-op.
-        }
-
-        /// <summary>
         /// Constructor.
         /// </summary>
         /// <param name="name">Name.</param>
@@ -51,6 +43,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
         /// <summary>
         /// Name.
         /// </summary>
+        [QuerySqlField(IsIndexed = true)]
         public string Name { get; set; }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
index 9ff0c3a..098fab9 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
@@ -17,12 +17,9 @@
 
 namespace Apache.Ignite.ExamplesDll.Binary
 {
-    using System;
-
     /// <summary>
     /// Organization type.
     /// </summary>
-    [Serializable]
     public enum OrganizationType
     {
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
new file mode 100644
index 0000000..643fc44
--- /dev/null
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
@@ -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.
+ */
+
+namespace Apache.Ignite.ExamplesDll.Datagrid
+{
+    using System;
+    using Apache.Ignite.Core.Cache.Store;
+    using Apache.Ignite.Core.Common;
+
+    /// <summary>
+    /// Employee store factory.
+    /// </summary>
+    [Serializable]
+    public class EmployeeStoreFactory : IFactory<ICacheStore>
+    {
+        /// <summary>
+        /// Creates an instance of the cache store.
+        /// </summary>
+        public ICacheStore CreateInstance()
+        {
+            return new EmployeeStore();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-query.xml b/modules/platforms/dotnet/examples/Config/example-cache-query.xml
deleted file mode 100644
index 5bc9399..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache-query.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        
-        <property name="platformConfiguration">
-            <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
-                <property name="binaryConfiguration">
-                    <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
-                        <property name="types">
-                            <list>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
-                            </list>
-                        </property>
-                        <property name="typesConfiguration">
-                            <list>
-                                <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
-                                    <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
-                                    <property name="enum" value="true" />
-                                </bean>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-
-        <!-- Cache configurations (all properties are optional). -->
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="backups" value="1"/>
-
-                    <!-- Configure type metadata to enable queries. -->
-                    <property name="typeMetadata">
-                        <list>
-                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="keyType" value="java.lang.Integer"/>
-                                <property name="valueType" value="Organization"/>
-                                <property name="ascendingFields">
-                                    <map>
-                                        <entry key="name" value="java.lang.String"/>
-                                    </map>
-                                </property>
-                            </bean>
-                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="keyType" value="EmployeeKey"/>
-                                <property name="valueType" value="Employee"/>
-                                <property name="ascendingFields">
-                                    <map>
-                                        <entry key="organizationId" value="java.lang.Integer"/>
-                                        <entry key="address.zip" value="java.lang.Integer"/>
-                                    </map>
-                                </property>
-                                <property name="queryFields">
-                                    <map>
-                                        <entry key="name" value="java.lang.String"/>
-                                        <entry key="salary" value="java.lang.Long"/>
-                                    </map>
-                                </property>
-                                <property name="textFields">
-                                    <list>
-                                        <value>address.street</value>
-                                    </list>
-                                </property>
-                            </bean>
-                        </list>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-store.xml b/modules/platforms/dotnet/examples/Config/example-cache-store.xml
deleted file mode 100644
index 2c20531..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache-store.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="writeThrough" value="true"/>
-                    <property name="readThrough" value="true"/>
-                    <property name="cacheStoreFactory">
-                        <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="typeName" value="Apache.Ignite.ExamplesDll.Datagrid.EmployeeStore, Apache.Ignite.ExamplesDll"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache.xml b/modules/platforms/dotnet/examples/Config/example-cache.xml
deleted file mode 100644
index 949f3a4..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <property name="platformConfiguration">
-            <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
-                <property name="binaryConfiguration">
-                    <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
-                        <property name="types">
-                            <list>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
-                                <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
-                            </list>
-                        </property>
-                        <property name="typesConfiguration">
-                            <list>
-                                <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
-                                    <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
-                                    <property name="enum" value="true" />
-                                </bean>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="cache*"/>
-                    <property name="atomicityMode" value="ATOMIC"/>
-                    <property name="backups" value="1"/>
-                </bean>
-
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="tx"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="backups" value="1"/>
-                </bean>
-            </list>
-        </property>
-
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-compute.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-compute.xml b/modules/platforms/dotnet/examples/Config/example-compute.xml
deleted file mode 100644
index bbc6550..0000000
--- a/modules/platforms/dotnet/examples/Config/example-compute.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="
-        http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util
-        http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
-        <property name="discoverySpi">
-            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
-                <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
-                        <property name="addresses">
-                            <list>
-                                <!-- In distributed environment, replace with actual host IP address. -->
-                                <value>127.0.0.1:47500..47501</value>
-                            </list>
-                        </property>
-                    </bean>
-                </property>
-            </bean>
-        </property>
-		
-        <!-- Enable task execution events for examples. -->
-        <property name="includeEventTypes">
-            <list>
-                <!-- Task execution events -->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
-                
-                <!-- Job execution events -->
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_RESULTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_STARTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FINISHED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_QUEUED"/>
-                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/>
-            </list>
-        </property>		
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/examples-config.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/examples-config.xml b/modules/platforms/dotnet/examples/Config/examples-config.xml
new file mode 100644
index 0000000..04e6a26
--- /dev/null
+++ b/modules/platforms/dotnet/examples/Config/examples-config.xml
@@ -0,0 +1,98 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+
+        <!-- Configure binarizable types. -->
+        <property name="platformConfiguration">
+            <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
+                <property name="binaryConfiguration">
+                    <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
+                        <property name="types">
+                            <list>
+                                <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
+                                <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
+                                <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
+                                <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
+                                <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
+                            </list>
+                        </property>
+                        <property name="typesConfiguration">
+                            <list>
+                                <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
+                                    <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
+                                    <property name="enum" value="true" />
+                                </bean>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+
+
+        <!-- Enable task execution events for examples. -->
+        <property name="includeEventTypes">
+            <list>
+                <!-- Task execution events -->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
+                
+                <!-- Job execution events -->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_RESULTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_STARTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FINISHED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_QUEUED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/>
+            </list>
+        </property>		
+    </bean>
+</beans>