Repository: ignite Updated Branches: refs/heads/ignite-3477-master 3eb05de5e -> b62d44646
.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/ignite-3477-master Commit: b62d44646b93049a3795780ff5eaf7af070d3d9b Parents: 3eb05de Author: Pavel Tupitsyn <[email protected]> Authored: Tue Apr 11 13:28:14 2017 +0300 Committer: Pavel Tupitsyn <[email protected]> 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 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT 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;
