You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/21 09:09:28 UTC
[5/8] ignite git commit: IGNITE-5043 .NET:
CacheConfiguration.WriteBehindCoalescing
IGNITE-5043 .NET: CacheConfiguration.WriteBehindCoalescing
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/217c6be2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/217c6be2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/217c6be2
Branch: refs/heads/ignite-1794
Commit: 217c6be2650fa77e8ba295a682f6549a1e3c2be0
Parents: 800fb87
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Thu Apr 20 19:39:45 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Thu Apr 20 19:39:45 2017 +0300
----------------------------------------------------------------------
.../platform/utils/PlatformConfigurationUtils.java | 2 ++
.../Cache/CacheConfigurationTest.cs | 3 +++
.../IgniteConfigurationSerializerTest.cs | 4 +++-
.../Cache/Configuration/CacheConfiguration.cs | 14 ++++++++++++++
.../Apache.Ignite.Core/IgniteConfigurationSection.xsd | 7 +++++++
5 files changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/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 b79ab4b..0fe537f 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
@@ -167,6 +167,7 @@ public class PlatformConfigurationUtils {
ccfg.setWriteBehindFlushFrequency(in.readLong());
ccfg.setWriteBehindFlushSize(in.readInt());
ccfg.setWriteBehindFlushThreadCount(in.readInt());
+ ccfg.setWriteBehindCoalescing(in.readBoolean());
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.fromOrdinal(in.readInt()));
ccfg.setReadThrough(in.readBoolean());
ccfg.setWriteThrough(in.readBoolean());
@@ -794,6 +795,7 @@ public class PlatformConfigurationUtils {
writer.writeLong(ccfg.getWriteBehindFlushFrequency());
writer.writeInt(ccfg.getWriteBehindFlushSize());
writer.writeInt(ccfg.getWriteBehindFlushThreadCount());
+ writer.writeBoolean(ccfg.getWriteBehindCoalescing());
writeEnumInt(writer, ccfg.getWriteSynchronizationMode());
writer.writeBoolean(ccfg.isReadThrough());
writer.writeBoolean(ccfg.isWriteThrough());
http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/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 6406d32..25ba43e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
@@ -213,6 +213,8 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.AreEqual(CacheConfiguration.DefaultWriteBehindEnabled, cfg.WriteBehindEnabled);
Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushFrequency, cfg.WriteBehindFlushFrequency);
Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushSize, cfg.WriteBehindFlushSize);
+ Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushThreadCount, cfg.WriteBehindFlushThreadCount);
+ Assert.AreEqual(CacheConfiguration.DefaultWriteBehindCoalescing, cfg.WriteBehindCoalescing);
}
/// <summary>
@@ -511,6 +513,7 @@ namespace Apache.Ignite.Core.Tests.Cache
CacheStoreFactory = new CacheStoreFactoryTest(),
ReadThrough = true,
WriteThrough = true,
+ WriteBehindCoalescing = false,
QueryEntities = new[]
{
new QueryEntity
http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/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 2d8cc20..6b94079 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -90,7 +90,7 @@ namespace Apache.Ignite.Core.Tests
<iLifecycleHandler type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+LifecycleBean' foo='15' />
</lifecycleHandlers>
<cacheConfiguration>
- <cacheConfiguration cacheMode='Replicated' readThrough='true' writeThrough='true' enableStatistics='true'>
+ <cacheConfiguration cacheMode='Replicated' readThrough='true' writeThrough='true' enableStatistics='true' writeBehindCoalescing='false'>
<queryEntities>
<queryEntity keyType='System.Int32' valueType='System.String' tableName='myTable'>
<fields>
@@ -174,6 +174,7 @@ namespace Apache.Ignite.Core.Tests
Assert.IsTrue(cacheCfg.WriteThrough);
Assert.IsInstanceOf<MyPolicyFactory>(cacheCfg.ExpiryPolicyFactory);
Assert.IsTrue(cacheCfg.EnableStatistics);
+ Assert.IsFalse(cacheCfg.WriteBehindCoalescing);
var queryEntity = cacheCfg.QueryEntities.Single();
Assert.AreEqual(typeof(int), queryEntity.KeyType);
@@ -675,6 +676,7 @@ namespace Apache.Ignite.Core.Tests
WriteBehindFlushFrequency = TimeSpan.FromSeconds(55),
WriteBehindFlushSize = 66,
WriteBehindFlushThreadCount = 2,
+ WriteBehindCoalescing = false,
WriteSynchronizationMode = CacheWriteSynchronizationMode.FullAsync,
NearConfiguration = new NearCacheConfiguration
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/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 3586989..87ee255 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
@@ -126,6 +126,9 @@ namespace Apache.Ignite.Core.Cache.Configuration
/// <summary> Default value for write-through behavior. </summary>
public const bool DefaultWriteThrough = false;
+ /// <summary> Default value for <see cref="WriteBehindCoalescing"/>. </summary>
+ public const bool DefaultWriteBehindCoalescing = true;
+
/// <summary>
/// Gets or sets the cache name.
/// </summary>
@@ -169,6 +172,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
WriteBehindFlushFrequency = DefaultWriteBehindFlushFrequency;
WriteBehindFlushSize = DefaultWriteBehindFlushSize;
WriteBehindFlushThreadCount= DefaultWriteBehindFlushThreadCount;
+ WriteBehindCoalescing = DefaultWriteBehindCoalescing;
}
/// <summary>
@@ -229,6 +233,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
WriteBehindFlushFrequency = reader.ReadLongAsTimespan();
WriteBehindFlushSize = reader.ReadInt();
WriteBehindFlushThreadCount = reader.ReadInt();
+ WriteBehindCoalescing = reader.ReadBoolean();
WriteSynchronizationMode = (CacheWriteSynchronizationMode) reader.ReadInt();
ReadThrough = reader.ReadBoolean();
WriteThrough = reader.ReadBoolean();
@@ -285,6 +290,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
writer.WriteLong((long) WriteBehindFlushFrequency.TotalMilliseconds);
writer.WriteInt(WriteBehindFlushSize);
writer.WriteInt(WriteBehindFlushThreadCount);
+ writer.WriteBoolean(WriteBehindCoalescing);
writer.WriteInt((int) WriteSynchronizationMode);
writer.WriteBoolean(ReadThrough);
writer.WriteBoolean(WriteThrough);
@@ -631,5 +637,13 @@ namespace Apache.Ignite.Core.Cache.Configuration
/// See <see cref="IgniteConfiguration.MemoryConfiguration"/>.
/// </summary>
public string MemoryPolicyName { get; set; }
+
+ /// <summary>
+ /// Gets or sets write coalescing flag for write-behind cache store operations.
+ /// Store operations (get or remove) with the same key are combined or coalesced to single,
+ /// resulting operation to reduce pressure to underlying cache store.
+ /// </summary>
+ [DefaultValue(DefaultWriteBehindCoalescing)]
+ public bool WriteBehindCoalescing { get; set; }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/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 ba2f756..8b07147 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -621,6 +621,13 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="writeBehindCoalescing" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Coalescing flag for write-behind cache store operations. Store operations (get or remove) with the same key are combined or coalesced to single, resulting operation to reduce pressure to underlying cache store.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
<xs:attribute name="writeBehindBatchSize" type="xs:int">
<xs:annotation>
<xs:documentation>