You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/14 06:28:23 UTC
[01/50] [abbrv] ignite git commit: .NET: Remove FairAffinityFunction
Repository: ignite
Updated Branches:
refs/heads/master 7e106cd09 -> 922b2582d
.NET: Remove FairAffinityFunction
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b62d4464
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b62d4464
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b62d4464
Branch: refs/heads/master
Commit: b62d44646b93049a3795780ff5eaf7af070d3d9b
Parents: 3eb05de
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Apr 11 13:28:14 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Apr 11 13:28:14 2017 +0300
----------------------------------------------------------------------
.../utils/PlatformConfigurationUtils.java | 3 +-
.../Affinity/AffinityFunctionSpringTest.cs | 6 +-
.../Cache/Affinity/AffinityFunctionTest.cs | 92 +-------------------
.../Cache/CacheConfigurationTest.cs | 23 +----
.../Config/Cache/Affinity/affinity-function.xml | 4 +-
.../IgniteConfigurationSerializerTest.cs | 8 +-
.../IgniteConfigurationTest.cs | 2 -
.../Apache.Ignite.Core.csproj | 2 -
.../Cache/Affinity/Fair/FairAffinityFunction.cs | 32 -------
.../Cache/Affinity/Fair/Package-Info.cs | 26 ------
.../Cache/Affinity/IAffinityFunction.cs | 3 +-
.../Cache/Configuration/CacheConfiguration.cs | 81 +----------------
.../IgniteConfigurationSection.xsd | 29 ------
.../Affinity/AffinityFunctionSerializer.cs | 18 +---
14 files changed, 14 insertions(+), 315 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
index 9c67b56..17a5a16 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
@@ -180,8 +180,7 @@ public class PlatformConfigurationUtils {
if (qryEntCnt > 0) {
Collection<QueryEntity> entities = new ArrayList<>(qryEntCnt);
- for (int i
- = 0; i < qryEntCnt; i++)
+ for (int i = 0; i < qryEntCnt; i++)
entities.add(readQueryEntity(in));
ccfg.setQueryEntities(entities);
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionSpringTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionSpringTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionSpringTest.cs
index 48c5814..de4d2ec 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionSpringTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionSpringTest.cs
@@ -24,7 +24,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
using System.Linq;
using Apache.Ignite.Core.Cache;
using Apache.Ignite.Core.Cache.Affinity;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
+ using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cluster;
using Apache.Ignite.Core.Resource;
using NUnit.Framework;
@@ -117,7 +117,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
var longKey = (long)key;
int res;
- if (TestFairFunc.PredefinedParts.TryGetValue(longKey, out res))
+ if (TestRendezvousFunc.PredefinedParts.TryGetValue(longKey, out res))
return res;
return (int)(longKey * 2 % 5);
@@ -135,7 +135,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
}
}
- private class TestFairFunc : FairAffinityFunction // [Serializable] is not necessary
+ private class TestRendezvousFunc : RendezvousAffinityFunction // [Serializable] is not necessary
{
public static readonly Dictionary<long, int> PredefinedParts = new Dictionary<long, int>
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
index a3e6252..91ff7e0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFunctionTest.cs
@@ -24,7 +24,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
using System.Threading;
using Apache.Ignite.Core.Cache;
using Apache.Ignite.Core.Cache.Affinity;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cluster;
@@ -47,9 +46,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
private const string CacheName = "cache";
/** */
- private const string CacheNameFair = "cacheFair";
-
- /** */
private const string CacheNameRendezvous = "cacheRendezvous";
/** */
@@ -77,10 +73,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
AffinityFunction = new SimpleAffinityFunction(),
Backups = 7
},
- new CacheConfiguration(CacheNameFair)
- {
- AffinityFunction = new FairAffinityFunctionEx {Foo = 25}
- },
new CacheConfiguration(CacheNameRendezvous)
{
AffinityFunction = new RendezvousAffinityFunctionEx {Bar = "test"}
@@ -175,11 +167,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
new CacheConfiguration("rendezvousPredefined")
{
AffinityFunction = new RendezvousAffinityFunction {Partitions = 1234}
- },
- new CacheConfiguration("fairPredefined")
- {
- AffinityFunction = new FairAffinityFunction {Partitions = 1234}
- },
+ }
}.Select(_ignite.CreateCache<int, int>);
foreach (var cache in caches)
@@ -249,42 +237,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
}
/// <summary>
- /// Tests customized fair affinity.
- /// </summary>
- [Test]
- public void TestInheritFairAffinity()
- {
- Assert.Greater(FairAffinityFunctionEx.AssignCount, 2);
-
- var caches = new[]
- {
- _ignite.GetCache<int, int>(CacheNameFair),
- _ignite.CreateCache<int, int>(new CacheConfiguration(CacheNameFair + "2")
- {
- AffinityFunction = new FairAffinityFunctionEx {Foo = 25}
- })
- };
-
- foreach (var cache in caches)
- {
- var aff = _ignite.GetAffinity(cache.Name);
-
- Assert.AreEqual(PartitionCount, aff.Partitions);
-
- // Test from map
- Assert.AreEqual(2, aff.GetPartition(1));
- Assert.AreEqual(3, aff.GetPartition(2));
-
- // Test from base func
- Assert.AreEqual(6, aff.GetPartition(33));
-
- // Check config
- var func = (FairAffinityFunctionEx) cache.GetConfiguration().AffinityFunction;
- Assert.AreEqual(25, func.Foo);
- }
- }
-
- /// <summary>
/// Tests customized rendezvous affinity.
/// </summary>
[Test]
@@ -397,46 +349,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
}
[Serializable]
- private class FairAffinityFunctionEx : FairAffinityFunction
- {
- public static int AssignCount;
-
- private static readonly Dictionary<int, int> PartitionMap = new Dictionary<int, int> {{1, 2}, {2, 3}};
-
- public override int Partitions
- {
- get { return PartitionCount; }
- set { Assert.AreEqual(Partitions, value); }
- }
-
- public int Foo { get; set; }
-
- public override int GetPartition(object key)
- {
- int res;
-
- if (PartitionMap.TryGetValue((int)key, out res))
- return res;
-
- return base.GetPartition(key);
- }
-
- public override void RemoveNode(Guid nodeId)
- {
- RemovedNodes.Add(nodeId);
- }
-
- public override IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
- {
- var res = base.AssignPartitions(context).Reverse();
-
- Interlocked.Increment(ref AssignCount);
-
- return res;
- }
- }
-
- [Serializable]
private class RendezvousAffinityFunctionEx : RendezvousAffinityFunction
{
public static int AssignCount;
@@ -479,7 +391,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
/// <summary>
/// Override only properties, so this func won't be passed over the wire.
/// </summary>
- private class SimpleOverride : FairAffinityFunction
+ private class SimpleOverride : RendezvousAffinityFunction
{
public override int Partitions
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
index 250177d..e63e203 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
@@ -22,7 +22,6 @@ namespace Apache.Ignite.Core.Tests.Cache
using System.Linq;
using Apache.Ignite.Core.Binary;
using Apache.Ignite.Core.Cache.Affinity;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Eviction;
@@ -186,17 +185,12 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.AreEqual(CacheConfiguration.DefaultCopyOnRead, cfg.CopyOnRead);
Assert.AreEqual(CacheConfiguration.DefaultStartSize, cfg.StartSize);
Assert.AreEqual(CacheConfiguration.DefaultEagerTtl, cfg.EagerTtl);
- Assert.AreEqual(CacheConfiguration.DefaultEvictSynchronizedKeyBufferSize, cfg.EvictSynchronizedKeyBufferSize);
- Assert.AreEqual(CacheConfiguration.DefaultEvictSynchronized, cfg.EvictSynchronized);
- Assert.AreEqual(CacheConfiguration.DefaultEvictSynchronizedConcurrencyLevel, cfg.EvictSynchronizedConcurrencyLevel);
- Assert.AreEqual(CacheConfiguration.DefaultEvictSynchronizedTimeout, cfg.EvictSynchronizedTimeout);
Assert.AreEqual(CacheConfiguration.DefaultInvalidate, cfg.Invalidate);
Assert.AreEqual(CacheConfiguration.DefaultKeepVinaryInStore, cfg.KeepBinaryInStore);
Assert.AreEqual(CacheConfiguration.DefaultLoadPreviousValue, cfg.LoadPreviousValue);
Assert.AreEqual(CacheConfiguration.DefaultLockTimeout, cfg.LockTimeout);
Assert.AreEqual(CacheConfiguration.DefaultLongQueryWarningTimeout, cfg.LongQueryWarningTimeout);
Assert.AreEqual(CacheConfiguration.DefaultMaxConcurrentAsyncOperations, cfg.MaxConcurrentAsyncOperations);
- Assert.AreEqual(CacheConfiguration.DefaultMaxEvictionOverflowRatio, cfg.MaxEvictionOverflowRatio);
Assert.AreEqual(CacheConfiguration.DefaultReadFromBackup, cfg.ReadFromBackup);
Assert.AreEqual(CacheConfiguration.DefaultRebalanceBatchSize, cfg.RebalanceBatchSize);
Assert.AreEqual(CacheConfiguration.DefaultRebalanceMode, cfg.RebalanceMode);
@@ -221,17 +215,12 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.AreEqual(x.CopyOnRead, y.CopyOnRead);
Assert.AreEqual(x.StartSize, y.StartSize);
Assert.AreEqual(x.EagerTtl, y.EagerTtl);
- Assert.AreEqual(x.EvictSynchronizedKeyBufferSize, y.EvictSynchronizedKeyBufferSize);
- Assert.AreEqual(x.EvictSynchronized, y.EvictSynchronized);
- Assert.AreEqual(x.EvictSynchronizedConcurrencyLevel, y.EvictSynchronizedConcurrencyLevel);
- Assert.AreEqual(x.EvictSynchronizedTimeout, y.EvictSynchronizedTimeout);
Assert.AreEqual(x.Invalidate, y.Invalidate);
Assert.AreEqual(x.KeepBinaryInStore, y.KeepBinaryInStore);
Assert.AreEqual(x.LoadPreviousValue, y.LoadPreviousValue);
Assert.AreEqual(x.LockTimeout, y.LockTimeout);
Assert.AreEqual(x.LongQueryWarningTimeout, y.LongQueryWarningTimeout);
Assert.AreEqual(x.MaxConcurrentAsyncOperations, y.MaxConcurrentAsyncOperations);
- Assert.AreEqual(x.MaxEvictionOverflowRatio, y.MaxEvictionOverflowRatio);
Assert.AreEqual(x.ReadFromBackup, y.ReadFromBackup);
Assert.AreEqual(x.RebalanceBatchSize, y.RebalanceBatchSize);
Assert.AreEqual(x.RebalanceMode, y.RebalanceMode);
@@ -487,22 +476,17 @@ namespace Apache.Ignite.Core.Tests.Cache
WriteBehindFlushThreadCount = 4,
LongQueryWarningTimeout = TimeSpan.FromSeconds(5),
LoadPreviousValue = true,
- EvictSynchronizedKeyBufferSize = 6,
CopyOnRead = true,
WriteBehindFlushFrequency = TimeSpan.FromSeconds(6),
WriteBehindFlushSize = 7,
- EvictSynchronized = true,
AtomicWriteOrderMode = CacheAtomicWriteOrderMode.Primary,
AtomicityMode = CacheAtomicityMode.Atomic,
Backups = 8,
CacheMode = CacheMode.Partitioned,
EagerTtl = true,
- EvictSynchronizedConcurrencyLevel = 9,
- EvictSynchronizedTimeout = TimeSpan.FromSeconds(10),
Invalidate = true,
KeepBinaryInStore = true,
LockTimeout = TimeSpan.FromSeconds(11),
- MaxEvictionOverflowRatio = 0.5f,
ReadFromBackup = true,
RebalanceBatchSize = 12,
RebalanceDelay = TimeSpan.FromSeconds(13),
@@ -579,22 +563,17 @@ namespace Apache.Ignite.Core.Tests.Cache
WriteBehindFlushThreadCount = 4,
LongQueryWarningTimeout = TimeSpan.FromSeconds(5),
LoadPreviousValue = true,
- EvictSynchronizedKeyBufferSize = 6,
CopyOnRead = true,
WriteBehindFlushFrequency = TimeSpan.FromSeconds(6),
WriteBehindFlushSize = 7,
- EvictSynchronized = true,
AtomicWriteOrderMode = CacheAtomicWriteOrderMode.Clock,
AtomicityMode = CacheAtomicityMode.Transactional,
Backups = 8,
CacheMode = CacheMode.Partitioned,
EagerTtl = true,
- EvictSynchronizedConcurrencyLevel = 9,
- EvictSynchronizedTimeout = TimeSpan.FromSeconds(10),
Invalidate = true,
KeepBinaryInStore = true,
LockTimeout = TimeSpan.FromSeconds(11),
- MaxEvictionOverflowRatio = 0.5f,
ReadFromBackup = true,
RebalanceBatchSize = 12,
RebalanceDelay = TimeSpan.FromSeconds(13),
@@ -649,7 +628,7 @@ namespace Apache.Ignite.Core.Tests.Cache
MaxMemorySize = 2501,
BatchSize = 33
},
- AffinityFunction = new FairAffinityFunction
+ AffinityFunction = new RendezvousAffinityFunction
{
Partitions = 113,
ExcludeNeighbors = false
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Affinity/affinity-function.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Affinity/affinity-function.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Affinity/affinity-function.xml
index 62d723f..ca38fbe 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Affinity/affinity-function.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Affinity/affinity-function.xml
@@ -70,7 +70,7 @@
<property name="affinity">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetAffinityFunction">
- <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Affinity.AffinityFunctionSpringTest+TestFairFunc, Apache.Ignite.Core.Tests"/>
+ <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Affinity.AffinityFunctionSpringTest+TestRendezvousFunc, Apache.Ignite.Core.Tests"/>
<property name="properties">
<map>
<entry key="Property1">
@@ -90,7 +90,7 @@
<property name="affinity">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetAffinityFunction">
- <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Affinity.AffinityFunctionSpringTest+TestFairFunc, Apache.Ignite.Core.Tests"/>
+ <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Affinity.AffinityFunctionSpringTest+TestRendezvousFunc, Apache.Ignite.Core.Tests"/>
<property name="properties">
<map>
<entry key="Property1">
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/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 89e0d3d..2cdf0b0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -33,7 +33,6 @@ namespace Apache.Ignite.Core.Tests
using System.Xml.Linq;
using System.Xml.Schema;
using Apache.Ignite.Core.Binary;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Eviction;
@@ -616,17 +615,12 @@ namespace Apache.Ignite.Core.Tests
CacheStoreFactory = new TestCacheStoreFactory(),
CopyOnRead = false,
EagerTtl = false,
- EvictSynchronized = true,
- EvictSynchronizedConcurrencyLevel = 13,
- EvictSynchronizedKeyBufferSize = 14,
- EvictSynchronizedTimeout = TimeSpan.FromMinutes(3),
Invalidate = true,
KeepBinaryInStore = true,
LoadPreviousValue = true,
LockTimeout = TimeSpan.FromSeconds(56),
LongQueryWarningTimeout = TimeSpan.FromSeconds(99),
MaxConcurrentAsyncOperations = 24,
- MaxEvictionOverflowRatio = 5.6F,
QueryEntities = new[]
{
new QueryEntity
@@ -674,7 +668,7 @@ namespace Apache.Ignite.Core.Tests
{
BatchSize = 18, MaxMemorySize = 1023, MaxSize = 554
},
- AffinityFunction = new FairAffinityFunction
+ AffinityFunction = new RendezvousAffinityFunction
{
ExcludeNeighbors = true,
Partitions = 48
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
index f642976..19053f2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -22,7 +22,6 @@ namespace Apache.Ignite.Core.Tests
using System.IO;
using System.Linq;
using Apache.Ignite.Core.Binary;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Eviction;
@@ -74,7 +73,6 @@ namespace Apache.Ignite.Core.Tests
CheckDefaultValueAttributes(new TcpDiscoveryMulticastIpFinder());
CheckDefaultValueAttributes(new TcpCommunicationSpi());
CheckDefaultValueAttributes(new RendezvousAffinityFunction());
- CheckDefaultValueAttributes(new FairAffinityFunction());
CheckDefaultValueAttributes(new NearCacheConfiguration());
CheckDefaultValueAttributes(new FifoEvictionPolicy());
CheckDefaultValueAttributes(new LruEvictionPolicy());
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index a383ef2..908a192 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -111,8 +111,6 @@
<Compile Include="Cache\Affinity\AffinityKeyMappedAttribute.cs" />
<Compile Include="Cache\Affinity\AffinityFunctionContext.cs" />
<Compile Include="Cache\Affinity\AffinityTopologyVersion.cs" />
- <Compile Include="Cache\Affinity\Fair\FairAffinityFunction.cs" />
- <Compile Include="Cache\Affinity\Fair\Package-Info.cs" />
<Compile Include="Cache\Affinity\IAffinityFunction.cs" />
<Compile Include="Cache\Affinity\Package-Info.cs" />
<Compile Include="Cache\Affinity\Rendezvous\Package-Info.cs" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/FairAffinityFunction.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/FairAffinityFunction.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/FairAffinityFunction.cs
deleted file mode 100644
index 4a3885f..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/FairAffinityFunction.cs
+++ /dev/null
@@ -1,32 +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.Core.Cache.Affinity.Fair
-{
- using System;
-
- /// <summary>
- /// Fair affinity function which tries to ensure that all nodes get equal number of partitions with
- /// minimum amount of reassignments between existing nodes.
- /// </summary>
- [Serializable]
- public class FairAffinityFunction : AffinityFunctionBase
- {
- // No-op.
- // Actual implementation is in Java, see AffinityFunctionSerializer.Write method.
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/Package-Info.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/Package-Info.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/Package-Info.cs
deleted file mode 100644
index 29a21bd..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/Fair/Package-Info.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-\ufeff/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#pragma warning disable 1587 // invalid XML comment
-
-/// <summary>
-/// Fair affinity API.
-/// </summary>
-namespace Apache.Ignite.Core.Cache.Affinity.Fair
-{
- // No-op.
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/IAffinityFunction.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/IAffinityFunction.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/IAffinityFunction.cs
index b6c190c..14592b2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/IAffinityFunction.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Affinity/IAffinityFunction.cs
@@ -19,7 +19,6 @@ namespace Apache.Ignite.Core.Cache.Affinity
{
using System;
using System.Collections.Generic;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cluster;
@@ -27,7 +26,7 @@ namespace Apache.Ignite.Core.Cache.Affinity
/// Represents a function that maps cache keys to cluster nodes.
/// <para />
/// Predefined implementations:
- /// <see cref="RendezvousAffinityFunction"/>, <see cref="FairAffinityFunction"/>.
+ /// <see cref="RendezvousAffinityFunction"/>.
/// </summary>
public interface IAffinityFunction
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
index a5b9712..cff054d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
@@ -29,7 +29,6 @@ namespace Apache.Ignite.Core.Cache.Configuration
using Apache.Ignite.Core.Binary;
using Apache.Ignite.Core.Cache;
using Apache.Ignite.Core.Cache.Affinity;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cache.Eviction;
using Apache.Ignite.Core.Cache.Expiry;
@@ -82,27 +81,9 @@ namespace Apache.Ignite.Core.Cache.Configuration
/// <summary> Default rebalance batch size in bytes. </summary>
public const int DefaultRebalanceBatchSize = 512*1024; // 512K
- /// <summary> Default maximum eviction queue ratio. </summary>
- public const float DefaultMaxEvictionOverflowRatio = 10;
-
- /// <summary> Default eviction synchronized flag. </summary>
- public const bool DefaultEvictSynchronized = false;
-
- /// <summary> Default eviction key buffer size for batching synchronized evicts. </summary>
- public const int DefaultEvictSynchronizedKeyBufferSize = 1024;
-
- /// <summary> Default synchronous eviction timeout. </summary>
- public static readonly TimeSpan DefaultEvictSynchronizedTimeout = TimeSpan.FromMilliseconds(10000);
-
- /// <summary> Default synchronous eviction concurrency level. </summary>
- public const int DefaultEvictSynchronizedConcurrencyLevel = 4;
-
/// <summary> Default value for eager ttl flag. </summary>
public const bool DefaultEagerTtl = true;
- /// <summary> Default off-heap storage size is {@code -1} which means that off-heap storage is disabled. </summary>
- public const long DefaultOffHeapMaxMemory = -1;
-
/// <summary> Default value for 'maxConcurrentAsyncOps'. </summary>
public const int DefaultMaxConcurrentAsyncOperations = 500;
@@ -171,17 +152,12 @@ namespace Apache.Ignite.Core.Cache.Configuration
CacheMode = DefaultCacheMode;
CopyOnRead = DefaultCopyOnRead;
EagerTtl = DefaultEagerTtl;
- EvictSynchronizedKeyBufferSize = DefaultEvictSynchronizedKeyBufferSize;
- EvictSynchronized = DefaultEvictSynchronized;
- EvictSynchronizedConcurrencyLevel = DefaultEvictSynchronizedConcurrencyLevel;
- EvictSynchronizedTimeout = DefaultEvictSynchronizedTimeout;
Invalidate = DefaultInvalidate;
KeepBinaryInStore = DefaultKeepVinaryInStore;
LoadPreviousValue = DefaultLoadPreviousValue;
LockTimeout = DefaultLockTimeout;
LongQueryWarningTimeout = DefaultLongQueryWarningTimeout;
MaxConcurrentAsyncOperations = DefaultMaxConcurrentAsyncOperations;
- MaxEvictionOverflowRatio = DefaultMaxEvictionOverflowRatio;
ReadFromBackup = DefaultReadFromBackup;
RebalanceBatchSize = DefaultRebalanceBatchSize;
RebalanceMode = DefaultRebalanceMode;
@@ -234,17 +210,12 @@ namespace Apache.Ignite.Core.Cache.Configuration
CacheMode = (CacheMode) reader.ReadInt();
CopyOnRead = reader.ReadBoolean();
EagerTtl = reader.ReadBoolean();
- EvictSynchronized = reader.ReadBoolean();
- EvictSynchronizedConcurrencyLevel = reader.ReadInt();
- EvictSynchronizedKeyBufferSize = reader.ReadInt();
- EvictSynchronizedTimeout = reader.ReadLongAsTimespan();
Invalidate = reader.ReadBoolean();
KeepBinaryInStore = reader.ReadBoolean();
LoadPreviousValue = reader.ReadBoolean();
LockTimeout = reader.ReadLongAsTimespan();
LongQueryWarningTimeout = reader.ReadLongAsTimespan();
MaxConcurrentAsyncOperations = reader.ReadInt();
- MaxEvictionOverflowRatio = reader.ReadFloat();
Name = reader.ReadString();
ReadFromBackup = reader.ReadBoolean();
RebalanceBatchSize = reader.ReadInt();
@@ -295,17 +266,12 @@ namespace Apache.Ignite.Core.Cache.Configuration
writer.WriteInt((int) CacheMode);
writer.WriteBoolean(CopyOnRead);
writer.WriteBoolean(EagerTtl);
- writer.WriteBoolean(EvictSynchronized);
- writer.WriteInt(EvictSynchronizedConcurrencyLevel);
- writer.WriteInt(EvictSynchronizedKeyBufferSize);
- writer.WriteLong((long) EvictSynchronizedTimeout.TotalMilliseconds);
writer.WriteBoolean(Invalidate);
writer.WriteBoolean(KeepBinaryInStore);
writer.WriteBoolean(LoadPreviousValue);
writer.WriteLong((long) LockTimeout.TotalMilliseconds);
writer.WriteLong((long) LongQueryWarningTimeout.TotalMilliseconds);
writer.WriteInt(MaxConcurrentAsyncOperations);
- writer.WriteFloat(MaxEvictionOverflowRatio);
writer.WriteString(Name);
writer.WriteBoolean(ReadFromBackup);
writer.WriteInt(RebalanceBatchSize);
@@ -410,51 +376,6 @@ namespace Apache.Ignite.Core.Cache.Configuration
public CacheWriteSynchronizationMode WriteSynchronizationMode { get; set; }
/// <summary>
- /// Gets or sets flag indicating whether eviction is synchronized between primary, backup and near nodes.
- /// If this parameter is true and swap is disabled then <see cref="ICache{TK,TV}.LocalEvict"/>
- /// will involve all nodes where an entry is kept.
- /// If this property is set to false then eviction is done independently on different cache nodes.
- /// Note that it's not recommended to set this value to true if cache store is configured since it will allow
- /// to significantly improve cache performance.
- /// </summary>
- [DefaultValue(DefaultEvictSynchronized)]
- public bool EvictSynchronized { get; set; }
-
- /// <summary>
- /// Gets or sets size of the key buffer for synchronized evictions.
- /// </summary>
- [DefaultValue(DefaultEvictSynchronizedKeyBufferSize)]
- public int EvictSynchronizedKeyBufferSize { get; set; }
-
- /// <summary>
- /// Gets or sets concurrency level for synchronized evictions.
- /// This flag only makes sense with <see cref="EvictSynchronized"/> set to true.
- /// When synchronized evictions are enabled, it is possible that local eviction policy will try
- /// to evict entries faster than evictions can be synchronized with backup or near nodes.
- /// This value specifies how many concurrent synchronous eviction sessions should be allowed
- /// before the system is forced to wait and let synchronous evictions catch up with the eviction policy.
- /// </summary>
- [DefaultValue(DefaultEvictSynchronizedConcurrencyLevel)]
- public int EvictSynchronizedConcurrencyLevel { get; set; }
-
- /// <summary>
- /// Gets or sets timeout for synchronized evictions
- /// </summary>
- [DefaultValue(typeof(TimeSpan), "00:00:10")]
- public TimeSpan EvictSynchronizedTimeout { get; set; }
-
- /// <summary>
- /// This value denotes the maximum size of eviction queue in percents of cache size
- /// in case of distributed cache (replicated and partitioned) and using synchronized eviction
- /// <para/>
- /// That queue is used internally as a buffer to decrease network costs for synchronized eviction.
- /// Once queue size reaches specified value all required requests for all entries in the queue
- /// are sent to remote nodes and the queue is cleared.
- /// </summary>
- [DefaultValue(DefaultMaxEvictionOverflowRatio)]
- public float MaxEvictionOverflowRatio { get; set; }
-
- /// <summary>
/// Gets or sets flag indicating whether expired cache entries will be eagerly removed from cache.
/// When set to false, expired entries will be removed on next entry access.
/// </summary>
@@ -692,7 +613,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
/// Gets or sets the affinity function to provide mapping from keys to nodes.
/// <para />
/// Predefined implementations:
- /// <see cref="RendezvousAffinityFunction"/>, <see cref="FairAffinityFunction"/>.
+ /// <see cref="RendezvousAffinityFunction"/>.
/// </summary>
public IAffinityFunction AffinityFunction { get; set; }
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/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 569925f..7e0790d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -554,35 +554,6 @@
<xs:documentation>Write synchronization mode. This mode controls whether the main caller should wait for update on other nodes to complete or not.</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute name="evictSynchronized" type="xs:boolean">
- <xs:annotation>
- <xs:documentation>
- Flag indicating whether eviction is synchronized between primary, backup and near nodes. If this parameter is true and swap is disabled then ICache.LocalEvict will involve all nodes where an entry is kept. If this property is set to false then eviction is done independently on different cache nodes. Note that it's not recommended to set this value to true if cache store is configured since it will allow to significantly improve cache performance.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="evictSynchronizedKeyBufferSize" type="xs:int">
- <xs:annotation>
- <xs:documentation>Size of the key buffer for synchronized evictions.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="evictSynchronizedConcurrencyLevel" type="xs:int">
- <xs:annotation>
- <xs:documentation>
- Concurrency level for synchronized evictions. This flag only makes sense with EvictSynchronized set to true. When synchronized evictions are enabled, it is possible that local eviction policy will try to evict entries faster than evictions can be synchronized with backup or near nodes. This value specifies how many concurrent synchronous eviction sessions should be allowed before the system is forced to wait and let synchronous evictions catch up with the eviction policy.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="evictSynchronizedTimeout" type="xs:string">
- <xs:annotation>
- <xs:documentation>Timeout for synchronized evictions</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="maxEvictionOverflowRatio" type="xs:decimal">
- <xs:annotation>
- <xs:documentation>This value denotes the maximum size of eviction queue in percents of cache size in case of distributed cache (replicated and partitioned) and using synchronized eviction</xs:documentation>
- </xs:annotation>
- </xs:attribute>
<xs:attribute name="startSize" type="xs:int">
<xs:annotation>
<xs:documentation>Initial cache size which will be used to pre-create internal hash table after start.</xs:documentation>
http://git-wip-us.apache.org/repos/asf/ignite/blob/b62d4464/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Affinity/AffinityFunctionSerializer.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Affinity/AffinityFunctionSerializer.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Affinity/AffinityFunctionSerializer.cs
index 73afe38..15239c8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Affinity/AffinityFunctionSerializer.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Affinity/AffinityFunctionSerializer.cs
@@ -24,7 +24,6 @@ namespace Apache.Ignite.Core.Impl.Cache.Affinity
using System.Linq;
using Apache.Ignite.Core.Binary;
using Apache.Ignite.Core.Cache.Affinity;
- using Apache.Ignite.Core.Cache.Affinity.Fair;
using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
using Apache.Ignite.Core.Cluster;
using Apache.Ignite.Core.Common;
@@ -41,9 +40,6 @@ namespace Apache.Ignite.Core.Impl.Cache.Affinity
private const byte TypeCodeNull = 0;
/** */
- private const byte TypeCodeFair = 1;
-
- /** */
private const byte TypeCodeRendezvous = 2;
/** */
@@ -68,11 +64,11 @@ namespace Apache.Ignite.Core.Impl.Cache.Affinity
// 4) Override flags
// 5) User object
- var p = fun as AffinityFunctionBase;
+ var p = fun as RendezvousAffinityFunction;
if (p != null)
{
- writer.WriteByte(p is FairAffinityFunction ? TypeCodeFair : TypeCodeRendezvous);
+ writer.WriteByte(TypeCodeRendezvous);
writer.WriteInt(p.Partitions);
writer.WriteBoolean(p.ExcludeNeighbors);
@@ -113,13 +109,6 @@ namespace Apache.Ignite.Core.Impl.Cache.Affinity
{
Debug.Assert(overrideFlags != UserOverrides.None);
- var fair = userFunc as FairAffinityFunction;
- if (fair != null)
- {
- fair.Partitions = partitions;
- fair.ExcludeNeighbors = exclNeighbors;
- }
-
var rendezvous = userFunc as RendezvousAffinityFunction;
if (rendezvous != null)
{
@@ -135,9 +124,6 @@ namespace Apache.Ignite.Core.Impl.Cache.Affinity
switch (typeCode)
{
- case TypeCodeFair:
- fun = new FairAffinityFunction();
- break;
case TypeCodeRendezvous:
fun = new RendezvousAffinityFunction();
break;
[17/50] [abbrv] ignite git commit: Merge remote-tracking branch
'gg-fork-origin/ignite-3477-master' into ignite-3477-master-ggfork
Posted by ag...@apache.org.
Merge remote-tracking branch 'gg-fork-origin/ignite-3477-master' into ignite-3477-master-ggfork
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/face0c7b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/face0c7b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/face0c7b
Branch: refs/heads/master
Commit: face0c7b8190aaf4849ee5048849c2bc1f7aae62
Parents: 0390391 391d8d0
Author: Ivan Rakov <iv...@gmail.com>
Authored: Tue Apr 11 19:07:25 2017 +0300
Committer: Ivan Rakov <iv...@gmail.com>
Committed: Tue Apr 11 19:07:25 2017 +0300
----------------------------------------------------------------------
modules/core/src/test/config/spring-multicache.xml | 16 ++++++++++++++++
.../cpp/core-test/config/cache-test-default.xml | 1 +
2 files changed, 17 insertions(+)
----------------------------------------------------------------------
[48/50] [abbrv] ignite git commit: Fix for C++ tests
Posted by ag...@apache.org.
Fix for C++ tests
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/faaf92d6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/faaf92d6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/faaf92d6
Branch: refs/heads/master
Commit: faaf92d65614daa65d6f6cbff9fe08cea31c6d4e
Parents: 0242728
Author: Igor Sapego <is...@gridgain.com>
Authored: Thu Apr 13 20:08:05 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Thu Apr 13 20:08:05 2017 +0300
----------------------------------------------------------------------
.../platforms/cpp/core-test/src/cache_test.cpp | 58 ++++++++++----------
1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/faaf92d6/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_test.cpp b/modules/platforms/cpp/core-test/src/cache_test.cpp
index d222009..ab29797 100644
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@ -123,15 +123,15 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.Put(2, 2);
cache.Put(3, 3);
- int size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(3 == size);
+ BOOST_CHECK_EQUAL(3, size);
cache.RemoveAll();
- size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -143,18 +143,18 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.RemoveAll(keySet);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -166,18 +166,18 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
cache.RemoveAll(keySet.begin(), keySet.end());
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -187,9 +187,9 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
cache.RemoveAll(keys, keys + 4);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestPut)
@@ -459,11 +459,11 @@ BOOST_AUTO_TEST_CASE(TestLocalClear)
cache.Put(0, 2);
- BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClear(0);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAll)
@@ -477,13 +477,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAll)
std::set<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keySet);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
@@ -497,13 +497,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
std::list<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keySet.begin(), keySet.end());
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
@@ -515,13 +515,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
int keys[] = { 0, 1 };
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keys, keys + 2);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestSizes)
@@ -535,7 +535,7 @@ BOOST_AUTO_TEST_CASE(TestSizes)
BOOST_REQUIRE(2 <= cache.Size());
- BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalEvict)
[18/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing hanging test
Posted by ag...@apache.org.
IGNITE-3477 - Fixing hanging test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b9867ebb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b9867ebb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b9867ebb
Branch: refs/heads/master
Commit: b9867ebbab8c9712e02df00007d56c075d5c61a6
Parents: 5703547
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 19:53:26 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 19:53:46 2017 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/processors/cache/GridCacheContext.java | 2 --
.../processors/cache/IgniteCacheTopologySafeGetSelfTest.java | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b9867ebb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index ffc379c..9e6fc3776 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -54,7 +54,6 @@ import org.apache.ignite.internal.managers.communication.GridIoManager;
import org.apache.ignite.internal.managers.deployment.GridDeploymentManager;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
-import org.apache.ignite.internal.pagemem.PageMemory;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.database.MemoryPolicy;
import org.apache.ignite.internal.processors.cache.database.freelist.FreeList;
@@ -85,7 +84,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersionedEnt
import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
import org.apache.ignite.internal.processors.plugin.CachePluginManager;
-import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.internal.processors.query.QueryUtils;
import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
import org.apache.ignite.internal.util.F0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/b9867ebb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
index 2404095..0140000 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTopologySafeGetSelfTest.java
@@ -147,7 +147,7 @@ public class IgniteCacheTopologySafeGetSelfTest extends GridCommonAbstractTest {
IgniteInternalFuture<?> nodeFut = startNodeAsync();
if (failPrimary)
- stopGrid(1);
+ stopGrid(getTestIgniteInstanceName(1), false, false);
assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("tx").getTopologySafe(key));
assertEquals(key, ((IgniteKernal)ignite(0)).internalCache("atomic").getTopologySafe(key));
[24/50] [abbrv] ignite git commit: Merge branch
'ignite-3477-master-apache' into ignite-3477-master
Posted by ag...@apache.org.
Merge branch 'ignite-3477-master-apache' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3a62833a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3a62833a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3a62833a
Branch: refs/heads/master
Commit: 3a62833adb72ca3b0998b0df5c7026196dfd943d
Parents: 5cded42 3e5e1f0
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:08:50 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:08:50 2017 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheContext.java | 2 -
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/atomic/GridDhtAtomicCache.java | 37 +++++----
.../IgniteCacheTopologySafeGetSelfTest.java | 2 +-
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++-
.../core/include/ignite/impl/module_manager.h | 26 ++++++
.../examples/include/ignite/examples/person.h | 1 -
.../Cache/CacheMetricsTest.cs | 86 +++++++++-----------
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 ------------------
.../Impl/Cache/CacheMetricsImpl.cs | 70 ----------------
10 files changed, 92 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
[14/50] [abbrv] ignite git commit: ignite-3477-master
onheapCacheEnabled=true xml
Posted by ag...@apache.org.
ignite-3477-master onheapCacheEnabled=true xml
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/391d8d00
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/391d8d00
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/391d8d00
Branch: refs/heads/master
Commit: 391d8d00327736a3acad0025ca1353131b3b0a64
Parents: c9fd6b9
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Tue Apr 11 18:08:44 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Tue Apr 11 18:08:44 2017 +0300
----------------------------------------------------------------------
modules/core/src/test/config/spring-multicache.xml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/391d8d00/modules/core/src/test/config/spring-multicache.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/spring-multicache.xml b/modules/core/src/test/config/spring-multicache.xml
index 6c6ecf4..7644a30 100644
--- a/modules/core/src/test/config/spring-multicache.xml
+++ b/modules/core/src/test/config/spring-multicache.xml
@@ -72,6 +72,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -94,6 +96,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -116,6 +120,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -138,6 +144,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -161,6 +169,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -183,6 +193,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -205,6 +217,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
@@ -227,6 +241,8 @@
<property name="rebalanceMode" value="SYNC"/>
+ <property name="onheapCacheEnabled" value="true"/>
+
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxSize" value="100"/>
[38/50] [abbrv] ignite git commit: Merge remote-tracking branch
'professional/ignite-3477-master' into ignite-3477-master
Posted by ag...@apache.org.
Merge remote-tracking branch 'professional/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c31de278
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c31de278
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c31de278
Branch: refs/heads/master
Commit: c31de2783d66eec7ae7237fc6ca1fbbfa7c1fb3b
Parents: 81a0f9a a563ba0
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 16:16:22 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 16:16:22 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[45/50] [abbrv] ignite git commit: IGNITE-3477 - Removed obsolete file
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2c4ef9ee/leak.patch
----------------------------------------------------------------------
diff --git a/leak.patch b/leak.patch
deleted file mode 100644
index f618073..0000000
--- a/leak.patch
+++ /dev/null
@@ -1,10521 +0,0 @@
-From 3c9e3786a21ec7c8919de9c29bc04d2e3561846c Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Wed, 15 Feb 2017 13:41:08 +0300
-Subject: [PATCH 01/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory
-
----
- .../processors/database/IgniteDbAbstractTest.java | 360 +++++++++++++++++++++
- .../database/IgniteDbMemoryLeakAbstractTest.java | 84 +++++
- .../database/IgniteDbMemoryLeakIndexedTest.java | 85 +++++
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 95 ++++++
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 90 ++++++
- .../database/IgniteDbMemoryLeakTest.java | 85 +++++
- .../IgniteDbMemoryLeakWithExpirationTest.java | 92 ++++++
- .../database/IgniteDbPutGetAbstractTest.java | 347 +-------------------
- 8 files changed, 903 insertions(+), 335 deletions(-)
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-new file mode 100644
-index 0000000..3bc7004
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-@@ -0,0 +1,360 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.cache.CacheAtomicityMode;
-+import org.apache.ignite.cache.CacheRebalanceMode;
-+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-+import org.apache.ignite.cache.affinity.AffinityFunction;
-+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-+import org.apache.ignite.cache.query.annotations.QuerySqlField;
-+import org.apache.ignite.configuration.CacheConfiguration;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.processors.cache.database.tree.BPlusTree;
-+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;
-+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-+
-+import java.io.Serializable;
-+import java.util.Arrays;
-+import java.util.Random;
-+
-+/**
-+ *
-+ */
-+public abstract class IgniteDbAbstractTest extends GridCommonAbstractTest {
-+ /** */
-+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-+
-+ /**
-+ * @return Node count.
-+ */
-+ protected abstract int gridCount();
-+
-+ /**
-+ * @return {@code True} if indexing is enabled.
-+ */
-+ protected abstract boolean indexingEnabled();
-+
-+ /** {@inheritDoc} */
-+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-+ IgniteConfiguration cfg = super.getConfiguration(gridName);
-+
-+ MemoryConfiguration dbCfg = new MemoryConfiguration();
-+
-+ dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
-+
-+ if (isLargePage())
-+ dbCfg.setPageSize(16 * 1024);
-+ else
-+ dbCfg.setPageSize(1024);
-+
-+
-+ dbCfg.setPageCacheSize(200 * 1024 * 1024);
-+
-+ configure(dbCfg);
-+
-+ cfg.setMemoryConfiguration(dbCfg);
-+
-+ CacheConfiguration ccfg = new CacheConfiguration();
-+
-+ if (indexingEnabled())
-+ ccfg.setIndexedTypes(Integer.class, DbValue.class);
-+
-+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
-+
-+ if (indexingEnabled())
-+ ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
-+
-+ ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg3 = new CacheConfiguration("large");
-+
-+ if (indexingEnabled())
-+ ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
-+
-+ ccfg3.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg3.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
-+
-+ ccfg4.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg4.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg4.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg4.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ final AffinityFunction aff = new RendezvousAffinityFunction(1, null);
-+
-+ ccfg4.setAffinity(aff);
-+
-+ cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4);
-+
-+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-+
-+ discoSpi.setIpFinder(IP_FINDER);
-+
-+ cfg.setDiscoverySpi(discoSpi);
-+ cfg.setMarshaller(null);
-+
-+ configure(cfg);
-+
-+ return cfg;
-+ }
-+
-+ protected void configure(IgniteConfiguration cfg){
-+ //NOP
-+ }
-+
-+ protected void configure(MemoryConfiguration mCfg){
-+ //NOP
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected void beforeTest() throws Exception {
-+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-+
-+ long seed = 1464583813940L; // System.currentTimeMillis();
-+
-+ info("Seed: " + seed + "L");
-+
-+ BPlusTree.rnd = new Random(seed);
-+
-+ startGrids(gridCount());
-+
-+ awaitPartitionMapExchange();
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected void afterTest() throws Exception {
-+ BPlusTree.rnd = null;
-+
-+ stopAllGrids();
-+
-+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-+ }
-+
-+ /**
-+ * @return {@code True} if use large page.
-+ */
-+ protected boolean isLargePage() {
-+ return false;
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class DbKey implements Serializable {
-+ /** */
-+ int val;
-+
-+ /**
-+ * @param val Value.
-+ */
-+ DbKey(int val) {
-+ this.val = val;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || !(o instanceof DbKey))
-+ return false;
-+
-+ DbKey key = (DbKey)o;
-+
-+ return val == key.val;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ return val;
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class LargeDbKey implements Serializable {
-+ /** */
-+ int val;
-+
-+ /** */
-+ byte[] data;
-+
-+ /**
-+ * @param val Value.
-+ * @param size Key payload size.
-+ */
-+ LargeDbKey(int val, int size) {
-+ this.val = val;
-+
-+ data = new byte[size];
-+
-+ Arrays.fill(data, (byte)val);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || !(o instanceof LargeDbKey))
-+ return false;
-+
-+ LargeDbKey key = (LargeDbKey)o;
-+
-+ return val == key.val && Arrays.equals(data, key.data);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ return val + Arrays.hashCode(data);
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class DbValue implements Serializable {
-+ /** */
-+ @QuerySqlField(index = true)
-+ int iVal;
-+
-+ /** */
-+ @QuerySqlField(index = true)
-+ String sVal;
-+
-+ /** */
-+ @QuerySqlField
-+ long lVal;
-+
-+
-+
-+ /**
-+ * @param iVal Integer value.
-+ * @param sVal String value.
-+ * @param lVal Long value.
-+ */
-+ DbValue(int iVal, String sVal, long lVal) {
-+ this.iVal = iVal;
-+ this.sVal = sVal;
-+ this.lVal = lVal;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || getClass() != o.getClass())
-+ return false;
-+
-+ DbValue dbVal = (DbValue)o;
-+
-+ return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-+ !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ int res = iVal;
-+
-+ res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-+ res = 31 * res + (int)(lVal ^ (lVal >>> 32));
-+
-+ return res;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public String toString() {
-+ return S.toString(DbValue.class, this);
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class LargeDbValue {
-+ /** */
-+ @QuerySqlField(index = true)
-+ String str1;
-+
-+ /** */
-+ @QuerySqlField(index = true)
-+ String str2;
-+
-+ /** */
-+ int[] arr;
-+
-+ /**
-+ * @param str1 String 1.
-+ * @param str2 String 2.
-+ * @param arr Big array.
-+ */
-+ LargeDbValue(final String str1, final String str2, final int[] arr) {
-+ this.str1 = str1;
-+ this.str2 = str2;
-+ this.arr = arr;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(final Object o) {
-+ if (this == o) return true;
-+ if (o == null || getClass() != o.getClass()) return false;
-+
-+ final LargeDbValue that = (LargeDbValue) o;
-+
-+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-+ if (str2 != null ? !str2.equals(that.str2) : that.str2 != null) return false;
-+
-+ return Arrays.equals(arr, that.arr);
-+
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ int res = str1 != null ? str1.hashCode() : 0;
-+
-+ res = 31 * res + (str2 != null ? str2.hashCode() : 0);
-+ res = 31 * res + Arrays.hashCode(arr);
-+
-+ return res;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public String toString() {
-+ return S.toString(LargeDbValue.class, this);
-+ }
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-new file mode 100644
-index 0000000..6a5d039
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -0,0 +1,84 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.Ignite;
-+import org.apache.ignite.IgniteCompute;
-+import org.apache.ignite.compute.ComputeTaskFuture;
-+import org.apache.ignite.internal.IgniteEx;
-+import org.apache.ignite.lang.IgniteRunnable;
-+import org.apache.ignite.resources.IgniteInstanceResource;
-+
-+import java.util.concurrent.TimeUnit;
-+
-+/**
-+ *
-+ */
-+public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
-+
-+ /** Test duration in seconds*/
-+ protected abstract int duration();
-+
-+ @Override
-+ protected long getTestTimeout() {
-+ return duration() * 1200;
-+ }
-+
-+ /** */
-+ protected abstract void operation(IgniteEx ig);
-+
-+ /** */
-+ public void testMemoryLeak() throws Exception {
-+
-+ final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+
-+ int tasksCount = Runtime.getRuntime().availableProcessors() * 4;
-+
-+ IgniteCompute compute = grid(0).compute().withAsync();
-+
-+ ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCount];
-+
-+ for (int i = 0; i < tasksCount; i++) {
-+ compute.run(new IgniteRunnable() {
-+ @IgniteInstanceResource
-+ private Ignite ig;
-+
-+ @Override
-+ public void run() {
-+ int i = 0;
-+ while (System.nanoTime() < end) {
-+ operation((IgniteEx) ig);
-+
-+ if(i++ == 100) {
-+ check((IgniteEx) ig);
-+ i = 0;
-+ }
-+ }
-+ }
-+ });
-+
-+ futs[i] = compute.future();
-+ }
-+
-+ for (ComputeTaskFuture fut : futs) {
-+ fut.get();
-+ }
-+ }
-+
-+ protected void check(IgniteEx ig) {}
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-new file mode 100644
-index 0000000..4cd74d0
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -0,0 +1,85 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return true;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 19100);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-new file mode 100644
-index 0000000..a4d88e1
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -0,0 +1,95 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakLargeObjectsTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ private final static int[] ARRAY;
-+ static {
-+ ARRAY = new int[1024];
-+ Random rnd = new Random();
-+ for (int i = 0; i < ARRAY.length; i++) {
-+ ARRAY[i] = rnd.nextInt();
-+ }
-+
-+ }
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(60 * 1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("large");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ LargeDbKey key = new LargeDbKey(rnd.nextInt(10_000), 1024);
-+
-+ LargeDbValue v0 = new LargeDbValue("test-value-1-" + rnd.nextInt(200), "test-value-2-" + rnd.nextInt(200), ARRAY);
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 50000);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-new file mode 100644
-index 0000000..bfa4aa9
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -0,0 +1,90 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(100 * 1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ @Override
-+ protected boolean isLargePage() {
-+ return true;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 4600);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-new file mode 100644
-index 0000000..6af4e41
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -0,0 +1,85 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 19100);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-new file mode 100644
-index 0000000..d9e3f34
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -0,0 +1,92 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT 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.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import javax.cache.expiry.CreatedExpiryPolicy;
-+import javax.cache.expiry.Duration;
-+import javax.cache.expiry.ExpiryPolicy;
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+import static java.util.concurrent.TimeUnit.MILLISECONDS;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig) {
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 10000);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-index c7a07e3..228a262 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-@@ -17,175 +17,39 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import java.io.Serializable;
--import java.util.Arrays;
--import java.util.HashMap;
--import java.util.HashSet;
--import java.util.LinkedHashMap;
--import java.util.List;
--import java.util.Map;
--import java.util.Random;
--import java.util.Set;
--import java.util.UUID;
--import java.util.concurrent.ThreadLocalRandom;
--import javax.cache.Cache;
- import org.apache.ignite.Ignite;
- import org.apache.ignite.IgniteCache;
- import org.apache.ignite.IgniteDataStreamer;
--import org.apache.ignite.cache.CacheAtomicityMode;
- import org.apache.ignite.cache.CachePeekMode;
--import org.apache.ignite.cache.CacheRebalanceMode;
--import org.apache.ignite.cache.CacheWriteSynchronizationMode;
- import org.apache.ignite.cache.affinity.Affinity;
--import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
--import org.apache.ignite.cache.affinity.AffinityFunction;
- import org.apache.ignite.cache.query.QueryCursor;
- import org.apache.ignite.cache.query.ScanQuery;
- import org.apache.ignite.cache.query.SqlFieldsQuery;
- import org.apache.ignite.cache.query.SqlQuery;
--import org.apache.ignite.cache.query.annotations.QuerySqlField;
--import org.apache.ignite.configuration.CacheConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.internal.IgniteEx;
- import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
- import org.apache.ignite.internal.processors.cache.database.tree.BPlusTree;
- import org.apache.ignite.internal.util.GridRandom;
- import org.apache.ignite.internal.util.typedef.PA;
- import org.apache.ignite.internal.util.typedef.X;
--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;
- import org.apache.ignite.testframework.GridTestUtils;
--import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
- import org.junit.Assert;
-
-+import javax.cache.Cache;
-+import java.util.HashMap;
-+import java.util.HashSet;
-+import java.util.LinkedHashMap;
-+import java.util.List;
-+import java.util.Map;
-+import java.util.Random;
-+import java.util.Set;
-+import java.util.UUID;
-+import java.util.concurrent.ThreadLocalRandom;
-+
- /**
- *
- */
--public abstract class IgniteDbPutGetAbstractTest extends GridCommonAbstractTest {
-- /** */
-- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
--
-- /**
-- * @return Node count.
-- */
-- protected abstract int gridCount();
--
-- /**
-- * @return {@code True} if indexing is enabled.
-- */
-- protected abstract boolean indexingEnabled();
--
-- /** {@inheritDoc} */
-- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-- IgniteConfiguration cfg = super.getConfiguration(gridName);
--
-- MemoryConfiguration dbCfg = new MemoryConfiguration();
--
-- if (isLargePage()) {
-- dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
--
-- dbCfg.setPageSize(16 * 1024);
--
-- dbCfg.setPageCacheSize(200 * 1024 * 1024);
-- }
-- else {
-- dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
--
-- dbCfg.setPageSize(1024);
--
-- dbCfg.setPageCacheSize(200 * 1024 * 1024);
-- }
--
-- cfg.setMemoryConfiguration(dbCfg);
--
-- CacheConfiguration ccfg = new CacheConfiguration();
--
-- if (indexingEnabled())
-- ccfg.setIndexedTypes(Integer.class, DbValue.class);
--
-- ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
--
-- if (indexingEnabled())
-- ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
--
-- ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg3 = new CacheConfiguration("large");
--
-- if (indexingEnabled())
-- ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
--
-- ccfg3.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg3.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
--
-- ccfg4.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg4.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg4.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg4.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- final AffinityFunction aff = new RendezvousAffinityFunction(1, null);
--
-- ccfg4.setAffinity(aff);
--
-- cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4);
--
-- TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
--
-- discoSpi.setIpFinder(IP_FINDER);
--
-- cfg.setDiscoverySpi(discoSpi);
-- cfg.setMarshaller(null);
--
-- return cfg;
-- }
--
-- /** {@inheritDoc} */
-- @Override protected void beforeTest() throws Exception {
-- deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
--
-- long seed = 1464583813940L; // System.currentTimeMillis();
--
-- info("Seed: " + seed + "L");
--
-- BPlusTree.rnd = new Random(seed);
--
-- startGrids(gridCount());
--
-- awaitPartitionMapExchange();
-- }
--
-- /** {@inheritDoc} */
-- @Override protected void afterTest() throws Exception {
-- BPlusTree.rnd = null;
--
-- stopAllGrids();
--
-- deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-- }
--
-- /**
-- * @return {@code True} if use large page.
-- */
-- protected boolean isLargePage() {
-- return false;
-- };
--
-+public abstract class IgniteDbPutGetAbstractTest extends IgniteDbAbstractTest {
- /**
- *
- */
-@@ -1349,191 +1213,4 @@ private void checkEmpty(final GridCacheAdapter internalCache, final Object key)
-
- assertNull(internalCache.peekEx(key));
- }
--
-- /**
-- *
-- */
-- private static class DbKey implements Serializable {
-- /** */
-- private int val;
--
-- /**
-- * @param val Value.
-- */
-- private DbKey(int val) {
-- this.val = val;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || !(o instanceof DbKey))
-- return false;
--
-- DbKey key = (DbKey)o;
--
-- return val == key.val;
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- return val;
-- }
-- }
--
-- /**
-- *
-- */
-- private static class LargeDbKey implements Serializable {
-- /** */
-- private int val;
--
-- /** */
-- private byte[] data;
--
-- /**
-- * @param val Value.
-- * @param size Key payload size.
-- */
-- private LargeDbKey(int val, int size) {
-- this.val = val;
--
-- data = new byte[size];
--
-- Arrays.fill(data, (byte)val);
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || !(o instanceof LargeDbKey))
-- return false;
--
-- LargeDbKey key = (LargeDbKey)o;
--
-- return val == key.val && Arrays.equals(data, key.data);
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- return val + Arrays.hashCode(data);
-- }
-- }
--
-- /**
-- *
-- */
-- private static class DbValue implements Serializable {
-- /** */
-- @QuerySqlField(index = true)
-- private int iVal;
--
-- /** */
-- @QuerySqlField(index = true)
-- private String sVal;
--
-- /** */
-- @QuerySqlField
-- private long lVal;
--
-- /**
-- * @param iVal Integer value.
-- * @param sVal String value.
-- * @param lVal Long value.
-- */
-- public DbValue(int iVal, String sVal, long lVal) {
-- this.iVal = iVal;
-- this.sVal = sVal;
-- this.lVal = lVal;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || getClass() != o.getClass())
-- return false;
--
-- DbValue dbVal = (DbValue)o;
--
-- return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-- !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- int res = iVal;
--
-- res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-- res = 31 * res + (int)(lVal ^ (lVal >>> 32));
--
-- return res;
-- }
--
-- /** {@inheritDoc} */
-- @Override public String toString() {
-- return S.toString(DbValue.class, this);
-- }
-- }
--
-- /**
-- *
-- */
-- private static class LargeDbValue {
-- /** */
-- @QuerySqlField(index = true)
-- private String str1;
--
-- /** */
-- @QuerySqlField(index = true)
-- private String str2;
--
-- /** */
-- private int[] arr;
--
-- /**
-- * @param str1 String 1.
-- * @param str2 String 2.
-- * @param arr Big array.
-- */
-- public LargeDbValue(final String str1, final String str2, final int[] arr) {
-- this.str1 = str1;
-- this.str2 = str2;
-- this.arr = arr;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(final Object o) {
-- if (this == o) return true;
-- if (o == null || getClass() != o.getClass()) return false;
--
-- final LargeDbValue that = (LargeDbValue) o;
--
-- if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-- if (str2 != null ? !str2.equals(that.str2) : that.str2 != null) return false;
--
-- return Arrays.equals(arr, that.arr);
--
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- int res = str1 != null ? str1.hashCode() : 0;
--
-- res = 31 * res + (str2 != null ? str2.hashCode() : 0);
-- res = 31 * res + Arrays.hashCode(arr);
--
-- return res;
-- }
--
-- /** {@inheritDoc} */
-- @Override public String toString() {
-- return S.toString(LargeDbValue.class, this);
-- }
-- }
- }
-
-From 8e12097f9094d7f155135ee2f4c9c33f5f7af9aa Mon Sep 17 00:00:00 2001
-From: sboikov <sb...@gridgain.com>
-Date: Wed, 15 Feb 2017 15:08:14 +0300
-Subject: [PATCH 02/41] ignite-4694 review
-
----
- .../database/IgniteDbMemoryLeakAbstractTest.java | 15 ++++++++-------
- .../database/IgniteDbMemoryLeakIndexedTest.java | 3 +++
- .../database/IgniteDbMemoryLeakLargeObjectsTest.java | 9 +++++----
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 2 ++
- .../processors/database/IgniteDbMemoryLeakTest.java | 10 +++++++---
- .../database/IgniteDbMemoryLeakWithExpirationTest.java | 2 +-
- 6 files changed, 26 insertions(+), 15 deletions(-)
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index 6a5d039..fc0e715 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -27,10 +27,10 @@
- import java.util.concurrent.TimeUnit;
-
- /**
-- *
-+ * TODO: fix javadoc warnings, code style.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
--
-+ // TODO: take duration from system property.
- /** Test duration in seconds*/
- protected abstract int duration();
-
-@@ -44,16 +44,18 @@ protected long getTestTimeout() {
-
- /** */
- public void testMemoryLeak() throws Exception {
-+ // TODO: take PageMemory max size is the same as we configured.
-
- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-
-- int tasksCount = Runtime.getRuntime().availableProcessors() * 4;
-+ // TODO: use threads instead of compute or make sure there are enough threads in pool.
-+ int tasksCnt = Runtime.getRuntime().availableProcessors() * 4;
-
- IgniteCompute compute = grid(0).compute().withAsync();
-
-- ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCount];
-+ ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCnt];
-
-- for (int i = 0; i < tasksCount; i++) {
-+ for (int i = 0; i < tasksCnt; i++) {
- compute.run(new IgniteRunnable() {
- @IgniteInstanceResource
- private Ignite ig;
-@@ -75,9 +77,8 @@ public void run() {
- futs[i] = compute.future();
- }
-
-- for (ComputeTaskFuture fut : futs) {
-+ for (ComputeTaskFuture fut : futs)
- fut.get();
-- }
- }
-
- protected void check(IgniteEx ig) {}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-index 4cd74d0..db77131 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -51,6 +51,7 @@ protected void configure(MemoryConfiguration mCfg) {
- }
-
- @Override
-+ // TODO: move test to module ignite-indexing.
- protected boolean indexingEnabled() {
- return true;
- }
-@@ -64,6 +65,8 @@ protected void operation(IgniteEx ig){
-
- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-
-+ // TODO: also execute sql queries.
-+
- switch (rnd.nextInt(3)) {
- case 0:
- cache.getAndPut(key, v0);
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index a4d88e1..2a6c8cd 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -29,15 +29,16 @@
- *
- */
- public class IgniteDbMemoryLeakLargeObjectsTest extends IgniteDbMemoryLeakAbstractTest {
--
-+ /** */
- private final static int[] ARRAY;
-+
- static {
- ARRAY = new int[1024];
-+
- Random rnd = new Random();
-- for (int i = 0; i < ARRAY.length; i++) {
-- ARRAY[i] = rnd.nextInt();
-- }
-
-+ for (int i = 0; i < ARRAY.length; i++)
-+ ARRAY[i] = rnd.nextInt();
- }
-
- @Override
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-index bfa4aa9..91c96af 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -47,6 +47,7 @@ protected void configure(IgniteConfiguration cfg) {
-
- @Override
- protected void configure(MemoryConfiguration mCfg) {
-+ // TODO: understand why such overhead with large pages.
- mCfg.setPageCacheSize(100 * 1024 * 1024);
- }
-
-@@ -60,6 +61,7 @@ protected boolean isLargePage() {
- return true;
- }
-
-+ // TODO: avoid copy/paste.
- protected void operation(IgniteEx ig){
- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
- Random rnd = ThreadLocalRandom.current();
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-index 6af4e41..2b0ce1e 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -29,9 +29,8 @@
- *
- */
- public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-+ /** {@inheritDoc} */
-+ @Override protected int duration() {
- return 300;
- }
-
-@@ -64,12 +63,17 @@ protected void operation(IgniteEx ig){
-
- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-
-+ // TODO: also execute scan query.
-+
- switch (rnd.nextInt(3)) {
- case 0:
- cache.getAndPut(key, v0);
-+ break;
-+
- case 1:
- cache.get(key);
- break;
-+
- case 2:
- cache.getAndRemove(key);
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-index d9e3f34..95fe8c8 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -34,7 +34,7 @@
- *
- */
- public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
--
-+ /** */
- private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-
- @Override
-
-From e70d990f14288cfc8fe211fa25631016d5708144 Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Wed, 15 Feb 2017 18:04:38 +0300
-Subject: [PATCH 03/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory
-
----
- .../cache/IgniteCacheOffheapManagerImpl.java | 2 +-
- .../processors/database/IgniteDbAbstractTest.java | 6 +
- .../database/IgniteDbMemoryLeakAbstractTest.java | 172 ++++++++++++++++-----
- .../database/IgniteDbMemoryLeakIndexedTest.java | 65 +-------
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 64 ++------
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 67 ++------
- .../database/IgniteDbMemoryLeakTest.java | 63 ++------
- .../IgniteDbMemoryLeakWithExpirationTest.java | 58 +------
- 8 files changed, 182 insertions(+), 315 deletions(-)
-
-diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-index 5df99b6..9becc99 100644
---- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-@@ -897,7 +897,7 @@ public CacheDataStoreImpl(
- */
- private boolean canUpdateOldRow(@Nullable CacheDataRow oldRow, DataRow dataRow)
- throws IgniteCheckedException {
-- if (oldRow == null || indexingEnabled)
-+ if (oldRow == null || indexingEnabled || oldRow.expireTime() != dataRow.expireTime())
- return false;
-
- CacheObjectContext coCtx = cctx.cacheObjectContext();
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-index 3bc7004..9297cec 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-@@ -130,10 +130,16 @@
- return cfg;
- }
-
-+ /**
-+ * @param cfg IgniteConfiguration.
-+ */
- protected void configure(IgniteConfiguration cfg){
- //NOP
- }
-
-+ /**
-+ * @param mCfg MemoryConfiguration.
-+ */
- protected void configure(MemoryConfiguration mCfg){
- //NOP
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index fc0e715..bca3af0 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -17,69 +17,157 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.Ignite;
--import org.apache.ignite.IgniteCompute;
--import org.apache.ignite.compute.ComputeTaskFuture;
--import org.apache.ignite.internal.IgniteEx;
--import org.apache.ignite.lang.IgniteRunnable;
--import org.apache.ignite.resources.IgniteInstanceResource;
--
-+import java.util.Random;
- import java.util.concurrent.TimeUnit;
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+import org.apache.ignite.internal.util.GridRandom;
-+import org.jetbrains.annotations.NotNull;
-
- /**
-- * TODO: fix javadoc warnings, code style.
-+ * Base class for memory leaks tests.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
-- // TODO: take duration from system property.
-- /** Test duration in seconds*/
-- protected abstract int duration();
--
-- @Override
-- protected long getTestTimeout() {
-- return duration() * 1200;
-- }
-
- /** */
-- protected abstract void operation(IgniteEx ig);
-+ private volatile Exception ex = null;
-
- /** */
-- public void testMemoryLeak() throws Exception {
-- // TODO: take PageMemory max size is the same as we configured.
-+ private static final ThreadLocal<Random> THREAD_LOCAL_RANDOM = new ThreadLocal<>();
-
-- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+ /** {@inheritDoc} */
-+ @Override protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-
-- // TODO: use threads instead of compute or make sure there are enough threads in pool.
-- int tasksCnt = Runtime.getRuntime().availableProcessors() * 4;
-+ /** {@inheritDoc} */
-+ @Override protected void configure(MemoryConfiguration mCfg) {
-+ int concLvl = Runtime.getRuntime().availableProcessors();
-
-- IgniteCompute compute = grid(0).compute().withAsync();
-+ mCfg.setConcurrencyLevel(concLvl);
-+ mCfg.setPageCacheSize(1024 * 1024 * concLvl); //minimal possible value
-+ }
-
-- ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCnt];
-+ /**
-+ * @return Test duration in seconds.
-+ */
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected int gridCount() {
-+ return 1;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected boolean indexingEnabled() {
-+ return false;
-+ }
-
-- for (int i = 0; i < tasksCnt; i++) {
-- compute.run(new IgniteRunnable() {
-- @IgniteInstanceResource
-- private Ignite ig;
-+ /** {@inheritDoc} */
-+ @Override protected long getTestTimeout() {
-+ return (duration() + 1) * 1000;
-+ }
-
-- @Override
-- public void run() {
-- int i = 0;
-- while (System.nanoTime() < end) {
-- operation((IgniteEx) ig);
-+ /**
-+ * @param ig Ignite instance.
-+ * @return IgniteCache.
-+ */
-+ protected abstract IgniteCache<Object,Object> cache(IgniteEx ig);
-+
-+ /**
-+ * @return Cache key to perform an operation.
-+ */
-+ protected abstract Object key();
-+
-+ /**
-+ * @return Cache value to perform an operation.
-+ * @param key Cache key to perform an operation.
-+ */
-+ protected abstract Object value(Object key);
-+
-+ /**
-+ * @param cache IgniteCache.
-+ */
-+ protected void operation(IgniteCache<Object, Object> cache) {
-+ Object key = key();
-+ Object value = value(key);
-+
-+ switch (getRandom().nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, value);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-
-- if(i++ == 100) {
-- check((IgniteEx) ig);
-- i = 0;
-- }
-+ /**
-+ * @return Random.
-+ */
-+ @NotNull protected static Random getRandom() {
-+ Random rnd = THREAD_LOCAL_RANDOM.get();
-+
-+ if(rnd == null){
-+ rnd = new GridRandom();
-+ THREAD_LOCAL_RANDOM.set(rnd);
-+ }
-+
-+ return rnd;
-+ }
-+
-+ /**
-+ * @throws Exception If failed.
-+ */
-+ public void testMemoryLeak() throws Exception {
-+ final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+
-+ final IgniteEx ignite = grid(0);
-+ final IgniteCache<Object, Object> cache = cache(ignite);
-+
-+ Runnable target = new Runnable() {
-+ @Override public void run() {
-+ while (ex == null && System.nanoTime() < end) {
-+ try {
-+ operation(cache);
-+ check(ignite);
-+ }
-+ catch (Exception e) {
-+ ex = e;
-+
-+ break;
- }
- }
-- });
-+ }
-+ };
-+
-+ Thread[] threads = new Thread[Runtime.getRuntime().availableProcessors()];
-
-- futs[i] = compute.future();
-+ for (int i = 0; i < threads.length; i++) {
-+ threads[i] = new Thread(target);
-+ threads[i].start();
- }
-
-- for (ComputeTaskFuture fut : futs)
-- fut.get();
-+ for (Thread thread : threads) {
-+ thread.join();
-+ }
-+
-+ if(ex != null){
-+ throw ex;
-+ }
- }
-
-- protected void check(IgniteEx ig) {}
-+ /**
-+ * Callback to check the current state
-+ *
-+ * @param ig Ignite instance
-+ * @throws Exception If failed.
-+ */
-+ protected void check(IgniteEx ig) throws Exception {
-+ }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-index db77131..acc6c2f 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -17,72 +17,13 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
--import org.apache.ignite.internal.IgniteEx;
--
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
--public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-- }
-+public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakTest {
-
-- @Override
-- // TODO: move test to module ignite-indexing.
-- protected boolean indexingEnabled() {
-+ /** {@inheritDoc} */
-+ @Override protected boolean indexingEnabled() {
- return true;
- }
--
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- // TODO: also execute sql queries.
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
--
-- assertTrue(pages < 19100);
-- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index 2a6c8cd..8943743 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -18,13 +18,8 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
-@@ -35,62 +30,29 @@
- static {
- ARRAY = new int[1024];
-
-- Random rnd = new Random();
--
- for (int i = 0; i < ARRAY.length; i++)
-- ARRAY[i] = rnd.nextInt();
-- }
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-+ ARRAY[i] = getRandom().nextInt();
- }
-
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-+ /** {@inheritDoc} */
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive");
- }
-
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(60 * 1024 * 1024);
-+ /** {@inheritDoc} */
-+ @Override protected Object key() {
-+ return new DbKey(getRandom().nextInt(200_000));
- }
-
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("large");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- LargeDbKey key = new LargeDbKey(rnd.nextInt(10_000), 1024);
--
-- LargeDbValue v0 = new LargeDbValue("test-value-1-" + rnd.nextInt(200), "test-value-2-" + rnd.nextInt(200), ARRAY);
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-+ /** {@inheritDoc} */
-+ @Override protected Object value(Object key) {
-+ return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
- }
-
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 50000);
-+ assertTrue(pages < 20000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-index 91c96af..8e4d0b4 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -17,76 +17,31 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
--public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
-+public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakTest {
-
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
-+ /** {@inheritDoc} */
-+ @Override protected void configure(MemoryConfiguration mCfg) {
-+ int concLvl = Runtime.getRuntime().availableProcessors();
-+ mCfg.setConcurrencyLevel(concLvl);
-+ mCfg.setPageCacheSize(1024 * 1024 * concLvl * 16);
-
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
- }
-
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- // TODO: understand why such overhead with large pages.
-- mCfg.setPageCacheSize(100 * 1024 * 1024);
-- }
--
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- @Override
-- protected boolean isLargePage() {
-+ /** {@inheritDoc} */
-+ @Override protected boolean isLargePage() {
- return true;
- }
-
-- // TODO: avoid copy/paste.
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 4600);
-+ assertTrue(pages < 4000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-index 2b0ce1e..81d831b 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -18,72 +18,31 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
- public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
- /** {@inheritDoc} */
-- @Override protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive");
- }
-
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-+ /** {@inheritDoc} */
-+ @Override protected Object key() {
-+ return new DbKey(getRandom().nextInt(200_000));
- }
-
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- // TODO: also execute scan query.
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- break;
--
-- case 1:
-- cache.get(key);
-- break;
--
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-+ /** {@inheritDoc} */
-+ @Override protected Object value(Object key) {
-+ return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
- }
-
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 19100);
-+ assertTrue(pages < 20000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-index 95fe8c8..a31ffb4 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -18,75 +18,31 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
- import javax.cache.expiry.CreatedExpiryPolicy;
- import javax.cache.expiry.Duration;
- import javax.cache.expiry.ExpiryPolicy;
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
-
- import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
- /**
- *
- */
--public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
-+public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakTest {
- /** */
- private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-
-- @Override
-- protected int duration() {
-- return 300;
-+ /** {@inheritDoc} */
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
- }
-
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-- }
--
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- protected void operation(IgniteEx ig) {
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 10000);
-+ assertTrue(pages < 7000);
- }
- }
-
-From 84c03e0c522abc90b2d91e514138eac08388abd2 Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Thu, 16 Feb 2017 13:41:51 +0300
-Subject: [PATCH 04/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory (pending)
-
----
- .../database/IgniteDbMemoryLeakAbstractTest.java | 118 +++++++++++++++++----
- .../database/IgniteDbMemoryLeakIndexedTest.java | 29 -----
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 16 +--
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 13 +--
- .../database/IgniteDbMemoryLeakTest.java | 14 ++-
- .../IgniteDbMemoryLeakWithExpirationTest.java | 7 +-
- .../database/IgniteDbMemoryLeakIndexedTest.java | 42 ++++++++
- 7 files changed, 165 insertions(+), 74 deletions(-)
- delete mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
- create mode 100644 modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index bca3af0..819405e 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -30,13 +30,37 @@
- * Base class for memory leaks tests.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
--
-+ /** */
-+ @SuppressWarnings("WeakerAccess") protected static final int CONCURRENCY_LEVEL = 8;
- /** */
- private volatile Exception ex = null;
-
- /** */
-+ private long warmUpEndTime;
-+
-+ /** */
-+ private long endTime;
-+
-+ /** */
-+ private long loadedPages = 0;
-+
-+ /** */
-+ private long delta = 0;
-+
-+ /** */
-+ private long probeCnt = 0;
-+
-+ /** */
- private static final ThreadLocal<Random> THREAD_LOCAL_RANDOM = new ThreadLocal<>();
-
-+ @Override protected void beforeTest() throws Exception {
-+ super.beforeTest();
-+
-+ long startTime = System.nanoTime();
-+ warmUpEndTime = startTime + TimeUnit.SECONDS.toNanos(warmUp());
-+ endTime = warmUpEndTime + TimeUnit.SECONDS.toNanos(duration());
-+ }
-+
- /** {@inheritDoc} */
- @Override protected void configure(IgniteConfiguration cfg) {
- cfg.setMetricsLogFrequency(5000);
-@@ -44,10 +68,7 @@
-
- /** {@inheritDoc} */
- @Override protected void configure(MemoryConfiguration mCfg) {
-- int concLvl = Runtime.getRuntime().availableProcessors();
--
-- mCfg.setConcurrencyLevel(concLvl);
-- mCfg.setPageCacheSize(1024 * 1024 * concLvl); //minimal possible value
-+ mCfg.setConcurrencyLevel(CONCURRENCY_LEVEL);
- }
-
- /**
-@@ -57,6 +78,13 @@ protected int duration() {
- return 300;
- }
-
-+ /**
-+ * @return Warm up duration.
-+ */
-+ @SuppressWarnings("WeakerAccess") protected int warmUp() {
-+ return 300;
-+ }
-+
- /** {@inheritDoc} */
- @Override protected int gridCount() {
- return 1;
-@@ -69,14 +97,14 @@ protected int duration() {
-
- /** {@inheritDoc} */
- @Override protected long getTestTimeout() {
-- return (duration() + 1) * 1000;
-+ return (warmUp() + duration() + 1) * 1000; // One extra second to stop all threads
- }
-
- /**
- * @param ig Ignite instance.
- * @return IgniteCache.
- */
-- protected abstract IgniteCache<Object,Object> cache(IgniteEx ig);
-+ protected abstract IgniteCache<Object, Object> cache(IgniteEx ig);
-
- /**
- * @return Cache key to perform an operation.
-@@ -84,8 +112,8 @@ protected int duration() {
- protected abstract Object key();
-
- /**
-- * @return Cache value to perform an operation.
- * @param key Cache key to perform an operation.
-+ * @return Cache value to perform an operation.
- */
- protected abstract Object value(Object key);
-
-@@ -99,8 +127,11 @@ protected void operation(IgniteCache<Object, Object> cache) {
- switch (getRandom().nextInt(3)) {
- case 0:
- cache.getAndPut(key, value);
-+
-+ break;
- case 1:
- cache.get(key);
-+
- break;
- case 2:
- cache.getAndRemove(key);
-@@ -113,7 +144,7 @@ protected void operation(IgniteCache<Object, Object> cache) {
- @NotNull protected static Random getRandom() {
- Random rnd = THREAD_LOCAL_RANDOM.get();
-
-- if(rnd == null){
-+ if (rnd == null) {
- rnd = new GridRandom();
- THREAD_LOCAL_RANDOM.set(rnd);
- }
-@@ -125,49 +156,96 @@ protected void operation(IgniteCache<Object, Object> cache) {
- * @throws Exception If failed.
- */
- public void testMemoryLeak() throws Exception {
-- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-
- final IgniteEx ignite = grid(0);
- final IgniteCache<Object, Object> cache = cache(ignite);
-
- Runnable target = new Runnable() {
- @Override public void run() {
-- while (ex == null && System.nanoTime() < end) {
-+ while (ex == null && System.nanoTime() < endTime) {
- try {
- operation(cache);
-- check(ignite);
- }
- catch (Exception e) {
- ex = e;
--
- break;
- }
- }
- }
- };
-
-- Thread[] threads = new Thread[Runtime.getRuntime().availableProcessors()];
-+ Thread[] threads = new Thread[CONCURRENCY_LEVEL];
-+
-+ info("Warming up is started.");
-
- for (int i = 0; i < threads.length; i++) {
- threads[i] = new Thread(target);
- threads[i].start();
- }
-
-- for (Thread thread : threads) {
-- thread.join();
-+ Thread.sleep(TimeUnit.NANOSECONDS.toMillis(warmUpEndTime - System.nanoTime()));
-+
-+ info("Warming up is ended.");
-+
-+ while (System.nanoTime() < endTime) {
-+ try {
-+ check(ignite);
-+ }
-+ catch (Exception e) {
-+ ex = e;
-+
-+ break;
-+ }
-+
-+ Thread.sleep(TimeUnit.SECONDS.toMillis(5));
- }
-
-- if(ex != null){
-+ for (Thread thread : threads)
-+ thread.join();
-+
-+ if (ex != null)
- throw ex;
-- }
- }
-
- /**
-- * Callback to check the current state
-+ * Callback to check the current state.
- *
-- * @param ig Ignite instance
-+ * @param ig Ignite instance.
- * @throws Exception If failed.
- */
- protected void check(IgniteEx ig) throws Exception {
-+ long pagesActual = ig.context().cache().context().database().pageMemory().loadedPages();
-+ long pagesMax = pagesMax();
-+
-+ assertTrue(
-+ "Maximal allowed pages number is exceeded. [allowed=" + pagesMax + "; actual= " + pagesActual + "]",
-+ pagesActual <= pagesMax);
-+
-+ if (loadedPages > 0) {
-+ delta += pagesActual - loadedPages;
-+ int allowedDelta = pagesDelta();
-+
-+ if(probeCnt++ > 12) { // we need some statistic first. Minimal statistic is taken for a minute.
-+ long actualDelta = delta / probeCnt;
-+
-+ assertTrue(
-+ "Average growth pages in the number is more than expected. [allowed=" + allowedDelta + "; actual=" + actualDelta + "]",
-+ actualDelta <= allowedDelta);
-+ }
-+ }
-+
-+ loadedPages = pagesActual;
-+ }
-+
-+ /**
-+ * @return Maximal allowed pages number.
-+ */
-+ protected abstract long pagesMax();
-+
-+ /**
-+ * @return Expected average number of pages, on which their total number can grow per 5 seconds.
-+ */
-+ @SuppressWarnings("WeakerAccess") protected int pagesDelta() {
-+ return 5;
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-deleted file mode 100644
-index acc6c2f..0000000
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ /dev/null
-@@ -1,29 +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.database;
--
--/**
-- *
-- */
--public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakTest {
--
-- /** {@inheritDoc} */
-- @Override protected boolean indexingEnabled() {
-- return true;
-- }
--}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index 8943743..c1b1c9b 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -36,23 +36,25 @@
-
- /** {@inheritDoc} */
- @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-- return ig.cache("non-primitive");
-+ return ig.cache("large");
- }
-
- /** {@inheritDoc} */
- @Override protected Object key() {
-- return new DbKey(getRandom().nextInt(200_000));
-+ return new LargeDbKey(getRandom().nextInt(10_000), 1024);
- }
-
- /** {@inheritDoc} */
- @Override protected Object value(Object key) {
-- return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
-+ return new LargeDbValue("test-value-1-" + getRandom().nextInt(200), "test-value-2-" + getRandom().nextInt(200), ARRAY);
-
<TRUNCATED>
[28/50] [abbrv] ignite git commit: Merge-related fixes
Posted by ag...@apache.org.
Merge-related fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/21dcef20
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/21dcef20
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/21dcef20
Branch: refs/heads/master
Commit: 21dcef207f7bc2beab7fa50a4346b2a33fd34611
Parents: 5f72451
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:43:10 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:43:10 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/21dcef20/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 6f9b401..b94b464 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -110,11 +110,8 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePar
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheRendezvousAffinityClientSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheStoreUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearOffheapCacheStoreUpdateTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NearCacheSyncUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NoneRebalanceModeSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEvictionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedJobExecutionTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicBasicStoreSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicGetAndTransformStoreSelfTest;
@@ -178,7 +175,6 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(RendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(RendezvousAffinityFunctionFastPowerOfTwoHashSelfTest.class));
suite.addTest(new TestSuite(RendezvousAffinityFunctionStandardHashSelfTest.class));
- suite.addTest(new TestSuite(FairAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedBasicOpSelfTest.class));
[20/50] [abbrv] ignite git commit: Fix for C++
Posted by ag...@apache.org.
Fix for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50f9f161
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50f9f161
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50f9f161
Branch: refs/heads/master
Commit: 50f9f1612d6f2b3d2f9ee1a2bd4cac3402673753
Parents: 06cee57
Author: Igor Sapego <is...@gridgain.com>
Authored: Tue Apr 11 21:51:30 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Tue Apr 11 21:51:30 2017 +0300
----------------------------------------------------------------------
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++++++---
.../core/include/ignite/impl/module_manager.h | 26 ++++++++++++++++++++
.../examples/include/ignite/examples/person.h | 1 -
3 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index e09b403..2d1a2ee 100644
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@ -373,6 +373,13 @@ void CheckEvents(Cache<int, TestEntry>& cache, Listener<int, TestEntry>& lsnr)
lsnr.CheckNextEvent(1, TestEntry(20), boost::none);
}
+IGNITE_EXPORTED_CALL void IgniteModuleInit0(ignite::IgniteBindingContext& context)
+{
+ IgniteBinding binding = context.GetBingding();
+
+ binding.RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
+}
+
BOOST_FIXTURE_TEST_SUITE(ContinuousQueryTestSuite, ContinuousQueryTestSuiteFixture)
BOOST_AUTO_TEST_CASE(TestBasic)
@@ -679,8 +686,6 @@ BOOST_AUTO_TEST_CASE(TestPublicPrivateConstantsConsistence)
BOOST_AUTO_TEST_CASE(TestFilterSingleNode)
{
- node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
-
Listener<int, TestEntry> lsnr;
RangeFilter<int, TestEntry> filter(100, 150);
@@ -726,8 +731,6 @@ BOOST_AUTO_TEST_CASE(TestFilterMultipleNodes)
Ignite node3 = ignite_test::StartNode("cache-query-continuous.xml", "node-03");
#endif
- node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
-
Listener<int, TestEntry> lsnr;
RangeFilter<int, TestEntry> filter(100, 150);
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
index 55e6943..1f9783e 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
@@ -19,6 +19,7 @@
#define _IGNITE_IMPL_MODULE_MANAGER
#include <vector>
+#include <sstream>
#include <ignite/common/common.h>
#include <ignite/common/dynamic_load_os.h>
@@ -30,6 +31,11 @@
*/
#define IGNITE_MODULE_INIT_CALLBACK_NAME "IgniteModuleInit"
+/**
+ * Max number of additional init callbacks
+ */
+#define IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM 100
+
#define IGNITE_EXPORTED_CALL \
extern "C" IGNITE_IMPORT_EXPORT
@@ -102,6 +108,16 @@ namespace ignite
if (callback)
callback(bindingContext);
+
+ for (int i = 0; i < IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM; ++i)
+ {
+ ModuleInitCallback* callback0 = GetAdditionalModuleInitCallback(module, i);
+
+ if (!callback0)
+ break;
+
+ callback0(bindingContext);
+ }
}
private:
@@ -119,6 +135,16 @@ namespace ignite
module.FindSymbol(IGNITE_MODULE_INIT_CALLBACK_NAME));
}
+ static ModuleInitCallback* GetAdditionalModuleInitCallback(Module& module, int num)
+ {
+ std::stringstream tmp;
+
+ tmp << IGNITE_MODULE_INIT_CALLBACK_NAME << num;
+
+ return reinterpret_cast<ModuleInitCallback*>(
+ module.FindSymbol(tmp.str()));
+ }
+
/** Collection of loaded modules. */
std::vector<Module> loadedModules;
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/examples/include/ignite/examples/person.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h
index 86c51c8..64693a9 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/person.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h
@@ -79,7 +79,6 @@ namespace ignite
IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_GET_HASH_CODE_ZERO(Person)
IGNITE_BINARY_IS_NULL_FALSE(Person)
IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
[47/50] [abbrv] ignite git commit: Merge-related fix for C++
Posted by ag...@apache.org.
Merge-related fix for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02427284
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02427284
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02427284
Branch: refs/heads/master
Commit: 024272844e6507482c2bee4bbb0cfdfa993fbe5e
Parents: 2c4ef9e
Author: Igor Sapego <is...@gridgain.com>
Authored: Thu Apr 13 18:18:43 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Thu Apr 13 18:18:43 2017 +0300
----------------------------------------------------------------------
.../core-test/include/ignite/binary_test_defs.h | 10 ++++----
.../cpp/core-test/src/continuous_query_test.cpp | 2 +-
.../examples/include/ignite/examples/address.h | 26 +++++++++-----------
.../include/ignite/examples/organization.h | 26 +++++++++-----------
.../examples/include/ignite/examples/person.h | 16 ++++++------
5 files changed, 37 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
index 6c2bde7..9d7dcd2 100644
--- a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
+++ b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
@@ -158,7 +158,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryInner& obj)
+ static bool IsNull(const gt::BinaryInner& obj)
{
return false;
}
@@ -197,7 +197,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryInner& obj)
+ static bool IsNull(const gt::BinaryInner& obj)
{
return obj.GetValue() == 0;
}
@@ -238,7 +238,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryOuter& obj)
+ static bool IsNull(const gt::BinaryOuter& obj)
{
return obj.GetValue() == 0 && obj.GetInner().GetValue();
}
@@ -281,7 +281,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryFields& obj)
+ static bool IsNull(const gt::BinaryFields& obj)
{
return false;
}
@@ -334,7 +334,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::PureRaw& obj)
+ static bool IsNull(const gt::PureRaw& obj)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index ea3d665..e092728 100644
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@ -295,7 +295,7 @@ namespace ignite
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- bool IsNull(const RangeFilter<K,V>&)
+ static bool IsNull(const RangeFilter<K,V>&)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/address.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/address.h b/modules/platforms/cpp/examples/include/ignite/examples/address.h
index b19fb4d..6a06f60 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/address.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/address.h
@@ -59,48 +59,46 @@ namespace ignite
template<>
struct BinaryType<ignite::examples::Address>
{
- int32_t GetTypeId()
+ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("Address");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "Address";
+ dst = "Address";
}
- int32_t GetFieldId(const char* name)
+ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
- int32_t GetHashCode(ignite::examples::Address obj)
+ static int32_t GetHashCode(ignite::examples::Address obj)
{
return 0;
}
- bool IsNull(ignite::examples::Address obj)
+ static bool IsNull(ignite::examples::Address obj)
{
return false;
}
- ignite::examples::Address GetNull()
+ static void GetNull(ignite::examples::Address& dst)
{
- return ignite::examples::Address("", 0);
+ dst = ignite::examples::Address("", 0);
}
- void Write(BinaryWriter& writer, ignite::examples::Address obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Address& obj)
{
writer.WriteString("street", obj.street);
writer.WriteInt32("zip", obj.zip);
}
- ignite::examples::Address Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Address& dst)
{
- std::string street = reader.ReadString("street");
- int zip = reader.ReadInt32("zip");
-
- return ignite::examples::Address(street, zip);
+ dst.street = reader.ReadString("street");
+ dst.zip = reader.ReadInt32("zip");
}
};
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/organization.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/organization.h b/modules/platforms/cpp/examples/include/ignite/examples/organization.h
index e819d69..942897d 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/organization.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/organization.h
@@ -68,48 +68,46 @@ namespace ignite
template<>
struct BinaryType<ignite::examples::Organization>
{
- int32_t GetTypeId()
+ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("Organization");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "Organization";
+ dst = "Organization";
}
- int32_t GetFieldId(const char* name)
+ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
- int32_t GetHashCode(ignite::examples::Organization obj)
+ static int32_t GetHashCode(ignite::examples::Organization obj)
{
return 0;
}
- bool IsNull(ignite::examples::Organization obj)
+ static bool IsNull(ignite::examples::Organization obj)
{
return false;
}
- ignite::examples::Organization GetNull()
+ static void GetNull(ignite::examples::Organization& dst)
{
- return ignite::examples::Organization("", ignite::examples::Address());
+ dst = ignite::examples::Organization("", ignite::examples::Address());
}
- void Write(BinaryWriter& writer, ignite::examples::Organization obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Organization& obj)
{
writer.WriteString("name", obj.name);
writer.WriteObject<ignite::examples::Address>("addr", obj.addr);
}
- ignite::examples::Organization Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Organization& dst)
{
- std::string name = reader.ReadString("name");
- ignite::examples::Address addr = reader.ReadObject<ignite::examples::Address>("addr");
-
- return ignite::examples::Organization(name, addr);
+ dst.name = reader.ReadString("name");
+ dst.addr = reader.ReadObject<ignite::examples::Address>("addr");
}
};
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/person.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h
index 64693a9..9a87ef2 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/person.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h
@@ -82,7 +82,7 @@ namespace ignite
IGNITE_BINARY_IS_NULL_FALSE(Person)
IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
- void Write(BinaryWriter& writer, ignite::examples::Person obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Person& obj)
{
writer.WriteInt64("orgId", obj.orgId);
writer.WriteString("firstName", obj.firstName);
@@ -91,15 +91,13 @@ namespace ignite
writer.WriteDouble("salary", obj.salary);
}
- ignite::examples::Person Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Person& dst)
{
- int64_t orgId = reader.ReadInt64("orgId");
- std::string firstName = reader.ReadString("firstName");
- std::string lastName = reader.ReadString("lastName");
- std::string resume = reader.ReadString("resume");
- double salary = reader.ReadDouble("salary");
-
- return ignite::examples::Person(orgId, firstName, lastName, resume, salary);
+ dst.orgId = reader.ReadInt64("orgId");
+ dst.firstName = reader.ReadString("firstName");
+ dst.lastName = reader.ReadString("lastName");
+ dst.resume = reader.ReadString("resume");
+ dst.salary = reader.ReadDouble("salary");
}
IGNITE_BINARY_TYPE_END
[02/50] [abbrv] ignite git commit: HashIDX on client is allowed in
case if client is affinity node
Posted by ag...@apache.org.
HashIDX on client is allowed in case if client is affinity node
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3e86c511
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3e86c511
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3e86c511
Branch: refs/heads/master
Commit: 3e86c511b0aef0d4edc75e411be98c8b56b6b0a4
Parents: 085c612
Author: Sergey Chugunov <se...@gmail.com>
Authored: Thu Apr 6 19:21:07 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Tue Apr 11 14:38:26 2017 +0300
----------------------------------------------------------------------
.../processors/query/h2/IgniteH2Indexing.java | 15 +++++++++------
.../processors/query/h2/opt/GridH2Table.java | 15 ++++++++++++---
2 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3e86c511/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 725e742..5f2d8c0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -2868,11 +2868,14 @@ public class IgniteH2Indexing implements GridQueryIndexing {
int cacheId = CU.cacheId(schema.ccfg.getName());
- idxs.add(createHashIndex(
- cacheId,
- "_key_PK_hash",
- tbl,
- treeIndexColumns(new ArrayList<IndexColumn>(2), keyCol, affCol)));
+ Index hashIdx = createHashIndex(
+ cacheId,
+ "_key_PK_hash",
+ tbl,
+ treeIndexColumns(new ArrayList<IndexColumn>(2), keyCol, affCol));
+
+ if (hashIdx != null)
+ idxs.add(hashIdx);
// Add primary key index.
idxs.add(createSortedIndex(
@@ -3002,7 +3005,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
return pkHashIdx;
}
- return new GridH2TreeIndex(name, tbl, true, cols);
+ return null;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/3e86c511/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index 89a010d..94c8843 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -149,10 +149,13 @@ public class GridH2Table extends TableBase {
idxs = idxsFactory.createIndexes(this);
assert idxs != null;
- assert idxs.size() >= 2;
// Add scan index at 0 which is required by H2.
- idxs.add(0, new ScanIndex(index(1), index(0)));
+ if (idxs.size() >= 2
+ && index(0).getIndexType().isHash())
+ idxs.add(0, new ScanIndex(index(1), index(0)));
+ else
+ idxs.add(0, new ScanIndex(index(0), null));
snapshotEnabled = desc == null || desc.snapshotableIndex();
@@ -927,7 +930,13 @@ public class GridH2Table extends TableBase {
*
*/
@Override protected GridH2IndexBase delegate() {
- return rebuildFromHashInProgress ? hashIdx : super.delegate();
+ if (hashIdx != null)
+ return rebuildFromHashInProgress ? hashIdx : super.delegate();
+ else {
+ assert !rebuildFromHashInProgress;
+
+ return super.delegate();
+ }
}
/** {@inheritDoc} */
[09/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fef28344
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fef28344
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fef28344
Branch: refs/heads/master
Commit: fef2834495cc2c7245dfb0282f8411f7651b1887
Parents: 4ae084d d69a594
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Tue Apr 11 16:45:37 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Tue Apr 11 16:45:37 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtLocalPartition.java | 14 ++++++++------
.../distributed/dht/preloader/GridDhtPreloader.java | 4 ++--
.../eviction/paged/PageEvictionWithRebalanceTest.java | 6 +++---
3 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
[16/50] [abbrv] ignite git commit: IGNITE-4534: Detailed javadocs
added + Tests now run faster
Posted by ag...@apache.org.
IGNITE-4534: Detailed javadocs added + Tests now run faster
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/03903918
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/03903918
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/03903918
Branch: refs/heads/master
Commit: 0390391870c759e1c5d65605b94a9bcbf3e9e67c
Parents: d69a594
Author: Ivan Rakov <iv...@gmail.com>
Authored: Tue Apr 11 19:06:54 2017 +0300
Committer: Ivan Rakov <iv...@gmail.com>
Committed: Tue Apr 11 19:06:54 2017 +0300
----------------------------------------------------------------------
.../configuration/DataPageEvictionMode.java | 16 ++++++++++++++--
.../configuration/MemoryPolicyConfiguration.java | 18 ++++++++++++------
.../eviction/paged/PageEvictionAbstractTest.java | 4 ++--
.../eviction/paged/PageEvictionMultinodeTest.java | 4 ++--
.../paged/PageEvictionReadThroughTest.java | 2 +-
5 files changed, 31 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/03903918/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java
index bada68e..da3dbdf 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java
@@ -24,9 +24,21 @@ public enum DataPageEvictionMode {
/** Disabled. */
DISABLED,
- /** Random lru. */
+ /**
+ * Random-LRU algorithm. In a nutshell:
+ * 1) During memory policy initialization, off-heap array is allocated to track timestamp of last usage for each
+ * data page.
+ * 2) When data page on address X is accessed, current timestamp is stored in X / PAGE_SIZE array position.
+ * 3) When there's a need for eviction, we randomly choose 5 indices of array (if some of indices point to
+ * non-data pages, re-choose them) and evict data page with minimum timestamp.
+ */
RANDOM_LRU,
- /** Random 2-lru. */
+ /**
+ * Random-2-LRU algorithm. Scan-resistant version of Random-LRU. The only difference is that we store two
+ * previous timestamps for each data page, and choose minimum between "older" timestamps. LRU-2 outperforms LRU by
+ * resolving "one-hit wonder" problem: if page is accessed very rarely, but accidentally accessed once, it's
+ * protected from eviction for long time.
+ */
RANDOM_2_LRU
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/03903918/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
index d6203c6..6fe373d 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
@@ -17,10 +17,9 @@
package org.apache.ignite.configuration;
import java.io.Serializable;
+import org.apache.ignite.internal.mem.OutOfMemoryException;
import org.apache.ignite.internal.pagemem.PageMemory;
import org.apache.ignite.internal.processors.cache.database.MemoryPolicy;
-import org.apache.ignite.internal.processors.cache.database.freelist.FreeList;
-import org.apache.ignite.internal.processors.cache.database.tree.io.DataPageIO;
/**
* Configuration bean used for creating {@link MemoryPolicy} instances.
@@ -48,12 +47,19 @@ public final class MemoryPolicyConfiguration implements Serializable {
/** Algorithm for per-page eviction. If {@link DataPageEvictionMode#DISABLED} set, eviction is not performed. */
private DataPageEvictionMode pageEvictionMode = DataPageEvictionMode.DISABLED;
- /** Allocation of new {@link DataPageIO} pages is stopped when this percentage of pages are allocated. */
+ /** Threshold for per-page eviction.
+ * When this percentage of memory pages of the current policy is allocated (90% by default),
+ * system starts page eviction.
+ * Decrease this parameter if {@link OutOfMemoryException} occurred with enabled page eviction.
+ */
private double evictionThreshold = 0.9;
- /** Allocation of new {@link DataPageIO} pages is stopped by maintaining this amount of empty pages in
- * corresponding {@link FreeList} bucket. Pages get into the bucket through evicting all data entries one by one.
- * Higher load and contention require larger pool size.
+ /** When {@link #evictionThreshold} is reached, allocation of new data pages is prevented by maintaining this
+ * amount of evicted data pages in the pool. If any thread needs free page to store cache entry,
+ * it will take empty page from the pool instead of allocating a new one.
+ * Increase this parameter if cache can contain very big entries (total size of pages in the pool should be enough
+ * to contain largest cache entry).
+ * Increase this parameter if {@link OutOfMemoryException} occurred with enabled page eviction.
*/
private int emptyPagesPoolSize = 100;
http://git-wip-us.apache.org/repos/asf/ignite/blob/03903918/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
index bf05146..20edd4e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
@@ -38,13 +38,13 @@ public class PageEvictionAbstractTest extends GridCommonAbstractTest {
protected static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
/** Offheap size for memory policy. */
- private static final int SIZE = 256 * 1024 * 1024;
+ private static final int SIZE = 96 * 1024 * 1024;
/** Page size. */
static final int PAGE_SIZE = 2048;
/** Number of entries. */
- static final int ENTRIES = 400_000;
+ static final int ENTRIES = 80_000;
/** Empty pages pool size. */
private static final int EMPTY_PAGES_POOL_SIZE = 100;
http://git-wip-us.apache.org/repos/asf/ignite/blob/03903918/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java
index 2302de1..7a58dd4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeTest.java
@@ -102,8 +102,8 @@ public abstract class PageEvictionMultinodeTest extends PageEvictionAbstractTest
System.out.println(">>> Resulting size: " + resultingSize);
- // More than half of entries evicted, no OutOfMemory occurred, success.
- assertTrue(resultingSize < ENTRIES / 2);
+ // Eviction started, no OutOfMemory occurred, success.
+ assertTrue(resultingSize < ENTRIES);
ignite(0).destroyCache(cfg.getName());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/03903918/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionReadThroughTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionReadThroughTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionReadThroughTest.java
index c8cd7c9..ff71361 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionReadThroughTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionReadThroughTest.java
@@ -73,7 +73,7 @@ public class PageEvictionReadThroughTest extends PageEvictionAbstractTest {
* @throws Exception If failed.
*/
private void testEvictionWithReadThrough(CacheAtomicityMode atomicityMode, CacheMode cacheMode) throws Exception {
- startGridsMultiThreaded(4);
+ startGrid(0);
CacheConfiguration<Object, Object> cfg = cacheConfig("evict-rebalance", null, cacheMode, atomicityMode,
CacheWriteSynchronizationMode.PRIMARY_SYNC);
[23/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3e5e1f01
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3e5e1f01
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3e5e1f01
Branch: refs/heads/master
Commit: 3e5e1f01af8eb68cd69d7c1922c07fe367777ae7
Parents: 81e7538 7883668
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:07:44 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:07:44 2017 +0300
----------------------------------------------------------------------
.../configuration/DataPageEvictionMode.java | 16 +++-
.../MemoryPolicyConfiguration.java | 18 ++--
.../processors/cache/GridCacheContext.java | 2 -
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/preloader/GridDhtPreloader.java | 6 +-
.../core/src/test/config/spring-multicache.xml | 16 ++++
.../IgniteCacheTopologySafeGetSelfTest.java | 2 +-
.../paged/PageEvictionAbstractTest.java | 4 +-
.../paged/PageEvictionMultinodeTest.java | 4 +-
.../paged/PageEvictionReadThroughTest.java | 2 +-
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++-
.../core/include/ignite/impl/module_manager.h | 26 ++++++
.../examples/include/ignite/examples/person.h | 1 -
.../Cache/CacheMetricsTest.cs | 86 +++++++++-----------
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 ------------------
.../Impl/Cache/CacheMetricsImpl.cs | 60 --------------
16 files changed, 125 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
[27/50] [abbrv] ignite git commit: Merge remote-tracking branch
'upstream/master' into ignite-3477-master
Posted by ag...@apache.org.
Merge remote-tracking branch 'upstream/master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5f724512
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5f724512
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5f724512
Branch: refs/heads/master
Commit: 5f724512a9997d8e2b2a4ec7d482772fbeb741a3
Parents: 7883668 775c6e5
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:40:11 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:40:11 2017 +0300
----------------------------------------------------------------------
.gitignore | 31 +-
examples/pom.xml | 6 +
.../examples/springdata/PersonRepository.java | 59 ++++
.../examples/springdata/SpringAppCfg.java | 69 ++++
.../examples/springdata/SpringDataExample.java | 154 +++++++++
.../examples/SpringDataExampleSelfTest.java | 32 ++
.../testsuites/IgniteExamplesSelfTestSuite.java | 2 +
.../rendezvous/RendezvousAffinityFunction.java | 26 +-
.../datastructures/GridCacheSemaphoreImpl.java | 74 ++++-
.../datastructures/GridCacheSemaphoreState.java | 22 ++
...inityFunctionFastPowerOfTwoHashSelfTest.java | 50 +++
...ousAffinityFunctionStandardHashSelfTest.java | 50 +++
...eAbstractDataStructuresFailoverSelfTest.java | 21 +-
.../testsuites/IgniteCacheTestSuite2.java | 8 +
.../binary/include/ignite/binary/binary_type.h | 127 +++----
.../ignite/impl/binary/binary_id_resolver.h | 33 +-
.../ignite/impl/binary/binary_object_impl.h | 3 +-
.../ignite/impl/binary/binary_reader_impl.h | 80 ++++-
.../include/ignite/impl/binary/binary_utils.h | 6 +-
.../ignite/impl/binary/binary_writer_impl.h | 15 +-
.../core-test/include/ignite/binary_test_defs.h | 95 +++---
.../cpp/core-test/include/ignite/complex_type.h | 30 +-
.../cpp/core-test/include/ignite/test_type.h | 37 +--
.../src/binary_identity_resolver_test.cpp | 38 +--
.../cpp/core-test/src/binary_object_test.cpp | 4 +-
.../cpp/core-test/src/binary_test_defs.cpp | 5 +
.../cpp/core-test/src/cache_invoke_test.cpp | 18 +-
.../cpp/core-test/src/cache_query_test.cpp | 12 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 36 +-
.../cpp/core-test/src/continuous_query_test.cpp | 30 +-
.../cpp/core/include/ignite/ignite_binding.h | 6 +-
.../impl/cache/cache_entry_processor_holder.h | 33 +-
.../cpp/odbc-test/include/complex_type.h | 26 +-
.../platforms/cpp/odbc-test/include/test_type.h | 37 +--
modules/spring-data/README.txt | 32 ++
modules/spring-data/licenses/apache-2.0.txt | 202 ++++++++++++
modules/spring-data/pom.xml | 79 +++++
.../springdata/repository/IgniteRepository.java | 58 ++++
.../config/EnableIgniteRepositories.java | 119 +++++++
.../config/IgniteRepositoriesRegistar.java | 36 ++
.../IgniteRepositoryConfigurationExtension.java | 49 +++
.../springdata/repository/config/Query.java | 37 +++
.../repository/config/RepositoryConfig.java | 39 +++
.../repository/config/package-info.java | 22 ++
.../springdata/repository/package-info.java | 22 ++
.../repository/query/IgniteQuery.java | 83 +++++
.../repository/query/IgniteQueryGenerator.java | 243 ++++++++++++++
.../repository/query/IgniteRepositoryQuery.java | 306 +++++++++++++++++
.../repository/query/package-info.java | 22 ++
.../support/IgniteRepositoryFactory.java | 168 ++++++++++
.../support/IgniteRepositoryFactoryBean.java | 85 +++++
.../support/IgniteRepositoryImpl.java | 160 +++++++++
.../repository/support/package-info.java | 22 ++
.../IgniteSpringDataCrudSelfTest.java | 233 +++++++++++++
.../IgniteSpringDataQueriesSelfTest.java | 291 ++++++++++++++++
.../misc/ApplicationConfiguration.java | 46 +++
.../apache/ignite/springdata/misc/Person.java | 97 ++++++
.../springdata/misc/PersonRepository.java | 92 ++++++
.../springdata/misc/PersonSecondRepository.java | 40 +++
.../testsuites/IgniteSpringDataTestSuite.java | 41 +++
modules/web-console/frontend/.eslintrc | 2 +-
modules/web-console/frontend/app/app.js | 3 -
.../form-field-datepicker.pug | 59 ----
.../form-field-datepicker.scss | 20 --
.../list-of-registered-users.categories.js | 4 +-
.../list-of-registered-users.column-defs.js | 44 +--
.../list-of-registered-users.controller.js | 141 ++++++--
.../list-of-registered-users.scss | 4 +
.../list-of-registered-users.tpl.pug | 76 +++--
.../ui-grid-header/ui-grid-header.scss | 91 -----
.../ui-grid-header/ui-grid-header.tpl.pug | 29 --
.../ui-grid-settings/ui-grid-settings.pug | 33 --
.../ui-grid-settings/ui-grid-settings.scss | 144 --------
.../frontend/app/helpers/jade/mixins.pug | 3 +
.../frontend/app/modules/states/admin.state.js | 11 +-
.../frontend/app/primitives/badge/index.scss | 4 +
.../frontend/app/primitives/btn/index.scss | 41 +++
.../app/primitives/datepicker/index.pug | 60 ++++
.../app/primitives/datepicker/index.scss | 64 ++++
.../frontend/app/primitives/dropdown/index.pug | 43 +++
.../frontend/app/primitives/dropdown/index.scss | 82 +++++
.../frontend/app/primitives/index.js | 8 +
.../frontend/app/primitives/page/index.scss | 35 ++
.../frontend/app/primitives/panel/index.scss | 51 +++
.../frontend/app/primitives/tabs/index.scss | 15 +
.../app/primitives/ui-grid-header/index.scss | 91 +++++
.../app/primitives/ui-grid-header/index.tpl.pug | 29 ++
.../app/primitives/ui-grid-settings/index.pug | 33 ++
.../app/primitives/ui-grid-settings/index.scss | 171 ++++++++++
.../frontend/app/primitives/ui-grid/index.scss | 329 +++++++++++++++++++
.../frontend/public/stylesheets/style.scss | 5 -
modules/web-console/frontend/views/base2.pug | 22 ++
.../frontend/views/settings/admin.tpl.pug | 3 +-
.../web-console/frontend/views/sql/sql.tpl.pug | 1 -
.../cache/websession/WebSessionFilter.java | 22 +-
parent/pom.xml | 1 +
pom.xml | 1 +
97 files changed, 4811 insertions(+), 863 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index c9081fc,dcac7d4..8d52564
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@@ -186,10 -189,11 +189,12 @@@ public class RendezvousAffinityFunctio
private RendezvousAffinityFunction(boolean exclNeighbors, int parts,
IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
A.ensure(parts > 0, "parts > 0");
+ A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <=" + CacheConfiguration.MAX_PARTITIONS_COUNT);
this.exclNeighbors = exclNeighbors;
- this.parts = parts;
+
+ setPartitions(parts);
+
this.backupFilter = backupFilter;
try {
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSemaphoreImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index f902242,0db7d06..6f9b401
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -18,8 -18,12 +18,10 @@@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionBackupFilterSelfTest;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionExcludeNeighborsSelfTest;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionBackupFilterSelfTest;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionExcludeNeighborsSelfTest;
+ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionFastPowerOfTwoHashSelfTest;
+ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionStandardHashSelfTest;
import org.apache.ignite.internal.processors.cache.CacheConcurrentReadThroughTest;
import org.apache.ignite.internal.processors.cache.CacheConfigurationLeakTest;
import org.apache.ignite.internal.processors.cache.CacheDhtLocalPartitionAfterRemoveSelfTest;
@@@ -107,9 -117,11 +109,12 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePartitionedTxTimeoutSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheRendezvousAffinityClientSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheStoreUpdateTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
+ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearOffheapCacheStoreUpdateTest;
+ import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NearCacheSyncUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NoneRebalanceModeSelfTest;
+ import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEvictionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedJobExecutionTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicBasicStoreSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicGetAndTransformStoreSelfTest;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/binary/binary_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_utils.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
index 07e8a14,0870997..6c2bde7
--- a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
+++ b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
@@@ -156,17 -158,22 +158,17 @@@ namespace ignit
return GetBinaryStringHashCode(name);
}
- static int32_t GetHashCode(const gt::BinaryDummy& obj)
- {
- return 0;
- }
-
- static bool IsNull(const gt::BinaryDummy& obj)
+ bool IsNull(const gt::BinaryInner& obj)
{
- return obj.GetValue() == 0;
+ return false;
}
- gt::BinaryInner GetNull()
+ static void GetNull(gt::BinaryDummy& dst)
{
- return gt::BinaryInner(0);
+ dst = gt::BinaryDummy();
}
- void Write(BinaryWriter& writer, const gt::BinaryDummy& obj)
+ static void Write(BinaryWriter& writer, const gt::BinaryDummy& obj)
{
// No-op.
}
@@@ -180,17 -187,17 +182,17 @@@
template<>
struct BinaryType<gt::BinaryInner>
{
- int32_t GetTypeId()
- static int32_t GetTypeId()
++ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("BinaryInner");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "BinaryInner";
+ dst = "BinaryInner";
}
- int32_t GetFieldId(const char* name)
- static int32_t GetFieldId(const char* name)
++ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/complex_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/test_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
index 62f37f9,802ec97..dd1e790
--- a/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
@@@ -212,17 -336,45 +204,13 @@@ namespace ignit
writer.WriteInt64("i64", obj.i64);
}
- CompositeKeySimple Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, CompositeKeySimple& dst)
{
- CompositeKeySimple val;
-
- val.str = reader.ReadString("str");
- val.ts = reader.ReadTimestamp("ts");
- val.i64 = reader.ReadInt64("i64");
-
- return val;
+ dst.str = reader.ReadString("str");
+ dst.ts = reader.ReadTimestamp("ts");
+ dst.i64 = reader.ReadInt64("i64");
}
};
-
- /**
- * Binary type definition for ComplexType2.
- */
- template<>
- struct BinaryType<ComplexType2>
- {
- IGNITE_BINARY_GET_TYPE_ID_AS_HASH(ComplexType2)
- IGNITE_BINARY_GET_TYPE_NAME_AS_IS(ComplexType2)
- IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_IS_NULL_FALSE(ComplexType2)
- IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(ComplexType2)
-
- static ignite::Reference<ignite::binary::BinaryIdentityResolver> GetIdentityResolver()
- {
- return ignite::MakeReferenceFromCopy(CustomFieldIdResolver());
- }
-
- static void Write(BinaryWriter& writer, const ComplexType2& obj)
- {
- writer.WriteInt32("i32Field", obj.i32Field);
- writer.WriteObject("objField", obj.objField);
- writer.WriteString("strField", obj.strField);
- }
-
- static void Read(BinaryReader& reader, ComplexType2& dst)
- {
- dst.i32Field = reader.ReadInt32("i32Field");
- dst.objField = reader.ReadObject<InnerObject>("objField");
- dst.strField = reader.ReadString("strField");
- }
- };
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/binary_object_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_invoke_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/cache_test.cpp
index d269f65,99e0f1b..d222009
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@@ -50,25 -50,24 +50,23 @@@ namespace ignit
namespace binary
{
IGNITE_BINARY_TYPE_START(Person)
- IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
- IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
- IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_IS_NULL_FALSE(Person)
- IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
+ IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
+ IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
+ IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_GET_HASH_CODE_ZERO(Person)
+ IGNITE_BINARY_IS_NULL_FALSE(Person)
+ IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
- void Write(BinaryWriter& writer, Person obj)
- {
- writer.WriteString("name", obj.name);
- writer.WriteInt32("age", obj.age);
- }
+ static void Write(BinaryWriter& writer, const Person& obj)
+ {
+ writer.WriteString("name", obj.name);
- writer.WriteInt32("age", obj.age);
++ writer.WriteInt32("age", obj.age);
+ }
- Person Read(BinaryReader& reader)
- {
- std::string name = reader.ReadString("name");
- int age = reader.ReadInt32("age");
-
- return Person(name, age);
- }
+ static void Read(BinaryReader& reader, Person& dst)
+ {
+ dst.name = reader.ReadString("name");
+ dst.age = reader.ReadInt32("age");
+ }
IGNITE_BINARY_TYPE_END
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index 2d1a2ee,8579c54..ea3d665
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@@ -290,14 -288,20 +287,15 @@@ namespace ignit
return GetBinaryStringHashCode("RangeFilter");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "RangeFilter";
+ dst = "RangeFilter";
}
+
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- static int32_t GetHashCode(const RangeFilter<K,V>&)
- {
- return 0;
- }
-
- static bool IsNull(const RangeFilter<K,V>&)
+ bool IsNull(const RangeFilter<K,V>&)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/odbc-test/include/complex_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/odbc-test/include/test_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/pom.xml
----------------------------------------------------------------------
[41/50] [abbrv] ignite git commit: Examples compilation
Posted by ag...@apache.org.
Examples compilation
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/43105832
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/43105832
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/43105832
Branch: refs/heads/master
Commit: 4310583298baf9fa371064b29eb17ab73d5f47db
Parents: 4849447
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Apr 13 16:35:34 2017 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Apr 13 16:35:34 2017 +0300
----------------------------------------------------------------------
examples/pom-standalone-lgpl.xml | 6 ++++++
examples/pom-standalone.xml | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/43105832/examples/pom-standalone-lgpl.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
index 16fe125..d9e630b 100644
--- a/examples/pom-standalone-lgpl.xml
+++ b/examples/pom-standalone-lgpl.xml
@@ -72,6 +72,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring-data</artifactId>
+ <version>to_be_replaced_by_ignite_version</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>spymemcached</artifactId>
<version>2.7.3</version>
http://git-wip-us.apache.org/repos/asf/ignite/blob/43105832/examples/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index fe6ab21..fe559f8 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -72,6 +72,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring-data</artifactId>
+ <version>to_be_replaced_by_ignite_version</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>spymemcached</artifactId>
<version>2.7.3</version>
[26/50] [abbrv] ignite git commit: ignite-3477-master more info for
investigation
Posted by ag...@apache.org.
ignite-3477-master more info for investigation
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2b6826e1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2b6826e1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2b6826e1
Branch: refs/heads/master
Commit: 2b6826e13deff5b174ad6188f6fd636e455c93d4
Parents: 3a62833
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:39:47 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:39:47 2017 +0300
----------------------------------------------------------------------
.../processors/cache/transactions/IgniteTxHandler.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2b6826e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 099a4ae..153ad04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -1167,7 +1167,11 @@ public class IgniteTxHandler {
else
sendReply(nodeId, req, true, null);
- assert req.txState() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null) : req;
+ IgniteInternalTx tx0 = ctx.tm().tx(req.version());
+
+ IgniteInternalTx nearTx0 = ctx.tm().nearTx(req.version());
+
+ assert req.txState() != null || (tx0 == null && nearTx0 == null) : req + " tx=" + tx0 + " nearTx=" + nearTx0;
}
/**
[10/50] [abbrv] ignite git commit: Fixed test config for C++
Posted by ag...@apache.org.
Fixed test config for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c9fd6b99
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c9fd6b99
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c9fd6b99
Branch: refs/heads/master
Commit: c9fd6b997ee8a7d4f542d71003c6e914adc19937
Parents: d69a594
Author: Igor Sapego <is...@gridgain.com>
Authored: Tue Apr 11 16:46:55 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Tue Apr 11 16:47:46 2017 +0300
----------------------------------------------------------------------
modules/platforms/cpp/core-test/config/cache-test-default.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c9fd6b99/modules/platforms/cpp/core-test/config/cache-test-default.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-test-default.xml b/modules/platforms/cpp/core-test/config/cache-test-default.xml
index 9a2bbd7..0ff6c4b 100644
--- a/modules/platforms/cpp/core-test/config/cache-test-default.xml
+++ b/modules/platforms/cpp/core-test/config/cache-test-default.xml
@@ -54,6 +54,7 @@
<property name="name" value="partitioned"/>
<property name="cacheMode" value="PARTITIONED"/>
<property name="atomicityMode" value="TRANSACTIONAL"/>
+ <property name="onheapCacheEnabled" value="true"/>
</bean>
<bean parent="cache-template">
[04/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by ag...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7eb1234c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7eb1234c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7eb1234c
Branch: refs/heads/master
Commit: 7eb1234cb4853baf21d06cb1b7643de98403f261
Parents: 2a6afe5 3e86c51
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 15:15:48 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 15:15:48 2017 +0300
----------------------------------------------------------------------
.../processors/query/h2/IgniteH2Indexing.java | 15 +-
.../processors/query/h2/opt/GridH2Table.java | 15 +-
.../cpp/core-test/config/cache-identity-32.xml | 50 ++++++
.../core-test/config/cache-identity-default.xml | 154 +++++++++++++++++++
.../cpp/core-test/config/cache-identity.xml | 124 +--------------
.../cpp/core-test/config/cache-store-32.xml | 50 ++++++
.../core-test/config/cache-store-default.xml | 71 +++++++++
.../cpp/core-test/config/cache-store.xml | 41 +----
.../cpp/core-test/project/vs/core-test.vcxproj | 8 +
.../project/vs/core-test.vcxproj.filters | 12 ++
.../src/binary_identity_resolver_test.cpp | 8 +
.../cpp/core-test/src/binary_object_test.cpp | 8 +
.../cpp/core-test/src/cache_invoke_test.cpp | 4 +
.../cpp/core-test/src/cache_store_test.cpp | 11 +-
.../cpp/core-test/src/cluster_test.cpp | 4 +
.../cpp/core-test/src/continuous_query_test.cpp | 5 +
16 files changed, 409 insertions(+), 171 deletions(-)
----------------------------------------------------------------------
[37/50] [abbrv] ignite git commit: ignite-3477-master fix
IgniteCacheQueryNodeRestartDistributedJoinSelfTest
Posted by ag...@apache.org.
ignite-3477-master fix IgniteCacheQueryNodeRestartDistributedJoinSelfTest
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/81a0f9a7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/81a0f9a7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/81a0f9a7
Branch: refs/heads/master
Commit: 81a0f9a711e5893f4ae172b9e49b65d191b179a1
Parents: 6bb4c81
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 16:15:43 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 16:15:43 2017 +0300
----------------------------------------------------------------------
...cheQueryNodeRestartDistributedJoinSelfTest.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/81a0f9a7/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
index 8367b2c..4f20078 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
@@ -36,6 +36,21 @@ import java.util.concurrent.atomic.AtomicIntegerArray;
* Test for distributed queries with node restarts.
*/
public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCacheQueryAbstractDistributedJoinSelfTest {
+ /** Total nodes. */
+ private int totalNodes = 6;
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ if (totalNodes > GRID_CNT) {
+ for (int i = GRID_CNT; i < totalNodes; i++)
+ startGrid(i);
+ }
+ else
+ totalNodes = GRID_CNT;
+ }
+
/**
* @throws Exception If failed.
*/
@@ -61,7 +76,7 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa
final int nodeLifeTime = 4000;
final int logFreq = 100;
- final AtomicIntegerArray locks = new AtomicIntegerArray(GRID_CNT);
+ final AtomicIntegerArray locks = new AtomicIntegerArray(totalNodes);
SqlFieldsQuery qry0 ;
[13/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/81e75380
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/81e75380
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/81e75380
Branch: refs/heads/master
Commit: 81e75380004918bb30ba686b950fd1b0a6fed5a7
Parents: 67cd719 e319697
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Tue Apr 11 17:53:24 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Tue Apr 11 17:53:24 2017 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 37 ++++++++++----------
.../Impl/Cache/CacheMetricsImpl.cs | 10 ------
2 files changed, 19 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
[03/50] [abbrv] ignite git commit: IGNITE-3477 - Reverted partition
evict
Posted by ag...@apache.org.
IGNITE-3477 - Reverted partition evict
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a6afe52
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a6afe52
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a6afe52
Branch: refs/heads/master
Commit: 2a6afe5286b105e5e45097391f78e85ec2cd1fde
Parents: b62d446
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 15:09:32 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 15:09:32 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtLocalPartition.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2a6afe52/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index e8489e2..dbd1948 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -458,7 +458,12 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
if (reservations == 0 && shouldBeRenting)
rent(true);
- tryEvictAsync(false);
+ try {
+ tryEvict();
+ }
+ catch (NodeStoppingException ignore) {
+ // Node is stopping.
+ }
break;
}
[31/50] [abbrv] ignite git commit: ignite-3477-master add latch in
test
Posted by ag...@apache.org.
ignite-3477-master add latch in test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/355efcd0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/355efcd0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/355efcd0
Branch: refs/heads/master
Commit: 355efcd06ec765b78453b0a6d8b7da201ed3596d
Parents: 10c0364
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 17:24:11 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 17:24:11 2017 +0300
----------------------------------------------------------------------
...lerCacheClientRequestsMappingOnMissTest.java | 94 +++++++++++++++-----
1 file changed, 71 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/355efcd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
index d0e863e..362d6a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
@@ -24,6 +24,8 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.Ignite;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -151,94 +153,130 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
*/
public void testNoNodesDieOnRequest() throws Exception {
Ignite srv1 = startGrid(0);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io());
Ignite srv2 = startGrid(1);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io());
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 1, actual is " + mappingReqsCounter.get(),
- 1,
- mappingReqsCounter.get());
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 1, actual is " + result, 1, result);
}
/**
*
*/
public void testOneNodeDiesOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(1);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io());
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 2, actual is " + mappingReqsCounter.get(),
- 2,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 2, actual is " + result, 2, result);
}
/**
*
*/
public void testTwoNodesDieOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(2);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io(), 1);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv2, "ctx")).io(), 1, nodeStopLatch);
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 3, actual is " + mappingReqsCounter.get(),
- 3,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 3, actual is " + result, 3, result);
}
/**
*
*/
public void testAllNodesDieOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(3);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io(), 1);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv2, "ctx")).io(), 1, nodeStopLatch);
Ignite srv3 = startGrid(2);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io(), 2);
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv3, "ctx")).io(), 2, nodeStopLatch);
+
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
try {
cl1.cache(null).get(1);
}
@@ -246,9 +284,11 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
e.printStackTrace();
}
- assertEquals("Expected requests count is 3, actual is " + mappingReqsCounter.get(),
- 3,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 3, actual is " + result, 3, result);
}
/**
@@ -262,6 +302,7 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
GridMessageListener wrapper = new GridMessageListener() {
@Override public void onMessage(UUID nodeId, Object msg) {
mappingReqsCounter.incrementAndGet();
+
delegate.onMessage(nodeId, msg);
}
};
@@ -272,7 +313,11 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
/**
*
*/
- private void replaceWithStoppingMappingRequestListener(GridIoManager ioMgr, final int nodeIdToStop) {
+ private void replaceWithStoppingMappingRequestListener(
+ GridIoManager ioMgr,
+ final int nodeIdToStop,
+ final CountDownLatch latch
+ ) {
ioMgr.removeMessageListener(GridTopic.TOPIC_MAPPING_MARSH);
ioMgr.addMessageListener(GridTopic.TOPIC_MAPPING_MARSH, new GridMessageListener() {
@@ -280,6 +325,9 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
new Thread(new Runnable() {
@Override public void run() {
mappingReqsCounter.incrementAndGet();
+
+ latch.countDown();
+
stopGrid(nodeIdToStop, true);
}
}).start();
[36/50] [abbrv] ignite git commit: Javadoc fixes
Posted by ag...@apache.org.
Javadoc fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1218c416
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1218c416
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1218c416
Branch: refs/heads/master
Commit: 1218c416adb864989c0760746c7d2e4df2e1644e
Parents: 5839f48
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Apr 13 13:35:16 2017 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Apr 13 13:35:16 2017 +0300
----------------------------------------------------------------------
parent/pom.xml | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1218c416/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 61bf077..8d10713 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -445,6 +445,10 @@
<title>Flink integration</title>
<packages>org.apache.ignite.sink.flink*</packages>
</group>
+ <group>
+ <title>SpringData integration</title>
+ <packages>org.apache.ignite.springdata.repository*</packages>
+ </group>
</groups>
<header>
<![CDATA[
[12/50] [abbrv] ignite git commit: IGNITE-3477 - Fixed cache metrics
serialization for .NET
Posted by ag...@apache.org.
IGNITE-3477 - Fixed cache metrics serialization for .NET
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e3196970
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e3196970
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e3196970
Branch: refs/heads/master
Commit: e319697023537237fb0c741dab9dba5cf08d5b83
Parents: c9fd6b9
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 17:34:14 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 17:35:21 2017 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 37 ++++++++++----------
.../Impl/Cache/CacheMetricsImpl.cs | 10 ------
2 files changed, 19 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e3196970/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 5a8dfa0..6bcd6c2 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
@@ -3201,29 +3201,30 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (log.isDebugEnabled())
log.debug("Got removed entry while updating backup value (will retry): " + key);
- entry = null;
- }
- finally {
- if (entry != null)
- ctx.evicts().touch(entry, req.topologyVersion());
+ entry = null;
+ }
+ finally {
+ if (entry != null)
+ ctx.evicts().touch(entry, req.topologyVersion());
+ }
}
}
- }
- catch (NodeStoppingException e){
- U.error(log, "Failed to update key on backup (local node is stopping):" + key, e);
+ catch (NodeStoppingException e){
+ U.error(log, "Failed to update key on backup (local node is stopping):" + key, e);
- return;
- }
- catch (GridDhtInvalidPartitionException ignored) {
- // Ignore.
- }
- catch (IgniteCheckedException e) {
- IgniteCheckedException err = new IgniteCheckedException("Failed to update key on backup node: " + key, e);
+ return;
+ }
+ catch (GridDhtInvalidPartitionException ignored) {
+ // Ignore.
+ }
+ catch (IgniteCheckedException e) {
+ IgniteCheckedException err = new IgniteCheckedException("Failed to update key on backup node: " + key, e);
- if (nearRes != null)
- nearRes.addFailedKey(key, err);
+ if (nearRes != null)
+ nearRes.addFailedKey(key, err);
- U.error(log, "Failed to update key on backup node: " + key, e);}
+ U.error(log, "Failed to update key on backup node: " + key, e);
+ }
}
}
finally {
http://git-wip-us.apache.org/repos/asf/ignite/blob/e3196970/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
index 48943b4..a2f0417 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
@@ -266,7 +266,6 @@ namespace Apache.Ignite.Core.Impl.Cache
_cacheTxCommits = reader.ReadLong();
_cacheTxRollbacks = reader.ReadLong();
_cacheName = reader.ReadString();
- _overflowSize = reader.ReadLong();
_offHeapGets = reader.ReadLong();
_offHeapPuts = reader.ReadLong();
_offHeapRemovals = reader.ReadLong();
@@ -280,15 +279,6 @@ namespace Apache.Ignite.Core.Impl.Cache
_offHeapBackupEntriesCount = reader.ReadLong();
_offHeapAllocatedSize = reader.ReadLong();
_offHeapMaxSize = reader.ReadLong();
- _swapGets = reader.ReadLong();
- _swapPuts = reader.ReadLong();
- _swapRemovals = reader.ReadLong();
- _swapHits = reader.ReadLong();
- _swapMisses = reader.ReadLong();
- _swapEntriesCount = reader.ReadLong();
- _swapSize = reader.ReadLong();
- _swapHitPercentage = reader.ReadFloat();
- _swapMissPercentage = reader.ReadFloat();
_size = reader.ReadInt();
_keySize = reader.ReadInt();
_isEmpty = reader.ReadBoolean();
[33/50] [abbrv] ignite git commit: ignite-3477-master fix hibernate
class description
Posted by ag...@apache.org.
ignite-3477-master fix hibernate class description
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5489acea
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5489acea
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5489acea
Branch: refs/heads/master
Commit: 5489acea248acd40d2f916b31ced361afa778aa2
Parents: b066f60
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 11:26:00 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 11:26:00 2017 +0300
----------------------------------------------------------------------
.../org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java | 2 +-
.../org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5489acea/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
----------------------------------------------------------------------
diff --git a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
index 2922f7f..ecad0b6 100644
--- a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
+++ b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
@@ -18,7 +18,7 @@
package org.apache.ignite.cache.hibernate;
/**
- *
+ * An interface for transforming hibernate keys to Ignite keys.
*/
public interface HibernateKeyTransformer {
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/5489acea/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
----------------------------------------------------------------------
diff --git a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
index 3f2b97f..ff52124 100644
--- a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
+++ b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
@@ -24,7 +24,7 @@ import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
/**
- *
+ * Hibernate cache key wrapper.
*/
public class HibernateKeyWrapper {
/** Key. */
[07/50] [abbrv] ignite git commit: ignite-3477 : Fixed endless
partsToEvict queue.
Posted by ag...@apache.org.
ignite-3477 : Fixed endless partsToEvict queue.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5e5ffe69
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5e5ffe69
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5e5ffe69
Branch: refs/heads/master
Commit: 5e5ffe690292a22d7cdffc272e858d7e0d9acc2e
Parents: 7eb1234
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Tue Apr 11 15:32:31 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Tue Apr 11 15:32:31 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtLocalPartition.java | 14 ++++++++------
.../distributed/dht/preloader/GridDhtPreloader.java | 4 ++--
2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5e5ffe69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index dbd1948..44fd905 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -217,6 +217,13 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
}
/**
+ * @return {@code True} if partition is marked for transfer to renting state.
+ */
+ public boolean shouldBeRenting() {
+ return shouldBeRenting;
+ }
+
+ /**
* @return Reservations.
*/
public int reservations() {
@@ -458,12 +465,7 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
if (reservations == 0 && shouldBeRenting)
rent(true);
- try {
- tryEvict();
- }
- catch (NodeStoppingException ignore) {
- // Node is stopping.
- }
+ tryEvictAsync(false);
break;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5e5ffe69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 9af2388..c033b93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -72,7 +72,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
-import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.EVICTED;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
/**
@@ -790,7 +790,7 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
try {
part.tryEvict();
- if (part.state() != EVICTED)
+ if (part.state() == RENTING || part.shouldBeRenting())
partsToEvict.push(part);
}
catch (Throwable ex) {
[30/50] [abbrv] ignite git commit: ignite-3477-master fix stop node
after test
Posted by ag...@apache.org.
ignite-3477-master fix stop node after test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10c0364c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10c0364c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10c0364c
Branch: refs/heads/master
Commit: 10c0364c4a6f5bd90d8dfb3d222b4a5792222c7a
Parents: 2b6826e
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:58:41 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:58:41 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/near/GridCacheNearTxForceKeyTest.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/10c0364c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
index f1c791e..66f34c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
@@ -80,4 +80,11 @@ public class GridCacheNearTxForceKeyTest extends GridCommonAbstractTest {
assertTrue(ignite0.affinity(null).isPrimary(ignite1.cluster().localNode(), key));
}
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
}
[35/50] [abbrv] ignite git commit: ClientReconnectMessage id
shouldn't be saved for lastMsgId on client side
Posted by ag...@apache.org.
ClientReconnectMessage id shouldn't be saved for lastMsgId on client side
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a563ba05
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a563ba05
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a563ba05
Branch: refs/heads/master
Commit: a563ba0556d940cc3665973b6098758786db72c1
Parents: 6bb4c81
Author: Sergey Chugunov <se...@gmail.com>
Authored: Wed Apr 12 13:41:09 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Thu Apr 13 12:48:36 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a563ba05/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 6c7c220..34ee414 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -1842,7 +1842,9 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.stats.onMessageProcessingFinished(msg);
- if (spi.ensured(msg) && state == CONNECTED)
+ if (spi.ensured(msg)
+ && state == CONNECTED
+ && !(msg instanceof TcpDiscoveryClientReconnectMessage))
lastMsgId = msg.id();
}
[22/50] [abbrv] ignite git commit: IGNITE-3477 - Removed extra
partition eviction attempts
Posted by ag...@apache.org.
IGNITE-3477 - Removed extra partition eviction attempts
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/78836682
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/78836682
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/78836682
Branch: refs/heads/master
Commit: 78836682d85b4faf4ecd1631758f6c4a2e26bd77
Parents: 50f9f16
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Apr 12 13:27:39 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Apr 12 13:27:39 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtLocalPartition.java | 2 +-
.../cache/distributed/dht/preloader/GridDhtPreloader.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/78836682/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 44fd905..6b4c2ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -624,7 +624,7 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
if (markForDestroy())
finishDestroy(updateSeq);
}
- else
+ else if (partState == RENTING || shouldBeRenting())
cctx.preloader().evictPartitionAsync(this);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/78836682/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c033b93..517f04a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -47,6 +47,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -72,6 +73,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
@@ -790,7 +792,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
try {
part.tryEvict();
- if (part.state() == RENTING || part.shouldBeRenting())
+ GridDhtPartitionState state = part.state();
+
+ if (state == RENTING || ((state == MOVING || state == OWNING) && part.shouldBeRenting()))
partsToEvict.push(part);
}
catch (Throwable ex) {
[49/50] [abbrv] ignite git commit: IGNITE-3477 - Fixed direct
marshallable code
Posted by ag...@apache.org.
IGNITE-3477 - Fixed direct marshallable code
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b6b3d375
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b6b3d375
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b6b3d375
Branch: refs/heads/master
Commit: b6b3d3754849aa54626befe2375cbc88cbebfab9
Parents: faaf92d
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 19:16:23 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 20:56:59 2017 +0300
----------------------------------------------------------------------
.../cache/binary/MetadataRequestMessage.java | 2 ++
.../cache/binary/MetadataResponseMessage.java | 36 +++++++++++++++-----
2 files changed, 30 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6b3d375/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
index 87bf805..b34acd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
@@ -70,6 +70,7 @@ public class MetadataRequestMessage implements Message {
return false;
writer.incrementState();
+
}
return true;
@@ -90,6 +91,7 @@ public class MetadataRequestMessage implements Message {
return false;
reader.incrementState();
+
}
return reader.afterMessageRead(MetadataRequestMessage.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6b3d375/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
index bb3d3a3..6ff4fd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
@@ -63,22 +63,23 @@ public class MetadataResponseMessage implements Message {
switch (writer.state()) {
case 0:
- if (!writer.writeInt("typeId", typeId))
+ if (!writer.writeByteArray("binaryMetadataBytes", binaryMetadataBytes))
return false;
writer.incrementState();
case 1:
- if (!writer.writeInt("status", status.ordinal()))
+ if (!writer.writeByte("status", status != null ? (byte)status.ordinal() : -1))
return false;
writer.incrementState();
case 2:
- if (!writer.writeByteArray("binMetaBytes", binaryMetadataBytes))
+ if (!writer.writeInt("typeId", typeId))
return false;
writer.incrementState();
+
}
return true;
@@ -93,7 +94,7 @@ public class MetadataResponseMessage implements Message {
switch (reader.state()) {
case 0:
- typeId = reader.readInt("typeId");
+ binaryMetadataBytes = reader.readByteArray("binaryMetadataBytes");
if (!reader.isLastRead())
return false;
@@ -101,18 +102,25 @@ public class MetadataResponseMessage implements Message {
reader.incrementState();
case 1:
- status = ClientResponseStatus.values()[reader.readInt("status")];
+ byte statusOrd;
+
+ statusOrd = reader.readByte("status");
if (!reader.isLastRead())
return false;
+ status = ClientResponseStatus.fromOrdinal(statusOrd);
+
reader.incrementState();
case 2:
- binaryMetadataBytes = reader.readByteArray("binMetaBytes");
+ typeId = reader.readInt("typeId");
if (!reader.isLastRead())
return false;
+
+ reader.incrementState();
+
}
return reader.afterMessageRead(MetadataResponseMessage.class);
@@ -131,7 +139,6 @@ public class MetadataResponseMessage implements Message {
/** {@inheritDoc} */
@Override public void onAckReceived() {
// No-op.
-
}
/**
@@ -185,7 +192,20 @@ public class MetadataResponseMessage implements Message {
METADATA_NOT_FOUND,
/** */
- ERROR
+ ERROR;
+
+ /** Enumerated values. */
+ private static final ClientResponseStatus[] VALS = values();
+
+ /**
+ * Efficiently gets enumerated value from its ordinal.
+ *
+ * @param ord Ordinal value.
+ * @return Enumerated value.
+ */
+ public static ClientResponseStatus fromOrdinal(byte ord) {
+ return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+ }
}
/** {@inheritDoc} */
[11/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/67cd7193
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/67cd7193
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/67cd7193
Branch: refs/heads/master
Commit: 67cd71939b05bba426450d37b322b67eceb397da
Parents: fef2834 c9fd6b9
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Tue Apr 11 17:12:39 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Tue Apr 11 17:12:39 2017 +0300
----------------------------------------------------------------------
modules/platforms/cpp/core-test/config/cache-test-default.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
[15/50] [abbrv] ignite git commit: .NET: Fix cache metrics
Posted by ag...@apache.org.
.NET: Fix cache metrics
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/57035470
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/57035470
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/57035470
Branch: refs/heads/master
Commit: 570354702b27cd30f028430297648649d76a84fb
Parents: e319697
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Apr 11 18:11:23 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Apr 11 18:11:23 2017 +0300
----------------------------------------------------------------------
.../Cache/CacheMetricsTest.cs | 86 +++++++++-----------
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 ------------------
.../Impl/Cache/CacheMetricsImpl.cs | 60 --------------
3 files changed, 38 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/57035470/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
index 9c29fbf..d1d6c7b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
@@ -154,56 +154,46 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.AreEqual(14, metrics.CacheTxCommits);
Assert.AreEqual(15, metrics.CacheTxRollbacks);
Assert.AreEqual("myCache", metrics.CacheName);
- Assert.AreEqual(16, metrics.OverflowSize);
- Assert.AreEqual(17, metrics.OffHeapGets);
- Assert.AreEqual(18, metrics.OffHeapPuts);
- Assert.AreEqual(19, metrics.OffHeapRemovals);
- Assert.AreEqual(20, metrics.OffHeapEvictions);
- Assert.AreEqual(21, metrics.OffHeapHits);
- Assert.AreEqual(22, metrics.OffHeapHitPercentage);
- Assert.AreEqual(23, metrics.OffHeapMisses);
- Assert.AreEqual(24, metrics.OffHeapMissPercentage);
- Assert.AreEqual(25, metrics.OffHeapEntriesCount);
- Assert.AreEqual(26, metrics.OffHeapPrimaryEntriesCount);
- Assert.AreEqual(27, metrics.OffHeapBackupEntriesCount);
- Assert.AreEqual(28, metrics.OffHeapAllocatedSize);
- Assert.AreEqual(29, metrics.OffHeapMaxSize);
- Assert.AreEqual(30, metrics.SwapGets);
- Assert.AreEqual(31, metrics.SwapPuts);
- Assert.AreEqual(32, metrics.SwapRemovals);
- Assert.AreEqual(33, metrics.SwapHits);
- Assert.AreEqual(34, metrics.SwapMisses);
- Assert.AreEqual(35, metrics.SwapEntriesCount);
- Assert.AreEqual(36, metrics.SwapSize);
- Assert.AreEqual(37, metrics.SwapHitPercentage);
- Assert.AreEqual(38, metrics.SwapMissPercentage);
- Assert.AreEqual(39, metrics.Size);
- Assert.AreEqual(40, metrics.KeySize);
+ Assert.AreEqual(16, metrics.OffHeapGets);
+ Assert.AreEqual(17, metrics.OffHeapPuts);
+ Assert.AreEqual(18, metrics.OffHeapRemovals);
+ Assert.AreEqual(19, metrics.OffHeapEvictions);
+ Assert.AreEqual(20, metrics.OffHeapHits);
+ Assert.AreEqual(21, metrics.OffHeapHitPercentage);
+ Assert.AreEqual(22, metrics.OffHeapMisses);
+ Assert.AreEqual(23, metrics.OffHeapMissPercentage);
+ Assert.AreEqual(24, metrics.OffHeapEntriesCount);
+ Assert.AreEqual(25, metrics.OffHeapPrimaryEntriesCount);
+ Assert.AreEqual(26, metrics.OffHeapBackupEntriesCount);
+ Assert.AreEqual(27, metrics.OffHeapAllocatedSize);
+ Assert.AreEqual(28, metrics.OffHeapMaxSize);
+ Assert.AreEqual(29, metrics.Size);
+ Assert.AreEqual(30, metrics.KeySize);
Assert.AreEqual(true, metrics.IsEmpty);
- Assert.AreEqual(41, metrics.DhtEvictQueueCurrentSize);
- Assert.AreEqual(42, metrics.TxThreadMapSize);
- Assert.AreEqual(43, metrics.TxXidMapSize);
- Assert.AreEqual(44, metrics.TxCommitQueueSize);
- Assert.AreEqual(45, metrics.TxPrepareQueueSize);
- Assert.AreEqual(46, metrics.TxStartVersionCountsSize);
- Assert.AreEqual(47, metrics.TxCommittedVersionsSize);
- Assert.AreEqual(48, metrics.TxRolledbackVersionsSize);
- Assert.AreEqual(49, metrics.TxDhtThreadMapSize);
- Assert.AreEqual(50, metrics.TxDhtXidMapSize);
- Assert.AreEqual(51, metrics.TxDhtCommitQueueSize);
- Assert.AreEqual(52, metrics.TxDhtPrepareQueueSize);
- Assert.AreEqual(53, metrics.TxDhtStartVersionCountsSize);
- Assert.AreEqual(54, metrics.TxDhtCommittedVersionsSize);
- Assert.AreEqual(55, metrics.TxDhtRolledbackVersionsSize);
+ Assert.AreEqual(31, metrics.DhtEvictQueueCurrentSize);
+ Assert.AreEqual(32, metrics.TxThreadMapSize);
+ Assert.AreEqual(33, metrics.TxXidMapSize);
+ Assert.AreEqual(34, metrics.TxCommitQueueSize);
+ Assert.AreEqual(35, metrics.TxPrepareQueueSize);
+ Assert.AreEqual(36, metrics.TxStartVersionCountsSize);
+ Assert.AreEqual(37, metrics.TxCommittedVersionsSize);
+ Assert.AreEqual(38, metrics.TxRolledbackVersionsSize);
+ Assert.AreEqual(39, metrics.TxDhtThreadMapSize);
+ Assert.AreEqual(40, metrics.TxDhtXidMapSize);
+ Assert.AreEqual(41, metrics.TxDhtCommitQueueSize);
+ Assert.AreEqual(42, metrics.TxDhtPrepareQueueSize);
+ Assert.AreEqual(43, metrics.TxDhtStartVersionCountsSize);
+ Assert.AreEqual(44, metrics.TxDhtCommittedVersionsSize);
+ Assert.AreEqual(45, metrics.TxDhtRolledbackVersionsSize);
Assert.AreEqual(true, metrics.IsWriteBehindEnabled);
- Assert.AreEqual(56, metrics.WriteBehindFlushSize);
- Assert.AreEqual(57, metrics.WriteBehindFlushThreadCount);
- Assert.AreEqual(58, metrics.WriteBehindFlushFrequency);
- Assert.AreEqual(59, metrics.WriteBehindStoreBatchSize);
- Assert.AreEqual(60, metrics.WriteBehindTotalCriticalOverflowCount);
- Assert.AreEqual(61, metrics.WriteBehindCriticalOverflowCount);
- Assert.AreEqual(62, metrics.WriteBehindErrorRetryCount);
- Assert.AreEqual(63, metrics.WriteBehindBufferSize);
+ Assert.AreEqual(46, metrics.WriteBehindFlushSize);
+ Assert.AreEqual(47, metrics.WriteBehindFlushThreadCount);
+ Assert.AreEqual(48, metrics.WriteBehindFlushFrequency);
+ Assert.AreEqual(49, metrics.WriteBehindStoreBatchSize);
+ Assert.AreEqual(50, metrics.WriteBehindTotalCriticalOverflowCount);
+ Assert.AreEqual(51, metrics.WriteBehindCriticalOverflowCount);
+ Assert.AreEqual(52, metrics.WriteBehindErrorRetryCount);
+ Assert.AreEqual(53, metrics.WriteBehindBufferSize);
Assert.AreEqual("foo", metrics.KeyType);
Assert.AreEqual("bar", metrics.ValueType);
Assert.AreEqual(true, metrics.IsStoreByValue);
http://git-wip-us.apache.org/repos/asf/ignite/blob/57035470/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
index 9117bf8..596322b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
@@ -153,14 +153,6 @@ namespace Apache.Ignite.Core.Cache
string CacheName { get; }
/// <summary>
- /// Gets number of entries that was swapped to disk.
- /// </summary>
- /// <returns>
- /// Number of entries that was swapped to disk.
- /// </returns>
- long OverflowSize { get; }
-
- /// <summary>
/// The total number of get requests to the off-heap memory.
/// </summary>
/// <returns>
@@ -265,78 +257,6 @@ namespace Apache.Ignite.Core.Cache
long OffHeapMaxSize { get; }
/// <summary>
- /// The total number of get requests to the swap.
- /// </summary>
- /// <returns>
- /// The number of gets from the swap.
- /// </returns>
- long SwapGets { get; }
-
- /// <summary>
- /// The total number of put requests to the swap.
- /// </summary>
- /// <returns>
- /// The number of puts to the swap.
- /// </returns>
- long SwapPuts { get; }
-
- /// <summary>
- /// The total number of removals from the swap.
- /// </summary>
- /// <returns>
- /// The number of removals from the swap.
- /// </returns>
- long SwapRemovals { get; }
-
- /// <summary>
- /// The number of get requests that were satisfied by the swap.
- /// </summary>
- /// <returns>
- /// The swap hits number.
- /// </returns>
- long SwapHits { get; }
-
- /// <summary>
- /// A number of get requests to that were not satisfied by the swap.
- /// </summary>
- /// <returns>
- /// The swap misses number.
- /// </returns>
- long SwapMisses { get; }
-
- /// <summary>
- /// Gets number of entries stored in swap.
- /// </summary>
- /// <returns>
- /// Number of entries stored in swap.
- /// </returns>
- long SwapEntriesCount { get; }
-
- /// <summary>
- /// Gets size of swap, in bytes.
- /// </summary>
- /// <returns>
- /// Size of swap, in bytes.
- /// </returns>
- long SwapSize { get; }
-
- /// <summary>
- /// Gets the percentage of hits on swap.
- /// </summary>
- /// <returns>
- /// The percentage of hits on swap.
- /// </returns>
- float SwapHitPercentage { get; }
-
- /// <summary>
- /// Gets the percentage of misses on swap.
- /// </summary>
- /// <returns>
- /// The percentage of misses on swap.
- /// </returns>
- float SwapMissPercentage { get; }
-
- /// <summary>
/// Gets number of non-null values in the cache.
/// </summary>
/// <returns>
http://git-wip-us.apache.org/repos/asf/ignite/blob/57035470/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
index a2f0417..53ff810 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
@@ -74,9 +74,6 @@ namespace Apache.Ignite.Core.Impl.Cache
private readonly string _cacheName;
/** */
- private readonly long _overflowSize;
-
- /** */
private readonly long _offHeapGets;
/** */
@@ -116,33 +113,6 @@ namespace Apache.Ignite.Core.Impl.Cache
private readonly long _offHeapMaxSize;
/** */
- private readonly long _swapGets;
-
- /** */
- private readonly long _swapPuts;
-
- /** */
- private readonly long _swapRemovals;
-
- /** */
- private readonly long _swapHits;
-
- /** */
- private readonly long _swapMisses;
-
- /** */
- private readonly long _swapEntriesCount;
-
- /** */
- private readonly long _swapSize;
-
- /** */
- private readonly float _swapHitPercentage;
-
- /** */
- private readonly float _swapMissPercentage;
-
- /** */
private readonly int _size;
/** */
@@ -364,9 +334,6 @@ namespace Apache.Ignite.Core.Impl.Cache
public string CacheName { get { return _cacheName; } }
/** <inheritDoc /> */
- public long OverflowSize { get { return _overflowSize; } }
-
- /** <inheritDoc /> */
public long OffHeapGets { get { return _offHeapGets; } }
/** <inheritDoc /> */
@@ -406,33 +373,6 @@ namespace Apache.Ignite.Core.Impl.Cache
public long OffHeapMaxSize { get { return _offHeapMaxSize; } }
/** <inheritDoc /> */
- public long SwapGets { get { return _swapGets; } }
-
- /** <inheritDoc /> */
- public long SwapPuts { get { return _swapPuts; } }
-
- /** <inheritDoc /> */
- public long SwapRemovals { get { return _swapRemovals; } }
-
- /** <inheritDoc /> */
- public long SwapHits { get { return _swapHits; } }
-
- /** <inheritDoc /> */
- public long SwapMisses { get { return _swapMisses; } }
-
- /** <inheritDoc /> */
- public long SwapEntriesCount { get { return _swapEntriesCount; } }
-
- /** <inheritDoc /> */
- public long SwapSize { get { return _swapSize; } }
-
- /** <inheritDoc /> */
- public float SwapHitPercentage { get { return _swapHitPercentage; } }
-
- /** <inheritDoc /> */
- public float SwapMissPercentage { get { return _swapMissPercentage; } }
-
- /** <inheritDoc /> */
public int Size { get { return _size; } }
/** <inheritDoc /> */
[42/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing flaky full
API suite
Posted by ag...@apache.org.
IGNITE-3477 - Fixing flaky full API suite
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8d2b020c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8d2b020c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8d2b020c
Branch: refs/heads/master
Commit: 8d2b020c7068a000c2eeaa5096e24cdf8937125d
Parents: 1469f28
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:36:54 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:36:54 2017 +0300
----------------------------------------------------------------------
.../processors/cache/H2CacheStoreStrategy.java | 35 ++++++++++++++++----
1 file changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d2b020c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
index 0167b7d..72b049b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
@@ -54,6 +54,9 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** Pool to get {@link Connection}s from. */
private final JdbcConnectionPool dataSrc;
+ /** */
+ private final int port;
+
/** Script that creates CACHE table. */
private static final String CREATE_CACHE_TABLE =
"create table if not exists CACHE(k binary not null, v binary not null, PRIMARY KEY(k));";
@@ -75,9 +78,14 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
* @throws IgniteCheckedException If failed.
*/
public H2CacheStoreStrategy() throws IgniteCheckedException {
+ Server srv = null;
+
try {
- Server.createTcpServer().start();
- dataSrc = H2CacheStoreSessionListenerFactory.createDataSource();
+ srv = Server.createTcpServer().start();
+
+ port = srv.getPort();
+
+ dataSrc = H2CacheStoreSessionListenerFactory.createDataSource(port);
try (Connection conn = connection()) {
RunScript.execute(conn, new StringReader(CREATE_CACHE_TABLE));
@@ -86,7 +94,8 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
}
}
catch (SQLException e) {
- throw new IgniteCheckedException(e);
+ throw new IgniteCheckedException("Failed to set up cache store strategy" +
+ (srv == null ? "" : ": " + srv.getStatus()), e);
}
}
@@ -242,7 +251,7 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** {@inheritDoc} */
@Override public void updateCacheConfiguration(CacheConfiguration<Object, Object> cfg) {
- cfg.setCacheStoreSessionListenerFactories(new H2CacheStoreSessionListenerFactory());
+ cfg.setCacheStoreSessionListenerFactories(new H2CacheStoreSessionListenerFactory(port));
}
/** {@inheritDoc} */
@@ -260,11 +269,23 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** Serializable {@link Factory} producing H2 backed {@link CacheStoreSessionListener}s. */
public static class H2CacheStoreSessionListenerFactory implements Factory<CacheStoreSessionListener> {
+ /** */
+ private int port;
+
+ /**
+ * @param port Port.
+ */
+ public H2CacheStoreSessionListenerFactory(int port) {
+ this.port = port;
+ }
+
/**
* @return Connection pool
*/
- static JdbcConnectionPool createDataSource() {
- JdbcConnectionPool pool = JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:TestDb;LOCK_MODE=0", "sa", "");
+ static JdbcConnectionPool createDataSource(int port) {
+ JdbcConnectionPool pool = JdbcConnectionPool.create("jdbc:h2:tcp://localhost:" + port +
+ "/mem:TestDb;LOCK_MODE=0", "sa", "");
+
pool.setMaxConnections(Integer.getInteger("H2_JDBC_CONNECTIONS", 100));
return pool;
}
@@ -272,7 +293,7 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** {@inheritDoc} */
@Override public CacheStoreSessionListener create() {
CacheJdbcStoreSessionListener lsnr = new CacheJdbcStoreSessionListener();
- lsnr.setDataSource(createDataSource());
+ lsnr.setDataSource(createDataSource(port));
return lsnr;
}
}
[46/50] [abbrv] ignite git commit: IGNITE-3477 - Removed obsolete file
Posted by ag...@apache.org.
IGNITE-3477 - Removed obsolete file
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2c4ef9ee
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2c4ef9ee
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2c4ef9ee
Branch: refs/heads/master
Commit: 2c4ef9ee351d0366a9020392527f59e3fc10622c
Parents: 00d63a8
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 17:35:24 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 17:35:24 2017 +0300
----------------------------------------------------------------------
leak.patch | 10521 ------------------------------------------------------
1 file changed, 10521 deletions(-)
----------------------------------------------------------------------
[06/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4ae084d0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4ae084d0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4ae084d0
Branch: refs/heads/master
Commit: 4ae084d047edd3b7dea73c66a373e37eb4cde876
Parents: 1a7b91d 7eb1234
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Tue Apr 11 15:25:55 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Tue Apr 11 15:25:55 2017 +0300
----------------------------------------------------------------------
.../communication/GridIoMessageFactory.java | 8 +-
.../GridCachePartitionExchangeManager.java | 6 +-
.../processors/cache/GridCachePreloader.java | 4 +-
.../cache/GridCachePreloaderAdapter.java | 4 +-
.../distributed/dht/GridDhtLocalPartition.java | 7 +-
.../dht/preloader/GridDhtPartitionDemander.java | 2 +-
.../dht/preloader/GridDhtPartitionSupplier.java | 8 +-
.../GridDhtPartitionSupplyMessage.java | 103 +++--
.../GridDhtPartitionSupplyMessageV2.java | 422 -------------------
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../utils/PlatformConfigurationUtils.java | 3 +-
.../resources/META-INF/classnames.properties | 1 -
.../cache/ClusterStateAbstractTest.java | 10 +-
.../CacheLateAffinityAssignmentTest.java | 6 +-
.../IgniteCacheReadFromBackupTest.java | 6 +-
.../atomic/IgniteCacheAtomicProtocolTest.java | 3 +-
.../processors/query/h2/IgniteH2Indexing.java | 15 +-
.../processors/query/h2/opt/GridH2Table.java | 15 +-
.../cpp/core-test/config/cache-identity-32.xml | 50 +++
.../core-test/config/cache-identity-default.xml | 154 +++++++
.../cpp/core-test/config/cache-identity.xml | 124 +-----
.../cpp/core-test/config/cache-store-32.xml | 50 +++
.../core-test/config/cache-store-default.xml | 71 ++++
.../cpp/core-test/config/cache-store.xml | 41 +-
.../cpp/core-test/project/vs/core-test.vcxproj | 8 +
.../project/vs/core-test.vcxproj.filters | 12 +
.../src/binary_identity_resolver_test.cpp | 8 +
.../cpp/core-test/src/binary_object_test.cpp | 8 +
.../cpp/core-test/src/cache_invoke_test.cpp | 4 +
.../cpp/core-test/src/cache_store_test.cpp | 11 +-
.../cpp/core-test/src/cluster_test.cpp | 4 +
.../cpp/core-test/src/continuous_query_test.cpp | 5 +
.../Affinity/AffinityFunctionSpringTest.cs | 6 +-
.../Cache/Affinity/AffinityFunctionTest.cs | 92 +---
.../Cache/CacheConfigurationTest.cs | 23 +-
.../Config/Cache/Affinity/affinity-function.xml | 4 +-
.../IgniteConfigurationSerializerTest.cs | 8 +-
.../IgniteConfigurationTest.cs | 2 -
.../Apache.Ignite.Core.csproj | 2 -
.../Cache/Affinity/Fair/FairAffinityFunction.cs | 32 --
.../Cache/Affinity/Fair/Package-Info.cs | 26 --
.../Cache/Affinity/IAffinityFunction.cs | 3 +-
.../Cache/Configuration/CacheConfiguration.cs | 81 +---
.../IgniteConfigurationSection.xsd | 29 --
.../Affinity/AffinityFunctionSerializer.cs | 18 +-
45 files changed, 513 insertions(+), 988 deletions(-)
----------------------------------------------------------------------
[08/50] [abbrv] ignite git commit: Merge remote-tracking branch
'community/ignite-3477-master' into ignite-3477-master
Posted by ag...@apache.org.
Merge remote-tracking branch 'community/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d69a5942
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d69a5942
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d69a5942
Branch: refs/heads/master
Commit: d69a5942d8926fa6dcae081f70a61b7a2513798e
Parents: 5e5ffe6 2068a75
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Tue Apr 11 15:32:53 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Tue Apr 11 15:32:53 2017 +0300
----------------------------------------------------------------------
.../cache/eviction/paged/PageEvictionWithRebalanceTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[34/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6bb4c817
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6bb4c817
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6bb4c817
Branch: refs/heads/master
Commit: 6bb4c817177c6c1680737ae14e1a9369184caef7
Parents: 5489ace 5839f48
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 12:14:54 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 12:14:54 2017 +0300
----------------------------------------------------------------------
.gitignore | 31 +-
examples/pom.xml | 6 +
.../examples/springdata/PersonRepository.java | 59 ++++
.../examples/springdata/SpringAppCfg.java | 69 ++++
.../examples/springdata/SpringDataExample.java | 154 +++++++++
.../examples/SpringDataExampleSelfTest.java | 32 ++
.../testsuites/IgniteExamplesSelfTestSuite.java | 2 +
.../rendezvous/RendezvousAffinityFunction.java | 26 +-
.../datastructures/GridCacheSemaphoreImpl.java | 74 ++++-
.../datastructures/GridCacheSemaphoreState.java | 22 ++
...inityFunctionFastPowerOfTwoHashSelfTest.java | 50 +++
...ousAffinityFunctionStandardHashSelfTest.java | 50 +++
...eAbstractDataStructuresFailoverSelfTest.java | 21 +-
.../testsuites/IgniteCacheTestSuite2.java | 4 +
.../binary/include/ignite/binary/binary_type.h | 127 +++----
.../ignite/impl/binary/binary_id_resolver.h | 33 +-
.../ignite/impl/binary/binary_object_impl.h | 3 +-
.../ignite/impl/binary/binary_reader_impl.h | 80 ++++-
.../include/ignite/impl/binary/binary_utils.h | 6 +-
.../ignite/impl/binary/binary_writer_impl.h | 15 +-
.../core-test/include/ignite/binary_test_defs.h | 95 +++---
.../cpp/core-test/include/ignite/complex_type.h | 30 +-
.../cpp/core-test/include/ignite/test_type.h | 37 +--
.../src/binary_identity_resolver_test.cpp | 38 +--
.../cpp/core-test/src/binary_object_test.cpp | 4 +-
.../cpp/core-test/src/binary_test_defs.cpp | 5 +
.../cpp/core-test/src/cache_invoke_test.cpp | 18 +-
.../cpp/core-test/src/cache_query_test.cpp | 12 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 36 +-
.../cpp/core-test/src/continuous_query_test.cpp | 30 +-
.../cpp/core/include/ignite/ignite_binding.h | 6 +-
.../impl/cache/cache_entry_processor_holder.h | 33 +-
.../cpp/odbc-test/include/complex_type.h | 26 +-
.../platforms/cpp/odbc-test/include/test_type.h | 37 +--
.../Binary/BinaryTypeConfiguration.cs | 1 -
.../Impl/Binary/BinaryObject.cs | 2 -
modules/spring-data/README.txt | 32 ++
modules/spring-data/licenses/apache-2.0.txt | 202 ++++++++++++
modules/spring-data/pom.xml | 79 +++++
.../springdata/repository/IgniteRepository.java | 58 ++++
.../config/EnableIgniteRepositories.java | 119 +++++++
.../config/IgniteRepositoriesRegistar.java | 36 ++
.../IgniteRepositoryConfigurationExtension.java | 49 +++
.../springdata/repository/config/Query.java | 37 +++
.../repository/config/RepositoryConfig.java | 39 +++
.../repository/config/package-info.java | 22 ++
.../springdata/repository/package-info.java | 22 ++
.../repository/query/IgniteQuery.java | 83 +++++
.../repository/query/IgniteQueryGenerator.java | 243 ++++++++++++++
.../repository/query/IgniteRepositoryQuery.java | 306 +++++++++++++++++
.../repository/query/package-info.java | 22 ++
.../support/IgniteRepositoryFactory.java | 168 ++++++++++
.../support/IgniteRepositoryFactoryBean.java | 85 +++++
.../support/IgniteRepositoryImpl.java | 160 +++++++++
.../repository/support/package-info.java | 22 ++
.../IgniteSpringDataCrudSelfTest.java | 233 +++++++++++++
.../IgniteSpringDataQueriesSelfTest.java | 291 ++++++++++++++++
.../misc/ApplicationConfiguration.java | 46 +++
.../apache/ignite/springdata/misc/Person.java | 97 ++++++
.../springdata/misc/PersonRepository.java | 92 ++++++
.../springdata/misc/PersonSecondRepository.java | 40 +++
.../testsuites/IgniteSpringDataTestSuite.java | 41 +++
modules/web-console/frontend/.eslintrc | 2 +-
modules/web-console/frontend/app/app.js | 3 -
.../form-field-datepicker.pug | 59 ----
.../form-field-datepicker.scss | 20 --
.../list-of-registered-users.categories.js | 4 +-
.../list-of-registered-users.column-defs.js | 44 +--
.../list-of-registered-users.controller.js | 141 ++++++--
.../list-of-registered-users.scss | 4 +
.../list-of-registered-users.tpl.pug | 76 +++--
.../ui-grid-header/ui-grid-header.scss | 91 -----
.../ui-grid-header/ui-grid-header.tpl.pug | 29 --
.../ui-grid-settings/ui-grid-settings.pug | 33 --
.../ui-grid-settings/ui-grid-settings.scss | 144 --------
.../frontend/app/helpers/jade/mixins.pug | 3 +
.../frontend/app/modules/states/admin.state.js | 11 +-
.../frontend/app/primitives/badge/index.scss | 4 +
.../frontend/app/primitives/btn/index.scss | 41 +++
.../app/primitives/datepicker/index.pug | 60 ++++
.../app/primitives/datepicker/index.scss | 64 ++++
.../frontend/app/primitives/dropdown/index.pug | 43 +++
.../frontend/app/primitives/dropdown/index.scss | 82 +++++
.../frontend/app/primitives/index.js | 8 +
.../frontend/app/primitives/page/index.scss | 35 ++
.../frontend/app/primitives/panel/index.scss | 51 +++
.../frontend/app/primitives/tabs/index.scss | 15 +
.../app/primitives/ui-grid-header/index.scss | 91 +++++
.../app/primitives/ui-grid-header/index.tpl.pug | 29 ++
.../app/primitives/ui-grid-settings/index.pug | 33 ++
.../app/primitives/ui-grid-settings/index.scss | 171 ++++++++++
.../frontend/app/primitives/ui-grid/index.scss | 329 +++++++++++++++++++
.../frontend/public/stylesheets/style.scss | 5 -
modules/web-console/frontend/views/base2.pug | 22 ++
.../frontend/views/settings/admin.tpl.pug | 3 +-
.../web-console/frontend/views/sql/sql.tpl.pug | 1 -
.../cache/websession/WebSessionFilter.java | 22 +-
parent/pom.xml | 1 +
pom.xml | 1 +
99 files changed, 4807 insertions(+), 866 deletions(-)
----------------------------------------------------------------------
[05/50] [abbrv] ignite git commit: IGNITE-4534: Page eviction
rebalance test fix.
Posted by ag...@apache.org.
IGNITE-4534: Page eviction rebalance test fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2068a751
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2068a751
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2068a751
Branch: refs/heads/master
Commit: 2068a7510b09e193a33ae074b5161f1166399b7e
Parents: 7eb1234
Author: Ivan Rakov <iv...@gmail.com>
Authored: Tue Apr 11 15:24:02 2017 +0300
Committer: Ivan Rakov <iv...@gmail.com>
Committed: Tue Apr 11 15:24:02 2017 +0300
----------------------------------------------------------------------
.../cache/eviction/paged/PageEvictionWithRebalanceTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2068a751/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionWithRebalanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionWithRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionWithRebalanceTest.java
index fd80201..f174908 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionWithRebalanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionWithRebalanceTest.java
@@ -51,11 +51,11 @@ public abstract class PageEvictionWithRebalanceTest extends PageEvictionAbstract
System.out.println(">>> Entries put: " + i);
}
- int size = cache.size(CachePeekMode.PRIMARY);
+ int size = cache.size(CachePeekMode.ALL);
System.out.println(">>> Resulting size: " + size);
- assertTrue(size < ENTRIES);
+ assertTrue(size < ENTRIES * 2); // Primary entries and backups.
for (int i = 3; i >= 1; i--) {
stopGrid(i);
@@ -64,7 +64,7 @@ public abstract class PageEvictionWithRebalanceTest extends PageEvictionAbstract
awaitPartitionMapExchange();
- int rebalanceSize = cache.size(CachePeekMode.PRIMARY);
+ int rebalanceSize = cache.size(CachePeekMode.ALL);
System.out.println(">>> Size after rebalance: " + rebalanceSize);
[39/50] [abbrv] ignite git commit: Merge master into
ignite-3477-master
Posted by ag...@apache.org.
Merge master into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/48494478
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/48494478
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/48494478
Branch: refs/heads/master
Commit: 48494478f14eb76b731a483e868d5e1bc7c58bb7
Parents: 1218c41 d298e75
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:30:54 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:30:54 2017 +0300
----------------------------------------------------------------------
.../jmh/future/JmhFutureAdapterBenchmark.java | 145 +++
.../java/org/apache/ignite/IgniteCache.java | 265 ++--
.../rendezvous/RendezvousAffinityFunction.java | 283 ++--
.../ignite/internal/IgniteInternalFuture.java | 15 -
.../eventstorage/GridEventStorageManager.java | 341 ++---
.../cache/GridCacheCompoundFuture.java | 63 +
.../cache/GridCacheCompoundIdentityFuture.java | 63 +
.../processors/cache/GridCacheFuture.java | 15 +
.../cache/GridCacheFutureAdapter.java | 61 +
.../GridCachePartitionExchangeManager.java | 16 +
.../distributed/GridCacheTxRecoveryFuture.java | 9 +-
.../dht/CacheDistributedGetFutureAdapter.java | 4 +-
.../distributed/dht/GridDhtLockFuture.java | 33 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 4 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 16 +-
.../dht/GridPartitionedSingleGetFuture.java | 4 +-
.../GridDhtAtomicAbstractUpdateFuture.java | 4 +-
.../GridNearAtomicAbstractUpdateFuture.java | 8 +-
.../GridNearAtomicSingleUpdateFuture.java | 24 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 24 +-
.../colocated/GridDhtColocatedLockFuture.java | 23 +-
.../GridDhtPartitionsExchangeFuture.java | 35 +-
.../distributed/near/GridNearLockFuture.java | 20 +-
...arOptimisticSerializableTxPrepareFuture.java | 2 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 9 +-
.../GridNearPessimisticTxPrepareFuture.java | 5 +-
.../near/GridNearTxFinishFuture.java | 13 +-
.../cache/distributed/near/GridNearTxLocal.java | 7 +-
.../near/GridNearTxPrepareFutureAdapter.java | 4 +-
.../cache/local/GridLocalLockFuture.java | 6 +-
.../query/GridCacheDistributedQueryFuture.java | 18 +-
.../query/GridCacheQueryFutureAdapter.java | 31 +-
.../transactions/IgniteTransactionsImpl.java | 4 +-
.../cache/transactions/TxDeadlockDetection.java | 5 +-
.../datastructures/GridCacheSemaphoreImpl.java | 12 +
.../platform/compute/PlatformCompute.java | 10 -
.../tcp/GridTcpMemcachedNioListener.java | 20 +-
.../util/future/GridCompoundFuture.java | 45 +-
.../util/future/GridFinishedFuture.java | 13 -
.../internal/util/future/GridFutureAdapter.java | 479 ++++---
.../internal/util/future/IgniteFutureImpl.java | 10 -
.../ignite/internal/util/lang/GridFunc.java | 1223 ++----------------
.../ignite/internal/util/lang/GridTupleV.java | 1 -
.../lang/gridfunc/AlwaysFalsePredicate.java | 46 +
.../util/lang/gridfunc/AlwaysTruePredicate.java | 46 +
.../util/lang/gridfunc/AlwaysTrueReducer.java | 56 +
.../gridfunc/AtomicIntegerFactoryCallable.java | 40 +
.../gridfunc/CacheEntryGetValueClosure.java | 42 +
.../gridfunc/CacheEntryHasPeekPredicate.java | 41 +
.../lang/gridfunc/ClusterNodeGetIdClosure.java | 41 +
.../ConcurrentDequeFactoryCallable.java | 40 +
.../ConcurrentHashSetFactoryCallable.java | 40 +
.../gridfunc/ConcurrentMapFactoryCallable.java | 41 +
.../lang/gridfunc/ContainsNodeIdsPredicate.java | 52 +
.../util/lang/gridfunc/ContainsPredicate.java | 55 +
.../gridfunc/EntryByKeyEvaluationPredicate.java | 53 +
.../gridfunc/EqualsClusterNodeIdPredicate.java | 51 +
.../util/lang/gridfunc/EqualsUuidPredicate.java | 50 +
.../lang/gridfunc/FlatCollectionWrapper.java | 66 +
.../util/lang/gridfunc/FlatIterator.java | 104 ++
.../util/lang/gridfunc/HasEqualIdPredicate.java | 51 +
.../lang/gridfunc/HasNotEqualIdPredicate.java | 51 +
.../util/lang/gridfunc/IdentityClosure.java | 39 +
.../util/lang/gridfunc/IntSumReducer.java | 51 +
.../util/lang/gridfunc/IsAllPredicate.java | 52 +
.../util/lang/gridfunc/IsNotAllPredicate.java | 52 +
.../util/lang/gridfunc/IsNotNullPredicate.java | 44 +
.../util/lang/gridfunc/LongSumReducer.java | 51 +
.../util/lang/gridfunc/MapFactoryCallable.java | 41 +
.../util/lang/gridfunc/MultipleIterator.java | 106 ++
.../util/lang/gridfunc/NoOpClosure.java | 39 +
.../lang/gridfunc/NotContainsPredicate.java | 54 +
.../util/lang/gridfunc/NotEqualPredicate.java | 53 +
.../lang/gridfunc/PredicateCollectionView.java | 78 ++
.../util/lang/gridfunc/PredicateMapView.java | 121 ++
.../util/lang/gridfunc/PredicateSetView.java | 153 +++
.../lang/gridfunc/ReadOnlyCollectionView.java | 95 ++
.../lang/gridfunc/ReadOnlyCollectionView2X.java | 100 ++
.../lang/gridfunc/RunnableWrapperClosure.java | 51 +
.../util/lang/gridfunc/SetFactoryCallable.java | 41 +
.../util/lang/gridfunc/StringConcatReducer.java | 79 ++
.../util/lang/gridfunc/ToStringClosure.java | 42 +
.../lang/gridfunc/TransformCollectionView.java | 79 ++
.../gridfunc/TransformFilteringIterator.java | 138 ++
.../util/lang/gridfunc/TransformMapView.java | 168 +++
.../util/lang/gridfunc/TransformMapView2.java | 165 +++
.../util/lang/gridfunc/package-info.java | 22 +
.../org/apache/ignite/lang/IgniteFuture.java | 15 -
.../TransactionDeadlockException.java | 4 +-
.../transactions/TransactionException.java | 80 ++
.../TransactionHeuristicException.java | 4 +-
.../TransactionOptimisticException.java | 4 +-
.../TransactionRollbackException.java | 4 +-
.../TransactionTimeoutException.java | 4 +-
...inityFunctionFastPowerOfTwoHashSelfTest.java | 17 -
...ndezvousAffinityFunctionSimpleBenchmark.java | 1100 ++++++++++++++++
...ousAffinityFunctionStandardHashSelfTest.java | 17 -
.../IgniteClientReconnectCacheTest.java | 16 +-
.../internal/binary/BinaryEnumsSelfTest.java | 2 +
.../cache/CacheKeepBinaryTransactionTest.java | 121 ++
.../GridCacheOrderedPreloadingSelfTest.java | 48 +-
.../GridCachePartitionedAffinitySpreadTest.java | 169 ---
...SemaphoreFailoverSafeReleasePermitsTest.java | 9 +-
...dCachePartitionedQueueEntryMoveSelfTest.java | 2 +-
.../near/GridCacheNearTxForceKeyTest.java | 6 +-
...cheRebalancingPartitionDistributionTest.java | 2 +-
.../datastreamer/DataStreamerImplSelfTest.java | 36 -
...gniteServiceConfigVariationsFullApiTest.java | 9 +-
.../IgniteServiceDynamicCachesSelfTest.java | 24 +-
.../util/future/IgniteFutureImplTest.java | 38 -
.../ignite/testframework/GridTestNode.java | 12 +-
.../testsuites/IgniteCacheTestSuite5.java | 2 +
.../external/HadoopExternalTaskExecutor.java | 2 +-
...PartitionOnAffinityRunAtomicCacheOpTest.java | 46 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 2 -
.../Binary/BinaryBuilderSelfTest.cs | 4 +-
.../Binary/BinaryDynamicRegistrationTest.cs | 11 +-
.../Binary/BinarySelfTest.cs | 4 +-
.../IgniteConfigurationSerializerTest.cs | 15 +-
.../Binary/BinaryConfiguration.cs | 24 +-
.../IgniteConfigurationSection.xsd | 8 +-
.../Binary/BinarySurrogateTypeDescriptor.cs | 10 +-
.../Impl/Binary/BinaryUtils.cs | 8 +-
.../Impl/Binary/Marshaller.cs | 14 +-
.../processors/schedule/ScheduleFutureImpl.java | 20 -
125 files changed, 5727 insertions(+), 2458 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 47cd9fe,1a7c2c6..388a434
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@@ -38,7 -38,7 +38,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 4f75480,23d7657..4faa475
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@@ -27,8 -27,8 +27,9 @@@ import org.apache.ignite.IgniteCheckedE
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 70fa1d1,964d423..6e7b324
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@@ -42,7 -42,7 +42,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 46fb30c,8512298..4442b3a
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@@ -208,9 -202,8 +208,9 @@@ public final class GridDhtColocatedLock
this.filter = filter;
this.skipStore = skipStore;
this.keepBinary = keepBinary;
+ this.recovery = recovery;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 103bd49,55aca2a..f6827ab
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@@ -187,11 -171,8 +187,8 @@@ public class GridDhtPartitionsExchangeF
@GridToStringInclude
private volatile IgniteInternalFuture<?> partReleaseFut;
- /** */
- private final Object mux = new Object();
-
/** Logger. */
- private IgniteLogger log;
+ private final IgniteLogger log;
/** Dynamic cache change requests. */
private Collection<DynamicCacheChangeRequest> reqs;
@@@ -1446,10 -1216,10 +1443,10 @@@
if (updateSingleMap) {
try {
- updatePartitionSingleMap(msg);
+ updatePartitionSingleMap(node, msg);
}
finally {
- synchronized (mux) {
+ synchronized (this) {
assert pendingSingleUpdates > 0;
pendingSingleUpdates--;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index eb953d9,8de01c9..b94c014
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@@ -214,9 -208,8 +214,9 @@@ public final class GridNearLockFuture e
this.filter = filter;
this.skipStore = skipStore;
this.keepBinary = keepBinary;
+ this.recovery = recovery;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSemaphoreImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
index 0000000,3e5bae9..16f8e97
mode 000000,100644..100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
@@@ -1,0 -1,1100 +1,1100 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.cache.affinity.rendezvous;
+
+ import java.io.Externalizable;
+ import java.io.ObjectInput;
+ import java.io.ObjectOutput;
+ import java.io.Serializable;
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
+ import org.apache.ignite.Ignite;
+ import org.apache.ignite.IgniteCheckedException;
+ import org.apache.ignite.IgniteException;
+ import org.apache.ignite.IgniteLogger;
+ import org.apache.ignite.cache.affinity.AffinityFunction;
+ import org.apache.ignite.cache.affinity.AffinityFunctionContext;
+ import org.apache.ignite.cache.affinity.AffinityNodeHashResolver;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunction;
+ import org.apache.ignite.cluster.ClusterNode;
+ import org.apache.ignite.configuration.CacheConfiguration;
+ import org.apache.ignite.configuration.IgniteConfiguration;
+ import org.apache.ignite.events.DiscoveryEvent;
+ import org.apache.ignite.events.EventType;
+ import org.apache.ignite.internal.IgniteNodeAttributes;
+ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+ import org.apache.ignite.internal.processors.affinity.GridAffinityFunctionContextImpl;
+ import org.apache.ignite.internal.processors.cache.GridCacheUtils;
+ import org.apache.ignite.internal.util.typedef.F;
+ import org.apache.ignite.internal.util.typedef.internal.A;
+ import org.apache.ignite.internal.util.typedef.internal.LT;
+ import org.apache.ignite.internal.util.typedef.internal.U;
+ import org.apache.ignite.lang.IgniteBiPredicate;
+ import org.apache.ignite.lang.IgniteBiTuple;
+ import org.apache.ignite.resources.IgniteInstanceResource;
+ import org.apache.ignite.resources.LoggerResource;
+ import org.apache.ignite.testframework.GridTestNode;
+ import org.apache.ignite.testframework.GridTestUtils;
+ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+ import java.io.IOException;
+ import java.io.PrintStream;
+ import java.nio.file.FileSystems;
+ import java.nio.file.Files;
+ import java.util.ArrayList;
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.UUID;
+ import java.util.concurrent.atomic.AtomicInteger;
+ import org.jetbrains.annotations.NotNull;
+ import org.jetbrains.annotations.Nullable;
+
+ /**
+ * Simple benchmarks, compatibility test and distribution check utils for affinity functions.
+ * Needs to check changes at the {@link RendezvousAffinityFunction}.
+ */
+ public class RendezvousAffinityFunctionSimpleBenchmark extends GridCommonAbstractTest {
+ /** MAC prefix. */
+ private static final String MAC_PREF = "MAC";
+
+ /** Ignite. */
+ private static Ignite ignite;
+
+ /** Max experiments. */
+ private static final int MAX_EXPERIMENTS = 200;
+
+ /** Max experiments. */
+ private TopologyModificationMode mode = TopologyModificationMode.CHANGE_LAST_NODE;
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 3 * 3600 * 1000;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ ignite = startGrid();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @param nodesCnt Count of nodes to generate.
+ * @return Nodes list.
+ */
+ private List<ClusterNode> createBaseNodes(int nodesCnt) {
+ List<ClusterNode> nodes = new ArrayList<>(nodesCnt);
+
+ for (int i = 0; i < nodesCnt; i++) {
+ GridTestNode node = new GridTestNode(UUID.randomUUID());
+
+ // two neighbours nodes
+ node.setAttribute(IgniteNodeAttributes.ATTR_MACS, MAC_PREF + i / 2);
+
+ nodes.add(node);
+ }
+ return nodes;
+ }
+
+ /**
+ * Modify the topology by remove the last / add new node.
+ *
+ * @param nodes Topology.
+ * @param prevAssignment Previous afinity.
+ * @param iter Number of iteration.
+ * @param backups Backups count.
+ * @return Affinity context.
+ */
+ private GridAffinityFunctionContextImpl nodesModificationChangeLast(List<ClusterNode> nodes,
+ List<List<ClusterNode>> prevAssignment, int iter, int backups) {
+ DiscoveryEvent discoEvt;
+
+ discoEvt = iter % 2 == 0 ? addNode(nodes, iter) : removeNode(nodes, nodes.size() - 1);
+
+ return new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, discoEvt, new AffinityTopologyVersion(nodes.size()), backups);
+ }
+
+ /**
+ * @param nodes Topology.
+ * @param idx Index of node to remove.
+ * @return Discovery event.
+ */
+ @NotNull private DiscoveryEvent removeNode(List<ClusterNode> nodes, int idx) {
+ return new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_LEFT, nodes.remove(idx));
+ }
+
+ /**
+ * Modify the topology by remove the first node / add new node
+ *
+ * @param nodes Topology.
+ * @param prevAssignment Previous affinity.
+ * @param iter Number of iteration.
+ * @param backups Backups count.
+ * @return Affinity context.
+ */
+ private GridAffinityFunctionContextImpl nodesModificationChangeFirst(List<ClusterNode> nodes,
+ List<List<ClusterNode>> prevAssignment, int iter, int backups) {
+ DiscoveryEvent discoEvt;
+
+ discoEvt = iter % 2 == 0 ? addNode(nodes, iter) : removeNode(nodes, 0);
+
+ return new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, discoEvt, new AffinityTopologyVersion(nodes.size()), backups);
+ }
+
+ /**
+ * @param nodes Topology.
+ * @param iter Iteration count.
+ * @return Discovery event.
+ */
+ @NotNull private DiscoveryEvent addNode(List<ClusterNode> nodes, int iter) {
+ GridTestNode node = new GridTestNode(UUID.randomUUID());
+
+ // two neighbours nodes
+ node.setAttribute(IgniteNodeAttributes.ATTR_MACS, MAC_PREF + "_add_" + iter / 4);
+
+ nodes.add(node);
+
+ return new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_JOINED, node);
+ }
+
+ /**
+ *
+ * @param aff Affinity function.
+ * @param nodes Topology.
+ * @param iter Number of iteration.
+ * @param prevAssignment Previous affinity assignment.
+ * @param backups Backups count.
+ * @return Tuple with affinity and time spend of the affinity calculation.
+ */
+ private IgniteBiTuple<Long, List<List<ClusterNode>>> assignPartitions(AffinityFunction aff,
+ List<ClusterNode> nodes, List<List<ClusterNode>> prevAssignment, int backups, int iter) {
+
+ GridAffinityFunctionContextImpl ctx = null;
+ switch (mode) {
+ case CHANGE_LAST_NODE:
+ ctx = nodesModificationChangeLast(nodes, prevAssignment, iter, backups);
+ break;
+ case CHANGE_FIRST_NODE:
+ ctx = nodesModificationChangeFirst(nodes, prevAssignment, iter, backups);
+ break;
+
+ case ADD:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, addNode(nodes, iter), new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ case REMOVE_RANDOM:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, removeNode(nodes, nodes.size() - 1),
+ new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ case NONE:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment,
+ new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_JOINED, nodes.get(nodes.size() - 1)),
+ new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ }
+
+ long start = System.currentTimeMillis();
+
+ List<List<ClusterNode>> assignments = aff.assignPartitions(ctx);
+
+ return F.t(System.currentTimeMillis() - start, assignments);
+ }
+
+ /**
+ * @param lst List pf measures.
+ * @return Average of measures.
+ */
+ private double average(Collection<Long> lst) {
+ if (lst.isEmpty())
+ return 0;
+
+ long sum = 0;
+
+ for (long l : lst)
+ sum += l;
+
+ return (double)sum / lst.size();
+ }
+
+ /**
+ * @param lst List pf measures.
+ * @param avg Average of the measures.
+ * @return Variance of the measures.
+ */
+ private double variance(Collection<Long> lst, double avg) {
+ if (lst.isEmpty())
+ return 0;
+
+ long sum = 0;
+
+ for (long l : lst)
+ sum += (l - avg) * (l - avg);
+
+ return Math.sqrt((double)sum / lst.size());
+ }
+
+ /**
+ * The table with count of partitions on node:
+ *
+ * column 0 - primary partitions counts
+ * column 1 - backup#0 partitions counts
+ * etc
+ *
+ * Rows correspond to the nodes.
+ *
+ * @param lst Affinity result.
+ * @param nodes Topology.
+ * @return Frequency distribution: counts of partitions on node.
+ */
+ private static List<List<Integer>> freqDistribution(List<List<ClusterNode>> lst, Collection<ClusterNode> nodes) {
+ List<Map<ClusterNode, AtomicInteger>> nodeMaps = new ArrayList<>();
+
+ int backups = lst.get(0).size();
+
+ for (int i = 0; i < backups; ++i) {
+ Map<ClusterNode, AtomicInteger> map = new HashMap<>();
+
+ for (List<ClusterNode> l : lst) {
+ ClusterNode node = l.get(i);
+
+ if (!map.containsKey(node))
+ map.put(node, new AtomicInteger(1));
+ else
+ map.get(node).incrementAndGet();
+ }
+
+ nodeMaps.add(map);
+ }
+
+ List<List<Integer>> byNodes = new ArrayList<>(nodes.size());
+ for (ClusterNode node : nodes) {
+ List<Integer> byBackups = new ArrayList<>(backups);
+
+ for (int j = 0; j < backups; ++j) {
+ if (nodeMaps.get(j).get(node) == null)
+ byBackups.add(0);
+ else
+ byBackups.add(nodeMaps.get(j).get(node).get());
+ }
+
+ byNodes.add(byBackups);
+ }
+ return byNodes;
+ }
+
+ /**
+ * @param byNodes Frequency distribution.
+ * @param suffix Label suffix.
+ * @throws IOException On error.
+ */
+ private void printDistribution(Collection<List<Integer>> byNodes, String suffix) throws IOException {
+ int nodes = byNodes.size();
+
+ try (PrintStream ps = new PrintStream(Files.newOutputStream(FileSystems.getDefault()
+ .getPath(String.format("%03d", nodes) + suffix)))) {
+
+ for (List<Integer> byNode : byNodes) {
+ for (int w : byNode)
+ ps.print(String.format("%05d ", w));
+
+ ps.println("");
+ }
+ }
+ }
+
+ /**
+ * Chi-square test of the distribution with uniform distribution.
+ *
+ * @param byNodes Distribution.
+ * @param parts Partitions count.
+ * @param goldenNodeWeight Weight of according the uniform distribution.
+ * @return Chi-square test.
+ */
+ private double chiSquare(List<List<Integer>> byNodes, int parts, double goldenNodeWeight) {
+ double sum = 0;
+
+ for (List<Integer> byNode : byNodes) {
+ double w = (double)byNode.get(0) / parts;
+
+ sum += (goldenNodeWeight - w) * (goldenNodeWeight - w) / goldenNodeWeight;
+ }
+ return sum;
+ }
+
+ /**
+ * @throws IOException On error.
+ */
+ public void testDistribution() throws IOException {
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 1024);
+
+ AffinityFunction aff1 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff1, "ignite", ignite);
+
+ affinityDistribution(aff0, aff1);
+ }
+
+ /**
+ *
+ * @param aff0 Affinity function to compare.
+ * @param aff1 Affinity function to compare.
+ */
+ private void affinityDistribution(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {5, 64, 100, 128, 200, 256, 300, 400, 500, 600};
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ assignPartitions(aff0, nodes0, null, 2, 0).get2();
+ List<List<ClusterNode>> lst0 = assignPartitions(aff0, nodes0, null, 2, 1).get2();
+
+ assignPartitions(aff1, nodes1, null, 2, 0).get2();
+ List<List<ClusterNode>> lst1 = assignPartitions(aff1, nodes1, null, 2, 1).get2();
+
+ List<List<Integer>> dist0 = freqDistribution(lst0, nodes0);
+ List<List<Integer>> dist1 = freqDistribution(lst1, nodes1);
+
+ info(String.format("Chi^2. Test %d nodes. %s: %f; %s: %f;",
+ nodesCnt,
+ aff0.getClass().getSimpleName(),
+ chiSquare(dist0, aff0.partitions(), 1.0 / nodesCnt),
+ aff1.getClass().getSimpleName(),
+ chiSquare(dist1, aff0.partitions(), 1.0 / nodesCnt)));
+
+ try {
+ printDistribution(dist0, "." + aff0.getClass().getSimpleName());
+ printDistribution(dist1, "." + aff1.getClass().getSimpleName());
+ }
+ catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void testAffinityBenchmarkAdd() {
+ mode = TopologyModificationMode.ADD;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff0, "ignite", ignite);
+
+ affinityBenchmark(aff0, new RendezvousAffinityFunction(true, 1024));
+ }
+
+ /**
+ *
+ */
+ public void testAffinityBenchmarkChangeLast() {
+ mode = TopologyModificationMode.CHANGE_LAST_NODE;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff0, "ignite", ignite);
+
+ affinityBenchmark(aff0, new RendezvousAffinityFunction(true, 1024));
+ }
+
+ /**
+ * @param aff0 Affinity function. to compare.
+ * @param aff1 Affinity function. to compare.
+ */
+ private void affinityBenchmark(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {100, 4, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ List<Long> times0 = new ArrayList<>(MAX_EXPERIMENTS);
+ List<Long> times1 = new ArrayList<>(MAX_EXPERIMENTS);
+
+ List<List<ClusterNode>> prevAssignment =
+ assignPartitions(aff0, nodes0, null, backups, 0).get2();
+
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ IgniteBiTuple<Long, List<List<ClusterNode>>> aa
+ = assignPartitions(aff0, nodes0, prevAssignment, backups, i);
+
+ prevAssignment = aa.get2();
+
+ times0.add(aa.get1());
+ }
+
+ prevAssignment = assignPartitions(aff1, nodes1, null, backups, 0).get2();
+
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ IgniteBiTuple<Long, List<List<ClusterNode>>> aa
+ = assignPartitions(aff1, nodes1, prevAssignment, backups, i);
+
+ prevAssignment = aa.get2();
+
+ times1.add(aa.get1());
+ }
+
+ double avr0 = average(times0);
+ double var0 = variance(times0, avr0);
+
+ double avr1 = average(times1);
+ double var1 = variance(times1, avr1);
+
+ info(String.format("Test %d nodes. %s: %.1f ms +/- %.3f ms; %s: %.1f ms +/- %.3f ms;",
+ nodesCnt,
+ aff0.getClass().getSimpleName(),
+ avr0, var0,
+ aff1.getClass().getSimpleName(),
+ avr1, var1));
+ }
+ }
+
+ /**
+ *
+ * @param affOld Old affinity.
+ * @param affNew New affinity/
+ * @return Count of partitions to migrate.
+ */
+ private int countPartitionsToMigrate(List<List<ClusterNode>> affOld, List<List<ClusterNode>> affNew) {
+ if (affOld == null || affNew == null)
+ return 0;
+
+ assertEquals(affOld.size(), affNew.size());
+
+ int diff = 0;
+ for (int i = 0; i < affOld.size(); ++i) {
+ Collection<ClusterNode> s0 = new HashSet<>(affOld.get(i));
+ Iterable<ClusterNode> s1 = new HashSet<>(affNew.get(i));
+
+ for (ClusterNode n : s1) {
+ if (!s0.contains(n))
+ ++diff;
+ }
+ }
+
+ return diff;
+ }
+
+ /**
+ *
+ */
+ public void testPartitionsMigrate() {
+ int[] nodesCnts = {2, 3, 10, 64, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 256);
- AffinityFunction aff1 = new FairAffinityFunction(true, 256);
++ // TODO choose another affinity function to compare.
++ AffinityFunction aff1 = new RendezvousAffinityFunction(true, 256);
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ List<List<ClusterNode>> affPrev = null;
+
+ int diffCnt0 = 0;
+
+ affPrev = assignPartitions(aff0, nodes0, null, backups, 0).get2();
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ List<List<ClusterNode>> affCur = assignPartitions(aff0, nodes0, affPrev, backups, i).get2();
+ diffCnt0 += countPartitionsToMigrate(affPrev, affCur);
+ affPrev = affCur;
+ }
+
+ affPrev = assignPartitions(aff1, nodes1, null, backups, 0).get2();
+ int diffCnt1 = 0;
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ List<List<ClusterNode>> affCur = assignPartitions(aff1, nodes1, affPrev, backups, i).get2();
+ diffCnt1 += countPartitionsToMigrate(affPrev, affCur);
+ affPrev = affCur;
+ }
+
+ double goldenChangeAffinity = (double)aff1.partitions() / nodesCnt * (backups + 1);
+ info(String.format("Test %d nodes. Golden: %.1f; %s: %.1f; %s: %.1f;",
+ nodesCnt, goldenChangeAffinity,
+ aff0.getClass().getSimpleName(),
+ (double)diffCnt0 / (MAX_EXPERIMENTS - 1),
+ aff1.getClass().getSimpleName(),
+ (double)diffCnt1 / (MAX_EXPERIMENTS - 1)));
+ }
+ }
+
+ /**
+ *
+ */
+ public void _testAffinityCompatibility() {
+ mode = TopologyModificationMode.ADD;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 1024);
+
+ // Use the full copy of the old implementaion of the RendezvousAffinityFunction to check the compatibility.
+ AffinityFunction aff1 = new RendezvousAffinityFunctionOld(true, 1024);
+ GridTestUtils.setFieldValue(aff1, "ignite", ignite);
+
+ affinityCompatibility(aff0, aff1);
+ }
+
+ /**
+ * @param aff0 Affinity function to compare.
+ * @param aff1 Affinity function to compare.
+ */
+ private void affinityCompatibility(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {64, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ mode = TopologyModificationMode.NONE;
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes = createBaseNodes(nodesCnt);
+
+ List<List<ClusterNode>> assignment0 = assignPartitions(aff0, nodes, null, backups, 0).get2();
+
+ List<List<ClusterNode>> assignment1 = assignPartitions(aff1, nodes, null, backups, 0).get2();
+
+ assertEquals (assignment0, assignment1);
+ }
+ }
+
+ /**
+ *
+ */
+ private enum TopologyModificationMode {
+ /** Change the last node. */
+ CHANGE_LAST_NODE,
+
+ /** Change the first node. */
+ CHANGE_FIRST_NODE,
+
+ /** Add. */
+ ADD,
+
+ /** Remove random. */
+ REMOVE_RANDOM,
+
+ /** Do nothing*/
+ NONE
+ }
+
+ /**
+ * Full copy of the old implementation of the RendezvousAffinityFunction to check compatibility and performance.
+ */
+ private static class RendezvousAffinityFunctionOld implements AffinityFunction, Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Default number of partitions. */
+ public static final int DFLT_PARTITION_COUNT = 1024;
+
+ /** Comparator. */
+ private static final Comparator<IgniteBiTuple<Long, ClusterNode>> COMPARATOR = new HashComparator();
+
+ /** Thread local message digest. */
+ private ThreadLocal<MessageDigest> digest = new ThreadLocal<MessageDigest>() {
+ @Override protected MessageDigest initialValue() {
+ try {
+ return MessageDigest.getInstance("MD5");
+ }
+ catch (NoSuchAlgorithmException e) {
+ assert false : "Should have failed in constructor";
+
+ throw new IgniteException("Failed to obtain message digest (digest was available in constructor)", e);
+ }
+ }
+ };
+
+ /** Number of partitions. */
+ private int parts;
+
+ /** Exclude neighbors flag. */
+ private boolean exclNeighbors;
+
+ /** Exclude neighbors warning. */
+ private transient boolean exclNeighborsWarn;
+
+ /** Optional backup filter. First node is primary, second node is a node being tested. */
+ private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
+
+ /** Optional affinity backups filter. The first node is a node being tested,
+ * the second is a list of nodes that are already assigned for a given partition (the first node in the list
+ * is primary). */
+ private IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter;
+
+ /** Hash ID resolver. */
+ private AffinityNodeHashResolver hashIdRslvr = null;
+
+ /** Ignite instance. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** Logger instance. */
+ @LoggerResource
+ private transient IgniteLogger log;
+
+ /**
+ * Empty constructor with all defaults.
+ */
+ public RendezvousAffinityFunctionOld() {
+ this(false);
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other
+ * and specified number of backups.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ */
+ public RendezvousAffinityFunctionOld(boolean exclNeighbors) {
+ this(exclNeighbors, DFLT_PARTITION_COUNT);
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other,
+ * and specified number of backups and partitions.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ * @param parts Total number of partitions.
+ */
+ public RendezvousAffinityFunctionOld(boolean exclNeighbors, int parts) {
+ this(exclNeighbors, parts, null);
+ }
+
+ /**
+ * Initializes optional counts for replicas and backups.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param parts Total number of partitions.
+ * @param backupFilter Optional back up filter for nodes. If provided, backups will be selected
+ * from all nodes that pass this filter. First argument for this filter is primary node, and second
+ * argument is node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ */
+ public RendezvousAffinityFunctionOld(int parts, @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ this(false, parts, backupFilter);
+ }
+
+ /**
+ * Private constructor.
+ *
+ * @param exclNeighbors Exclude neighbors flag.
+ * @param parts Partitions count.
+ * @param backupFilter Backup filter.
+ */
+ private RendezvousAffinityFunctionOld(boolean exclNeighbors, int parts,
+ IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ A.ensure(parts > 0, "parts > 0");
+
+ this.exclNeighbors = exclNeighbors;
+ this.parts = parts;
+ this.backupFilter = backupFilter;
+
+ try {
+ MessageDigest.getInstance("MD5");
+ }
+ catch (NoSuchAlgorithmException e) {
+ throw new IgniteException("Failed to obtain MD5 message digest instance.", e);
+ }
+ }
+
+ /**
+ * Gets total number of key partitions. To ensure that all partitions are
+ * equally distributed across all nodes, please make sure that this
+ * number is significantly larger than a number of nodes. Also, partition
+ * size should be relatively small. Try to avoid having partitions with more
+ * than quarter million keys.
+ * <p>
+ * Note that for fully replicated caches this method should always
+ * return {@code 1}.
+ *
+ * @return Total partition count.
+ */
+ public int getPartitions() {
+ return parts;
+ }
+
+ /**
+ * Sets total number of partitions.
+ *
+ * @param parts Total number of partitions.
+ */
+ public void setPartitions(int parts) {
+ A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <= " + CacheConfiguration.MAX_PARTITIONS_COUNT);
+
+ this.parts = parts;
+ }
+
+ /**
+ * Gets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @return Hash ID resolver.
+ */
+ @Deprecated
+ public AffinityNodeHashResolver getHashIdResolver() {
+ return hashIdRslvr;
+ }
+
+ /**
+ * Sets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @param hashIdRslvr Hash ID resolver.
+ *
+ * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead.
+ */
+ @Deprecated
+ public void setHashIdResolver(AffinityNodeHashResolver hashIdRslvr) {
+ this.hashIdRslvr = hashIdRslvr;
+ }
+
+ /**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, ClusterNode> getBackupFilter() {
+ return backupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param backupFilter Optional backup filter.
+ * @deprecated Use {@code affinityBackupFilter} instead.
+ */
+ @Deprecated
+ public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ this.backupFilter = backupFilter;
+ }
+
+ /**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is
+ * the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, List<ClusterNode>> getAffinityBackupFilter() {
+ return affinityBackupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is
+ * the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param affinityBackupFilter Optional backup filter.
+ */
+ public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode,
+ List<ClusterNode>> affinityBackupFilter) {
+ this.affinityBackupFilter = affinityBackupFilter;
+ }
+
+ /**
+ * Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public boolean isExcludeNeighbors() {
+ return exclNeighbors;
+ }
+
+ /**
+ * Sets flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public void setExcludeNeighbors(boolean exclNeighbors) {
+ this.exclNeighbors = exclNeighbors;
+ }
+
+ /**
+ * Resolves node hash.
+ *
+ * @param node Cluster node;
+ * @return Node hash.
+ */
+ public Object resolveNodeHash(ClusterNode node) {
+ if (hashIdRslvr != null)
+ return hashIdRslvr.resolve(node);
+ else
+ return node.consistentId();
+ }
+
+ /**
+ * Returns collection of nodes (primary first) for specified partition.
+ *
+ * @param d Message digest.
+ * @param part Partition.
+ * @param nodes Nodes.
+ * @param nodesHash Serialized nodes hashes.
+ * @param backups Number of backups.
+ * @param neighborhoodCache Neighborhood.
+ * @return Assignment.
+ */
+ public List<ClusterNode> assignPartition(MessageDigest d,
+ int part,
+ List<ClusterNode> nodes,
+ Map<ClusterNode, byte[]> nodesHash,
+ int backups,
+ @Nullable Map<UUID, Collection<ClusterNode>> neighborhoodCache) {
+ if (nodes.size() <= 1)
+ return nodes;
+
+ if (d == null)
+ d = digest.get();
+
+ List<IgniteBiTuple<Long, ClusterNode>> lst = new ArrayList<>(nodes.size());
+
+ try {
+ for (int i = 0; i < nodes.size(); i++) {
+ ClusterNode node = nodes.get(i);
+
+ byte[] nodeHashBytes = nodesHash.get(node);
+
+ if (nodeHashBytes == null) {
+ Object nodeHash = resolveNodeHash(node);
+
+ byte[] nodeHashBytes0 = U.marshal(ignite.configuration().getMarshaller(), nodeHash);
+
+ // Add 4 bytes for partition bytes.
+ nodeHashBytes = new byte[nodeHashBytes0.length + 4];
+
+ System.arraycopy(nodeHashBytes0, 0, nodeHashBytes, 4, nodeHashBytes0.length);
+
+ nodesHash.put(node, nodeHashBytes);
+ }
+
+ U.intToBytes(part, nodeHashBytes, 0);
+
+ d.reset();
+
+ byte[] bytes = d.digest(nodeHashBytes);
+
+ long hash =
+ (bytes[0] & 0xFFL)
+ | ((bytes[1] & 0xFFL) << 8)
+ | ((bytes[2] & 0xFFL) << 16)
+ | ((bytes[3] & 0xFFL) << 24)
+ | ((bytes[4] & 0xFFL) << 32)
+ | ((bytes[5] & 0xFFL) << 40)
+ | ((bytes[6] & 0xFFL) << 48)
+ | ((bytes[7] & 0xFFL) << 56);
+
+ lst.add(F.t(hash, node));
+ }
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+
+ Collections.sort(lst, COMPARATOR);
+
+ int primaryAndBackups = backups == Integer.MAX_VALUE ? nodes.size() : Math.min(backups + 1, nodes.size());
+
+ List<ClusterNode> res = new ArrayList<>(primaryAndBackups);
+
+ ClusterNode primary = lst.get(0).get2();
+
+ res.add(primary);
+
+ // Select backups.
+ if (backups > 0) {
+ for (int i = 1; i < lst.size() && res.size() < primaryAndBackups; i++) {
+ IgniteBiTuple<Long, ClusterNode> next = lst.get(i);
+
+ ClusterNode node = next.get2();
+
+ if (exclNeighbors) {
+ Collection<ClusterNode> allNeighbors = GridCacheUtils.neighborsForNodes(neighborhoodCache, res);
+
+ if (!allNeighbors.contains(node))
+ res.add(node);
+ }
+ else if (affinityBackupFilter != null && affinityBackupFilter.apply(node, res))
+ res.add(next.get2());
+ else if (backupFilter != null && backupFilter.apply(primary, node))
+ res.add(next.get2());
+ else if (affinityBackupFilter == null && backupFilter == null)
+ res.add(next.get2());
+ }
+ }
+
+ if (res.size() < primaryAndBackups && nodes.size() >= primaryAndBackups && exclNeighbors) {
+ // Need to iterate again in case if there are no nodes which pass exclude neighbors backups criteria.
+ for (int i = 1; i < lst.size() && res.size() < primaryAndBackups; i++) {
+ IgniteBiTuple<Long, ClusterNode> next = lst.get(i);
+
+ ClusterNode node = next.get2();
+
+ if (!res.contains(node))
+ res.add(next.get2());
+ }
+
+ if (!exclNeighborsWarn) {
+ LT.warn(log, "Affinity function excludeNeighbors property is ignored " +
+ "because topology has no enough nodes to assign backups.");
+
+ exclNeighborsWarn = true;
+ }
+ }
+
+ assert res.size() <= primaryAndBackups;
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void reset() {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partitions() {
+ return parts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partition(Object key) {
+ if (key == null)
+ throw new IllegalArgumentException("Null key is passed for a partition calculation. " +
+ "Make sure that an affinity key that is used is initialized properly.");
+
+ return U.safeAbs(key.hashCode() % parts);
+ }
+
+ /** {@inheritDoc} */
+ @Override public List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx) {
+ List<List<ClusterNode>> assignments = new ArrayList<>(parts);
+
+ Map<UUID, Collection<ClusterNode>> neighborhoodCache = exclNeighbors ?
+ GridCacheUtils.neighbors(affCtx.currentTopologySnapshot()) : null;
+
+ MessageDigest d = digest.get();
+
+ List<ClusterNode> nodes = affCtx.currentTopologySnapshot();
+
+ Map<ClusterNode, byte[]> nodesHash = U.newHashMap(nodes.size());
+
+ for (int i = 0; i < parts; i++) {
+ List<ClusterNode> partAssignment = assignPartition(d,
+ i,
+ nodes,
+ nodesHash,
+ affCtx.backups(),
+ neighborhoodCache);
+
+ assignments.add(partAssignment);
+ }
+
+ return assignments;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeNode(UUID nodeId) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeInt(parts);
+ out.writeBoolean(exclNeighbors);
+ out.writeObject(hashIdRslvr);
+ out.writeObject(backupFilter);
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ parts = in.readInt();
+ exclNeighbors = in.readBoolean();
+ hashIdRslvr = (AffinityNodeHashResolver)in.readObject();
+ backupFilter = (IgniteBiPredicate<ClusterNode, ClusterNode>)in.readObject();
+ }
+
+ /**
+ *
+ */
+ private static class HashComparator implements Comparator<IgniteBiTuple<Long, ClusterNode>>, Serializable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** {@inheritDoc} */
+ @Override public int compare(IgniteBiTuple<Long, ClusterNode> o1, IgniteBiTuple<Long, ClusterNode> o2) {
+ return o1.get1() < o2.get1() ? -1 : o1.get1() > o2.get1() ? 1 :
+ o1.get2().id().compareTo(o2.get2().id());
+ }
+ }
+ }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index 3e79da0,0716c20..7baea2e
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@@ -18,11 -18,7 +18,12 @@@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
+import org.apache.ignite.GridCacheAffinityBackupsSelfTest;
+import org.apache.ignite.IgniteCacheAffinitySelfTest;
+import org.apache.ignite.cache.affinity.AffinityClientNodeSelfTest;
+import org.apache.ignite.cache.affinity.AffinityHistoryCleanupTest;
+import org.apache.ignite.cache.affinity.local.LocalAffinityFunctionTest;
+ import org.apache.ignite.internal.processors.cache.CacheKeepBinaryTransactionTest;
import org.apache.ignite.internal.processors.cache.CacheNearReaderUpdateTest;
import org.apache.ignite.internal.processors.cache.CacheRebalancingSelfTest;
import org.apache.ignite.internal.processors.cache.CacheSerializableTransactionsTest;
@@@ -58,10 -53,12 +59,11 @@@ public class IgniteCacheTestSuite5 exte
suite.addTestSuite(IgniteCacheStoreCollectionTest.class);
suite.addTestSuite(IgniteCacheWriteBehindNoUpdateSelfTest.class);
suite.addTestSuite(IgniteCachePutStackOverflowSelfTest.class);
- suite.addTestSuite(GridCacheSwapSpaceSpiConsistencySelfTest.class);
+ suite.addTestSuite(CacheKeepBinaryTransactionTest.class);
suite.addTestSuite(CacheLateAffinityAssignmentTest.class);
- suite.addTestSuite(CacheLateAffinityAssignmentFairAffinityTest.class);
suite.addTestSuite(CacheLateAffinityAssignmentNodeJoinValidationTest.class);
+ suite.addTestSuite(IgniteActiveOnStartNodeJoinValidationSelfTest.class);
suite.addTestSuite(EntryVersionConsistencyReadThroughTest.class);
suite.addTestSuite(IgniteCacheSyncRebalanceModeSelfTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
index 61439b1,1dae576..f47cbe2
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@@ -497,8 -505,8 +497,8 @@@ namespace Apache.Ignite.Core.Impl.Binar
var ser = GetSerializer(_cfg, null, type, typeId, null, null, _log);
desc = desc == null
- ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.DefaultNameMapper,
- _cfg.DefaultIdMapper, ser, false, null, type.IsEnum, registered)
+ ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.NameMapper,
- _cfg.IdMapper, ser, false, null, type.IsEnum, null, registered)
++ _cfg.IdMapper, ser, false, null, type.IsEnum, registered)
: new BinaryFullTypeDescriptor(desc, type, ser, registered);
if (RegistrationDisabled)
[44/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://git-wip-us.apache.org/repos/asf/ignite into ignite-3477-master
Posted by ag...@apache.org.
Merge branch 'ignite-3477-master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/00d63a8a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/00d63a8a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/00d63a8a
Branch: refs/heads/master
Commit: 00d63a8a960680749920b32d12462717037026e3
Parents: 10485a0 4310583
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:37:47 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:37:47 2017 +0300
----------------------------------------------------------------------
examples/pom-standalone-lgpl.xml | 6 ++++++
examples/pom-standalone.xml | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
[29/50] [abbrv] ignite git commit: Merge remote-tracking branch
'upstream/ignite-3477-master' into ignite-3477-master
Posted by ag...@apache.org.
Merge remote-tracking branch 'upstream/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5839f481
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5839f481
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5839f481
Branch: refs/heads/master
Commit: 5839f481b7ff755bc68a521014ae308ac675baec
Parents: 21dcef2 0a69e45
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:46:27 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:46:27 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs | 1 -
.../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs | 2 --
2 files changed, 3 deletions(-)
----------------------------------------------------------------------
[21/50] [abbrv] ignite git commit: ignite-3477 : Fixed possible
endless iteration over queue with evicted patitions.
Posted by ag...@apache.org.
ignite-3477 : Fixed possible endless iteration over queue with evicted patitions.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5cded42e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5cded42e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5cded42e
Branch: refs/heads/master
Commit: 5cded42e8a45cd799122061499e0c95b00803504
Parents: face0c7
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Wed Apr 12 12:43:49 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Wed Apr 12 12:43:49 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/preloader/GridDhtPreloader.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5cded42e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c033b93..517f04a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -47,6 +47,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -72,6 +73,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
@@ -790,7 +792,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
try {
part.tryEvict();
- if (part.state() == RENTING || part.shouldBeRenting())
+ GridDhtPartitionState state = part.state();
+
+ if (state == RENTING || ((state == MOVING || state == OWNING) && part.shouldBeRenting()))
partsToEvict.push(part);
}
catch (Throwable ex) {
[40/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by ag...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1469f284
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1469f284
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1469f284
Branch: refs/heads/master
Commit: 1469f2848e0dc190400b85ee501bf513d47d0239
Parents: 4849447 c31de27
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:32:43 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:32:43 2017 +0300
----------------------------------------------------------------------
.../cache/transactions/IgniteTxHandler.java | 6 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 4 +-
...lerCacheClientRequestsMappingOnMissTest.java | 94 +++++++++++++++-----
.../near/GridCacheNearTxForceKeyTest.java | 7 ++
.../TxPessimisticDeadlockDetectionTest.java | 17 ++++
.../hibernate/HibernateKeyTransformer.java | 2 +-
.../cache/hibernate/HibernateKeyWrapper.java | 2 +-
...QueryNodeRestartDistributedJoinSelfTest.java | 17 +++-
8 files changed, 121 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1469f284/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
index 47d54d5,66f34c9..f5b7635
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
@@@ -78,6 -76,15 +78,13 @@@ public class GridCacheNearTxForceKeyTes
assertNull(cache.getAndPut(key, key));
- awaitPartitionMapExchange();
-
assertTrue(ignite0.affinity(null).isPrimary(ignite1.cluster().localNode(), key));
}
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
}
[32/50] [abbrv] ignite git commit: ignite-3477-master memory
configuration for test deadlockDetection
Posted by ag...@apache.org.
ignite-3477-master memory configuration for test deadlockDetection
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b066f609
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b066f609
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b066f609
Branch: refs/heads/master
Commit: b066f6094997fd3b1b21e624f5599781320cfa83
Parents: 355efcd
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 18:33:17 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 18:33:17 2017 +0300
----------------------------------------------------------------------
.../TxPessimisticDeadlockDetectionTest.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b066f609/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
index 9e7cb1c..4660972 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
@@ -36,6 +36,8 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
@@ -96,6 +98,18 @@ public class TxPessimisticDeadlockDetectionTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
}
+ MemoryConfiguration memCfg = new MemoryConfiguration();
+
+ MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
+
+ plc.setName("dfltPlc");
+ plc.setSize(MemoryConfiguration.DFLT_MEMORY_POLICY_SIZE * 10);
+
+ memCfg.setDefaultMemoryPolicyName("dfltPlc");
+ memCfg.setMemoryPolicies(plc);
+
+ cfg.setMemoryConfiguration(memCfg);
+
cfg.setClientMode(client);
return cfg;
@@ -190,6 +204,9 @@ public class TxPessimisticDeadlockDetectionTest extends GridCommonAbstractTest {
ccfg.setNearConfiguration(near ? new NearCacheConfiguration() : null);
ccfg.setWriteSynchronizationMode(syncMode);
+ if (cacheMode == LOCAL)
+ ccfg.setMemoryPolicyName("dfltPlc");
+
IgniteCache cache = ignite(0).createCache(ccfg);
if (near) {
[50/50] [abbrv] ignite git commit: Merge branch master into
ignite-3477-master
Posted by ag...@apache.org.
Merge branch master into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/922b2582
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/922b2582
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/922b2582
Branch: refs/heads/master
Commit: 922b2582d0053455b7616afd5ff35a59027871e4
Parents: b6b3d37 7e106cd
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 21:35:09 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 21:35:09 2017 +0300
----------------------------------------------------------------------
.../include/ignite/binary/binary_consts.h | 86 +++--
.../include/ignite/binary/binary_containers.h | 12 +-
.../include/ignite/binary/binary_raw_reader.h | 6 +-
.../include/ignite/binary/binary_raw_writer.h | 16 +-
.../include/ignite/binary/binary_reader.h | 6 +-
.../include/ignite/binary/binary_writer.h | 13 +-
.../ignite/impl/binary/binary_reader_impl.h | 31 +-
.../include/ignite/impl/binary/binary_schema.h | 19 +-
.../ignite/impl/binary/binary_writer_impl.h | 18 +-
.../cpp/binary/src/binary/binary_raw_reader.cpp | 2 +-
.../cpp/binary/src/binary/binary_reader.cpp | 2 +-
.../src/impl/binary/binary_reader_impl.cpp | 50 +--
.../binary/src/impl/binary/binary_schema.cpp | 17 +-
.../src/impl/binary/binary_writer_impl.cpp | 14 +-
.../src/binary_reader_writer_raw_test.cpp | 34 +-
.../core-test/src/binary_reader_writer_test.cpp | 96 ++---
.../cpp/core-test/src/cache_store_test.cpp | 6 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 24 +-
.../cpp/core-test/src/transactions_test.cpp | 76 ++--
.../cpp/core/include/ignite/cache/cache.h | 12 +-
.../core/include/ignite/cache/cache_peek_mode.h | 67 ++--
.../cpp/core/include/ignite/ignite_binding.h | 4 +-
.../cpp/core/include/ignite/impl/bindings.h | 4 +-
.../impl/cache/cache_entry_processor_holder.h | 37 +-
.../include/ignite/impl/ignite_binding_impl.h | 11 +-
.../ignite/impl/interop/interop_target.h | 21 +-
.../ignite/impl/transactions/transaction_impl.h | 4 +-
.../impl/transactions/transactions_impl.h | 10 +-
.../include/ignite/transactions/transaction.h | 12 +-
.../ignite/transactions/transaction_consts.h | 181 ++++-----
.../include/ignite/transactions/transactions.h | 16 +-
.../impl/binary/binary_type_updater_impl.cpp | 17 +-
.../continuous/continuous_query_handle_impl.cpp | 13 +-
.../src/impl/cluster/cluster_group_impl.cpp | 9 +-
.../cpp/core/src/impl/ignite_environment.cpp | 42 +-
.../core/src/impl/interop/interop_target.cpp | 12 +-
.../src/impl/transactions/transaction_impl.cpp | 18 +-
.../src/impl/transactions/transactions_impl.cpp | 92 +++--
.../cpp/core/src/transactions/transaction.cpp | 8 +-
.../cpp/core/src/transactions/transactions.cpp | 20 +-
.../src/application_data_buffer_test.cpp | 94 ++---
.../platforms/cpp/odbc-test/src/column_test.cpp | 56 +--
.../cpp/odbc-test/src/connection_info_test.cpp | 72 ++--
.../platforms/cpp/odbc-test/src/row_test.cpp | 16 +-
.../ignite/odbc/app/application_data_buffer.h | 6 +-
.../cpp/odbc/include/ignite/odbc/column.h | 2 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 350 +++++++++--------
.../ignite/odbc/config/connection_info.h | 2 +-
.../cpp/odbc/include/ignite/odbc/connection.h | 18 +-
.../ignite/odbc/diagnostic/diagnosable.h | 4 +-
.../odbc/diagnostic/diagnosable_adapter.h | 8 +-
.../ignite/odbc/diagnostic/diagnostic_record.h | 4 +-
.../odbc/diagnostic/diagnostic_record_storage.h | 8 +-
.../cpp/odbc/include/ignite/odbc/environment.h | 10 +-
.../cpp/odbc/include/ignite/odbc/message.h | 56 +--
.../ignite/odbc/query/column_metadata_query.h | 10 +-
.../odbc/include/ignite/odbc/query/data_query.h | 23 +-
.../ignite/odbc/query/foreign_keys_query.h | 8 +-
.../ignite/odbc/query/primary_keys_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/query/query.h | 32 +-
.../ignite/odbc/query/special_columns_query.h | 8 +-
.../ignite/odbc/query/table_metadata_query.h | 10 +-
.../include/ignite/odbc/query/type_info_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/row.h | 2 +-
.../cpp/odbc/include/ignite/odbc/statement.h | 52 +--
.../odbc/system/ui/dsn_configuration_window.h | 35 +-
.../cpp/odbc/include/ignite/odbc/type_traits.h | 91 ++---
.../ignite/odbc/system/ui/custom_window.h | 12 +-
.../odbc/os/win/src/system/ui/custom_window.cpp | 4 +-
.../src/system/ui/dsn_configuration_window.cpp | 42 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 2 +-
.../odbc/src/app/application_data_buffer.cpp | 386 +++++++++----------
.../platforms/cpp/odbc/src/app/parameter.cpp | 6 +-
modules/platforms/cpp/odbc/src/column.cpp | 14 +-
modules/platforms/cpp/odbc/src/common_types.cpp | 54 +--
.../cpp/odbc/src/config/connection_info.cpp | 12 +-
modules/platforms/cpp/odbc/src/connection.cpp | 74 ++--
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 4 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 46 +--
.../diagnostic/diagnostic_record_storage.cpp | 78 ++--
modules/platforms/cpp/odbc/src/environment.cpp | 62 +--
modules/platforms/cpp/odbc/src/odbc.cpp | 20 +-
.../odbc/src/query/column_metadata_query.cpp | 123 +++---
.../platforms/cpp/odbc/src/query/data_query.cpp | 102 ++---
.../cpp/odbc/src/query/foreign_keys_query.cpp | 26 +-
.../cpp/odbc/src/query/primary_keys_query.cpp | 71 ++--
.../odbc/src/query/special_columns_query.cpp | 26 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 81 ++--
.../cpp/odbc/src/query/type_info_query.cpp | 231 +++++------
modules/platforms/cpp/odbc/src/row.cpp | 4 +-
modules/platforms/cpp/odbc/src/statement.cpp | 258 ++++++-------
modules/platforms/cpp/odbc/src/type_traits.cpp | 46 +--
92 files changed, 2004 insertions(+), 1911 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/cache_store_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/cache_test.cpp
index ab29797,d3f73be..cfbd86a
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@@ -129,9 -125,9 +129,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys
cache.RemoveAll();
- size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@@ -152,9 -148,9 +152,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysI
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ int size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@@ -175,9 -171,9 +175,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysI
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ int size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/transactions_test.cpp
----------------------------------------------------------------------
[19/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by ag...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/06cee57e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/06cee57e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/06cee57e
Branch: refs/heads/master
Commit: 06cee57e623a1c70c9bfc23547cbc66f2b62eac9
Parents: b9867eb face0c7
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 19:53:59 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 19:53:59 2017 +0300
----------------------------------------------------------------------
.../configuration/DataPageEvictionMode.java | 16 ++++++++++++++--
.../configuration/MemoryPolicyConfiguration.java | 18 ++++++++++++------
.../core/src/test/config/spring-multicache.xml | 16 ++++++++++++++++
.../eviction/paged/PageEvictionAbstractTest.java | 4 ++--
.../eviction/paged/PageEvictionMultinodeTest.java | 4 ++--
.../paged/PageEvictionReadThroughTest.java | 2 +-
6 files changed, 47 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[25/50] [abbrv] ignite git commit: .NET: Fix code analysis
Posted by ag...@apache.org.
.NET: Fix code analysis
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0a69e45a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0a69e45a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0a69e45a
Branch: refs/heads/master
Commit: 0a69e45a200febcc35913485da545c7aee6f0709
Parents: 7883668
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Apr 12 15:37:47 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Apr 12 15:37:47 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs | 1 -
.../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs | 2 --
2 files changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a69e45a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
index d342fa5..c36b9fd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
@@ -18,7 +18,6 @@
namespace Apache.Ignite.Core.Binary
{
using System;
- using System.Collections.Generic;
using Apache.Ignite.Core.Impl.Common;
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a69e45a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
index c8c904d..690a0a4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
@@ -256,8 +256,6 @@ namespace Apache.Ignite.Core.Impl.Binary
if (TypeId != that.TypeId)
return false;
- var desc = _marsh.GetDescriptor(true, TypeId);
-
return BinaryArrayEqualityComparer.Equals(this, that);
}
[43/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing .NET tests
Posted by ag...@apache.org.
IGNITE-3477 - Fixing .NET tests
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10485a0f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10485a0f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10485a0f
Branch: refs/heads/master
Commit: 10485a0f99faa67b25682e623167e1246b83cc67
Parents: 8d2b020
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:37:23 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:37:23 2017 +0300
----------------------------------------------------------------------
.../internal/binary/BinaryReaderExImpl.java | 2 +-
.../ignite/internal/binary/BinaryUtils.java | 14 ++++++--
.../cache/database/tree/io/DataPageIO.java | 5 +--
...tCachePluginConfigurationClosureFactory.java | 37 ++++++++++++++++++++
4 files changed, 52 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index d6fefe3..c8ca803 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -1911,7 +1911,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
break;
case BINARY_OBJ:
- obj = BinaryUtils.doReadBinaryObject(in, ctx);
+ obj = BinaryUtils.doReadBinaryObject(in, ctx, false);
((BinaryObjectImpl)obj).context(ctx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/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 e4011a4..f36c137 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
@@ -1451,7 +1451,7 @@ public class BinaryUtils {
/**
* @return Value.
*/
- public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) {
+ public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx, boolean detach) {
if (in.offheapPointer() > 0) {
int len = in.readInt();
@@ -1467,7 +1467,15 @@ public class BinaryUtils {
byte[] arr = doReadByteArray(in);
int start = in.readInt();
- return new BinaryObjectImpl(ctx, arr, start);
+ BinaryObjectImpl binO = new BinaryObjectImpl(ctx, arr, start);
+
+ if (detach) {
+ binO.detachAllowed(true);
+
+ return binO.detach();
+ }
+
+ return binO;
}
}
@@ -1892,7 +1900,7 @@ public class BinaryUtils {
return doReadMap(in, ctx, ldr, handles, false, null);
case GridBinaryMarshaller.BINARY_OBJ:
- return doReadBinaryObject(in, ctx);
+ return doReadBinaryObject(in, ctx, detach);
case GridBinaryMarshaller.ENUM:
return doReadBinaryEnum(in, ctx, doReadEnumType(in));
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
index 9546890..3ed69e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
@@ -1397,10 +1397,11 @@ public class DataPageIO extends PageIO {
PageUtils.putShort(addr, 0, (short)payloadSize);
addr += 2;
- if (cacheIdSize != 0)
+ if (cacheIdSize != 0) {
PageUtils.putInt(addr, 0, row.cacheId());
- addr += cacheIdSize;
+ addr += cacheIdSize;
+ }
addr += row.key().putValue(addr);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
new file mode 100644
index 0000000..c294342
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.plugin.cache;
+
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosure;
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosureFactory;
+
+/**
+ * Test closure factory.
+ */
+public class PlatformTestCachePluginConfigurationClosureFactory
+ implements PlatformCachePluginConfigurationClosureFactory {
+ /** {@inheritDoc} */
+ @Override public int id() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public PlatformCachePluginConfigurationClosure create() {
+ return new PlatformTestCachePluginConfigurationClosure();
+ }
+}