IGNITE-6516 .NET: PersistentStoreConfiguration.WriteThrottlingEnabled
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5d6ff970 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5d6ff970 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5d6ff970 Branch: refs/heads/ignite-2.3 Commit: 5d6ff970d733adec934825556856d319cfba196d Parents: 2108d0c Author: Pavel Tupitsyn <[email protected]> Authored: Thu Sep 28 19:17:18 2017 +0300 Committer: Pavel Tupitsyn <[email protected]> Committed: Thu Sep 28 19:17:18 2017 +0300 ---------------------------------------------------------------------- .../platform/utils/PlatformConfigurationUtils.java | 4 +++- .../IgniteConfigurationSerializerTest.cs | 6 ++++-- .../IgniteConfigurationTest.cs | 6 +++++- .../IgniteConfigurationSection.xsd | 5 +++++ .../PersistentStore/PersistentStoreConfiguration.cs | 15 +++++++++++++++ 5 files changed, 32 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5d6ff970/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 fe214da..aa4f168 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 @@ -1578,7 +1578,8 @@ public class PlatformConfigurationUtils { .setMetricsEnabled(in.readBoolean()) .setSubIntervals(in.readInt()) .setRateTimeInterval(in.readLong()) - .setCheckpointWriteOrder(CheckpointWriteOrder.fromOrdinal(in.readInt())); + .setCheckpointWriteOrder(CheckpointWriteOrder.fromOrdinal(in.readInt())) + .setWriteThrottlingEnabled(in.readBoolean()); } /** @@ -1612,6 +1613,7 @@ public class PlatformConfigurationUtils { w.writeInt(cfg.getSubIntervals()); w.writeLong(cfg.getRateTimeInterval()); w.writeInt(cfg.getCheckpointWriteOrder().ordinal()); + w.writeBoolean(cfg.isWriteThrottlingEnabled()); } else { w.writeBoolean(false); http://git-wip-us.apache.org/repos/asf/ignite/blob/5d6ff970/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 2530243..83700cb 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs @@ -143,7 +143,7 @@ namespace Apache.Ignite.Core.Tests </memoryConfiguration> <sqlConnectorConfiguration host='bar' port='10' portRange='11' socketSendBufferSize='12' socketReceiveBufferSize='13' tcpNoDelay='true' maxOpenCursorsPerConnection='14' threadPoolSize='15' /> <clientConnectorConfiguration host='bar' port='10' portRange='11' socketSendBufferSize='12' socketReceiveBufferSize='13' tcpNoDelay='true' maxOpenCursorsPerConnection='14' threadPoolSize='15' /> - <persistentStoreConfiguration alwaysWriteFullPages='true' checkpointingFrequency='00:00:1' checkpointingPageBufferSize='2' checkpointingThreads='3' lockWaitTime='00:00:04' persistentStorePath='foo' tlbSize='5' walArchivePath='bar' walFlushFrequency='00:00:06' walFsyncDelayNanos='7' walHistorySize='8' walMode='None' walRecordIteratorBufferSize='9' walSegments='10' walSegmentSize='11' walStorePath='baz' metricsEnabled='true' rateTimeInterval='0:0:6' subIntervals='3' checkpointWriteOrder='Random' /> + <persistentStoreConfiguration alwaysWriteFullPages='true' checkpointingFrequency='00:00:1' checkpointingPageBufferSize='2' checkpointingThreads='3' lockWaitTime='00:00:04' persistentStorePath='foo' tlbSize='5' walArchivePath='bar' walFlushFrequency='00:00:06' walFsyncDelayNanos='7' walHistorySize='8' walMode='None' walRecordIteratorBufferSize='9' walSegments='10' walSegmentSize='11' walStorePath='baz' metricsEnabled='true' rateTimeInterval='0:0:6' subIntervals='3' checkpointWriteOrder='Random' writeThrottlingEnabled='true' /> <consistentId type='System.String'>someId012</consistentId> <localEventListeners> <localEventListener type='Apache.Ignite.Core.Events.LocalEventListener`1[[Apache.Ignite.Core.Events.CacheRebalancingEvent]]'> @@ -349,6 +349,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(3, pers.SubIntervals); Assert.AreEqual(TimeSpan.FromSeconds(6), pers.RateTimeInterval); Assert.AreEqual(CheckpointWriteOrder.Random, pers.CheckpointWriteOrder); + Assert.IsTrue(pers.WriteThrottlingEnabled); var listeners = cfg.LocalEventListeners; Assert.AreEqual(2, listeners.Count); @@ -906,7 +907,8 @@ namespace Apache.Ignite.Core.Tests SubIntervals = 25, MetricsEnabled = true, RateTimeInterval = TimeSpan.FromDays(1), - CheckpointWriteOrder = CheckpointWriteOrder.Random + CheckpointWriteOrder = CheckpointWriteOrder.Random, + WriteThrottlingEnabled = true }, IsActiveOnStart = false, ConsistentId = "myId123", http://git-wip-us.apache.org/repos/asf/ignite/blob/5d6ff970/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 995924a..efa404d 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs @@ -277,6 +277,8 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(pers.MetricsEnabled, resPers.MetricsEnabled); Assert.AreEqual(pers.RateTimeInterval, resPers.RateTimeInterval); Assert.AreEqual(pers.SubIntervals, resPers.SubIntervals); + Assert.AreEqual(pers.CheckpointWriteOrder, resPers.CheckpointWriteOrder); + Assert.AreEqual(pers.WriteThrottlingEnabled, resPers.WriteThrottlingEnabled); } } @@ -588,6 +590,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(PersistentStoreConfiguration.DefaultWalStorePath, cfg.WalStorePath); Assert.AreEqual(PersistentStoreConfiguration.DefaultWalArchivePath, cfg.WalArchivePath); Assert.AreEqual(PersistentStoreConfiguration.DefaultCheckpointWriteOrder, cfg.CheckpointWriteOrder); + Assert.AreEqual(PersistentStoreConfiguration.DefaultWriteThrottlingEnabled, cfg.WriteThrottlingEnabled); } /// <summary> @@ -826,7 +829,8 @@ namespace Apache.Ignite.Core.Tests MetricsEnabled = true, SubIntervals = 7, RateTimeInterval = TimeSpan.FromSeconds(9), - CheckpointWriteOrder = CheckpointWriteOrder.Random + CheckpointWriteOrder = CheckpointWriteOrder.Random, + WriteThrottlingEnabled = true }, ConsistentId = new MyConsistentId {Data = "abc"} }; http://git-wip-us.apache.org/repos/asf/ignite/blob/5d6ff970/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 80bacf4..6788ef0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd @@ -1468,6 +1468,11 @@ <xs:documentation>Checkpoint page write order on disk.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="writeThrottlingEnabled" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Threads that generate dirty pages too fast during ongoing checkpoint will be throttled.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> <xs:element name="pluginConfigurations" minOccurs="0"> http://git-wip-us.apache.org/repos/asf/ignite/blob/5d6ff970/modules/platforms/dotnet/Apache.Ignite.Core/PersistentStore/PersistentStoreConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/PersistentStore/PersistentStoreConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/PersistentStore/PersistentStoreConfiguration.cs index f71f50e..7a2248a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/PersistentStore/PersistentStoreConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/PersistentStore/PersistentStoreConfiguration.cs @@ -107,6 +107,11 @@ namespace Apache.Ignite.Core.PersistentStore public const CheckpointWriteOrder DefaultCheckpointWriteOrder = CheckpointWriteOrder.Sequential; /// <summary> + /// Default value for <see cref="WriteThrottlingEnabled"/>. + /// </summary> + public const bool DefaultWriteThrottlingEnabled = false; + + /// <summary> /// Initializes a new instance of the <see cref="PersistentStoreConfiguration"/> class. /// </summary> public PersistentStoreConfiguration() @@ -126,6 +131,7 @@ namespace Apache.Ignite.Core.PersistentStore WalArchivePath = DefaultWalArchivePath; WalStorePath = DefaultWalStorePath; CheckpointWriteOrder = DefaultCheckpointWriteOrder; + WriteThrottlingEnabled = DefaultWriteThrottlingEnabled; } /// <summary> @@ -156,6 +162,7 @@ namespace Apache.Ignite.Core.PersistentStore SubIntervals = reader.ReadInt(); RateTimeInterval = reader.ReadLongAsTimespan(); CheckpointWriteOrder = (CheckpointWriteOrder) reader.ReadInt(); + WriteThrottlingEnabled = reader.ReadBoolean(); } /// <summary> @@ -186,6 +193,7 @@ namespace Apache.Ignite.Core.PersistentStore writer.WriteInt(SubIntervals); writer.WriteTimeSpanAsLong(RateTimeInterval); writer.WriteInt((int) CheckpointWriteOrder); + writer.WriteBoolean(WriteThrottlingEnabled); } /// <summary> @@ -312,5 +320,12 @@ namespace Apache.Ignite.Core.PersistentStore /// </summary> [DefaultValue(DefaultCheckpointWriteOrder)] public CheckpointWriteOrder CheckpointWriteOrder { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether threads that generate dirty + /// pages too fast during ongoing checkpoint will be throttled. + /// </summary> + [DefaultValue(DefaultWriteThrottlingEnabled)] + public bool WriteThrottlingEnabled { get; set; } } }
