ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-2996 .NET: Added IgniteConfiguration.isLateAffinityAssignment method.
Date Thu, 28 Apr 2016 07:25:21 GMT
Repository: ignite
Updated Branches:
  refs/heads/master f9bd9a338 -> dcde8d1a3


IGNITE-2996 .NET: Added IgniteConfiguration.isLateAffinityAssignment method.


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

Branch: refs/heads/master
Commit: dcde8d1a3fa5df74fb7a7256de4f148cfb1b170d
Parents: f9bd9a3
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Thu Apr 28 10:25:11 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Apr 28 10:25:11 2016 +0300

----------------------------------------------------------------------
 .../utils/PlatformConfigurationUtils.java       |  2 ++
 .../IgniteConfigurationSerializerTest.cs        |  3 +-
 .../IgniteConfigurationTest.cs                  |  2 ++
 .../Apache.Ignite.Core/IgniteConfiguration.cs   | 34 ++++++++++++++++++++
 4 files changed, 40 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dcde8d1a/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 898bcf9..5ee19c1 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
@@ -345,6 +345,7 @@ public class PlatformConfigurationUtils {
         cfg.setWorkDirectory(in.readString());
         cfg.setLocalHost(in.readString());
         cfg.setDaemon(in.readBoolean());
+        cfg.setLateAffinityAssignment(in.readBoolean());
 
         readCacheConfigurations(in, cfg);
         readDiscoveryConfiguration(in, cfg);
@@ -671,6 +672,7 @@ public class PlatformConfigurationUtils {
         w.writeString(cfg.getWorkDirectory());
         w.writeString(cfg.getLocalHost());
         w.writeBoolean(cfg.isDaemon());
+        w.writeBoolean(cfg.isLateAffinityAssignment());
 
         CacheConfiguration[] cacheCfg = cfg.getCacheConfiguration();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/dcde8d1a/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 ae48e71..36bda2e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -54,7 +54,7 @@ namespace Apache.Ignite.Core.Tests
         [Test]
         public void TestPredefinedXml()
         {
-            var xml = @"<igniteConfig workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10'
isDaemon='true'>
+            var xml = @"<igniteConfig workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10'
isDaemon='true' isLateAffinityAssignment='false'>
                             <localhost>127.1.1.1</localhost>
                             <binaryConfiguration compactFooter='false'>
                                 <defaultNameMapper type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+NameMapper,
Apache.Ignite.Core.Tests' bar='testBar' />
@@ -107,6 +107,7 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual("c:", cfg.WorkDirectory);
             Assert.AreEqual("127.1.1.1", cfg.Localhost);
             Assert.IsTrue(cfg.IsDaemon);
+            Assert.IsFalse(cfg.IsLateAffinityAssignment);
             Assert.AreEqual(1024, cfg.JvmMaxMemoryMb);
             Assert.AreEqual(TimeSpan.FromSeconds(10), cfg.MetricsLogFrequency);
             Assert.AreEqual(TimeSpan.FromMinutes(1), ((TcpDiscoverySpi)cfg.DiscoverySpi).JoinTimeout);

http://git-wip-us.apache.org/repos/asf/ignite/blob/dcde8d1a/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 c6a1cab..45b9a05 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -111,6 +111,7 @@ namespace Apache.Ignite.Core.Tests
                 Assert.IsTrue(File.Exists(resCfg.JvmDllPath));
                 Assert.AreEqual(cfg.Localhost, resCfg.Localhost);
                 Assert.AreEqual(cfg.IsDaemon, resCfg.IsDaemon);
+                Assert.AreEqual(cfg.IsLateAffinityAssignment, resCfg.IsLateAffinityAssignment);
                 Assert.AreEqual(cfg.UserAttributes, resCfg.UserAttributes);
 
                 var atm = cfg.AtomicConfiguration;
@@ -369,6 +370,7 @@ namespace Apache.Ignite.Core.Tests
                 JvmClasspath = TestUtils.CreateTestClasspath(),
                 Localhost = "127.0.0.1",
                 IsDaemon = true,
+                IsLateAffinityAssignment = false,
                 UserAttributes = Enumerable.Range(1, 10).ToDictionary(x => x.ToString(),
x => (object) x),
                 AtomicConfiguration = new AtomicConfiguration
                 {

http://git-wip-us.apache.org/repos/asf/ignite/blob/dcde8d1a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
index e5f6a83..e14c15b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -26,6 +26,7 @@
     using System.IO;
     using System.Linq;
     using Apache.Ignite.Core.Binary;
+    using Apache.Ignite.Core.Cache;
     using Apache.Ignite.Core.Cache.Configuration;
     using Apache.Ignite.Core.Cluster;
     using Apache.Ignite.Core.DataStructures.Configuration;
@@ -91,6 +92,11 @@
         public const int DefaultNetworkSendRetryCount = 3;
 
         /// <summary>
+        /// Default late affinity assignment mode.
+        /// </summary>
+        public const bool DefaultIsLateAffinityAssignment = true;
+
+        /// <summary>
         /// Initializes a new instance of the <see cref="IgniteConfiguration"/> class.
         /// </summary>
         public IgniteConfiguration()
@@ -105,6 +111,7 @@
             NetworkTimeout = DefaultNetworkTimeout;
             NetworkSendRetryCount = DefaultNetworkSendRetryCount;
             NetworkSendRetryDelay = DefaultNetworkSendRetryDelay;
+            IsLateAffinityAssignment = DefaultIsLateAffinityAssignment;
         }
 
         /// <summary>
@@ -181,6 +188,7 @@
             writer.WriteString(WorkDirectory);
             writer.WriteString(Localhost);
             writer.WriteBoolean(IsDaemon);
+            writer.WriteBoolean(IsLateAffinityAssignment);
 
             // Cache config
             var caches = CacheConfiguration;
@@ -283,6 +291,7 @@
             WorkDirectory = r.ReadString();
             Localhost = r.ReadString();
             IsDaemon = r.ReadBoolean();
+            IsLateAffinityAssignment = r.ReadBoolean();
 
             // Cache config
             var cacheCfgCount = r.ReadInt();
@@ -573,5 +582,30 @@
         /// Gets or sets the transaction configuration.
         /// </summary>
         public TransactionConfiguration TransactionConfiguration { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether late affinity assignment mode should
be used.
+        /// <para />
+        /// On each topology change, for each started cache, partition-to-node mapping is
+        /// calculated using AffinityFunction for cache. When late
+        /// affinity assignment mode is disabled then new affinity mapping is applied immediately.
+        /// <para />
+        /// With late affinity assignment mode, if primary node was changed for some partition,
but data for this
+        /// partition is not rebalanced yet on this node, then current primary is not changed
and new primary 
+        /// is temporary assigned as backup. This nodes becomes primary only when rebalancing
for all assigned primary 
+        /// partitions is finished. This mode can show better performance for cache operations,
since when cache 
+        /// primary node executes some operation and data is not rebalanced yet, then it
sends additional message 
+        /// to force rebalancing from other nodes.
+        /// <para />
+        /// Note, that <see cref="ICacheAffinity"/> interface provides assignment information
taking late assignment
+        /// into account, so while rebalancing for new primary nodes is not finished it can
return assignment 
+        /// which differs from assignment calculated by AffinityFunction.
+        /// <para />
+        /// This property should have the same value for all nodes in cluster.
+        /// <para />
+        /// If not provided, default value is <see cref="DefaultIsLateAffinityAssignment"/>.
+        /// </summary>
+        [DefaultValue(DefaultIsLateAffinityAssignment)]
+        public bool IsLateAffinityAssignment { get; set; }
     }
 }


Mime
View raw message