You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2017/04/27 13:30:18 UTC

ignite git commit: .NET: Add SystemCacheInitialSize & SystemCacheMaxSize

Repository: ignite
Updated Branches:
  refs/heads/ignite-5072-merge ff975bca5 -> ff5f2f006


.NET: Add SystemCacheInitialSize & SystemCacheMaxSize


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

Branch: refs/heads/ignite-5072-merge
Commit: ff5f2f006bf142a46e71ec51f37c29998466c488
Parents: ff975bc
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Thu Apr 27 16:30:07 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Thu Apr 27 16:30:07 2017 +0300

----------------------------------------------------------------------
 .../configuration/MemoryConfiguration.java      |  2 +-
 .../utils/PlatformConfigurationUtils.java       |  2 ++
 .../IgniteConfigurationSerializerTest.cs        |  8 +++---
 .../IgniteConfigurationTest.cs                  |  9 ++++---
 .../Cache/Configuration/MemoryConfiguration.cs  | 28 +++++++++++++++-----
 .../IgniteConfigurationSection.xsd              |  9 +++++--
 6 files changed, 42 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
index 46d060e..cadc033 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
@@ -76,7 +76,7 @@ public class MemoryConfiguration implements Serializable {
     /** Default initial size of a memory chunk for the system cache (40 MB). */
     private static final long DFLT_SYS_CACHE_INIT_SIZE = 40 * 1024 * 1024;
 
-    /** Default max size of a memory chunk for the system cache (40 MB). */
+    /** Default max size of a memory chunk for the system cache (100 MB). */
     private static final long DFLT_SYS_CACHE_MAX_SIZE = 100 * 1024 * 1024;
 
     /** Default memory page size. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/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 c8540d1..7727ab3 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
@@ -1333,6 +1333,7 @@ public class PlatformConfigurationUtils {
         MemoryConfiguration res = new MemoryConfiguration();
 
         res.setSystemCacheInitialSize(in.readLong())
+                .setSysCacheMaxSize(in.readLong())
                 .setPageSize(in.readInt())
                 .setConcurrencyLevel(in.readInt())
                 .setDefaultMemoryPolicyName(in.readString());
@@ -1377,6 +1378,7 @@ public class PlatformConfigurationUtils {
         w.writeBoolean(true);
 
         w.writeLong(cfg.getSystemCacheInitialSize());
+        w.writeLong(cfg.getSystemCacheMaxSize());
         w.writeInt(cfg.getPageSize());
         w.writeInt(cfg.getConcurrencyLevel());
         w.writeString(cfg.getDefaultMemoryPolicyName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/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 d983089..d180856 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -134,7 +134,7 @@ namespace Apache.Ignite.Core.Tests
                                 <iPluginConfiguration type='Apache.Ignite.Core.Tests.Plugin.TestIgnitePluginConfiguration, Apache.Ignite.Core.Tests' />
                             </pluginConfigurations>
                             <eventStorageSpi type='MemoryEventStorageSpi' expirationTimeout='00:00:23.45' maxEventCount='129' />
-                            <memoryConfiguration concurrencyLevel='3' defaultMemoryPolicyName='dfPlc' pageSize='45' systemCacheMemorySize='67'>
+                            <memoryConfiguration concurrencyLevel='3' defaultMemoryPolicyName='dfPlc' pageSize='45' systemCacheInitialSize='67' systemCacheMaxSize='68'>
                                 <memoryPolicies>
                                     <memoryPolicyConfiguration emptyPagesPoolSize='1' evictionThreshold='0.2' name='dfPlc' pageEvictionMode='RandomLru' initialSize='89' maxSize='98' swapFilePath='abc' />
                                 </memoryPolicies>
@@ -261,7 +261,8 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual(3, memCfg.ConcurrencyLevel);
             Assert.AreEqual("dfPlc", memCfg.DefaultMemoryPolicyName);
             Assert.AreEqual(45, memCfg.PageSize);
-            Assert.AreEqual(67, memCfg.SystemCacheMemorySize);
+            Assert.AreEqual(67, memCfg.SystemCacheInitialSize);
+            Assert.AreEqual(68, memCfg.SystemCacheMaxSize);
 
             var memPlc = memCfg.MemoryPolicies.Single();
             Assert.AreEqual(1, memPlc.EmptyPagesPoolSize);
@@ -806,7 +807,8 @@ namespace Apache.Ignite.Core.Tests
                     ConcurrencyLevel = 3,
                     DefaultMemoryPolicyName = "somePolicy",
                     PageSize = 4,
-                    SystemCacheMemorySize = 5,
+                    SystemCacheInitialSize = 5,
+                    SystemCacheMaxSize = 6,
                     MemoryPolicies = new[]
                     {
                         new MemoryPolicyConfiguration

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/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 c1c3ea5..ebca7c4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -199,7 +199,8 @@ namespace Apache.Ignite.Core.Tests
                 Assert.AreEqual(memCfg.PageSize, resMemCfg.PageSize);
                 Assert.AreEqual(memCfg.ConcurrencyLevel, resMemCfg.ConcurrencyLevel);
                 Assert.AreEqual(memCfg.DefaultMemoryPolicyName, resMemCfg.DefaultMemoryPolicyName);
-                Assert.AreEqual(memCfg.SystemCacheMemorySize, resMemCfg.SystemCacheMemorySize);
+                Assert.AreEqual(memCfg.SystemCacheInitialSize, resMemCfg.SystemCacheInitialSize);
+                Assert.AreEqual(memCfg.SystemCacheMaxSize, resMemCfg.SystemCacheMaxSize);
                 Assert.IsNotNull(memCfg.MemoryPolicies);
                 Assert.IsNotNull(resMemCfg.MemoryPolicies);
                 Assert.AreEqual(2, memCfg.MemoryPolicies.Count);
@@ -252,7 +253,8 @@ namespace Apache.Ignite.Core.Tests
                 Assert.IsNotNull(mem);
                 Assert.AreEqual("dfltPlc", mem.DefaultMemoryPolicyName);
                 Assert.AreEqual(MemoryConfiguration.DefaultPageSize, mem.PageSize);
-                Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheMemorySize, mem.SystemCacheMemorySize);
+                Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheInitialSize, mem.SystemCacheInitialSize);
+                Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheMaxSize, mem.SystemCacheMaxSize);
 
                 var plc = mem.MemoryPolicies.Single();
                 Assert.AreEqual("dfltPlc", plc.Name);
@@ -584,7 +586,8 @@ namespace Apache.Ignite.Core.Tests
                     ConcurrencyLevel = 3,
                     DefaultMemoryPolicyName = "myDefaultPlc",
                     PageSize = 2048,
-                    SystemCacheMemorySize = 13 * 1024 * 1024,
+                    SystemCacheInitialSize = 13 * 1024 * 1024,
+                    SystemCacheMaxSize = 15 * 1024 * 1024,
                     MemoryPolicies = new[]
                     {
                         new MemoryPolicyConfiguration

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
index 9c4bb35..36d06a7 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
@@ -46,9 +46,14 @@ namespace Apache.Ignite.Core.Cache.Configuration
     public class MemoryConfiguration
     {
         /// <summary>
-        /// The default system cache memory size.
+        /// Default size of a memory chunk reserved for system cache initially.
         /// </summary>
-        public const long DefaultSystemCacheMemorySize = 100 * 1024 * 1024;
+        public const long DefaultSystemCacheInitialSize = 40 * 1024 * 1024;
+
+        /// <summary>
+        /// Default max size of a memory chunk for the system cache.
+        /// </summary>
+        public const long DefaultSystemCacheMaxSize = 100 * 1024 * 1024;
 
         /// <summary>
         /// The default page size.
@@ -65,7 +70,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// </summary>
         public MemoryConfiguration()
         {
-            SystemCacheMemorySize = DefaultSystemCacheMemorySize;
+            SystemCacheInitialSize = DefaultSystemCacheInitialSize;
+            SystemCacheMaxSize = DefaultSystemCacheMaxSize;
             PageSize = DefaultPageSize;
             DefaultMemoryPolicyName = DefaultDefaultMemoryPolicyName;
         }
@@ -78,7 +84,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         {
             Debug.Assert(reader != null);
 
-            SystemCacheMemorySize = reader.ReadLong();
+            SystemCacheInitialSize = reader.ReadLong();
+            SystemCacheMaxSize = reader.ReadLong();
             PageSize = reader.ReadInt();
             ConcurrencyLevel = reader.ReadInt();
             DefaultMemoryPolicyName = reader.ReadString();
@@ -101,7 +108,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         {
             Debug.Assert(writer != null);
 
-            writer.WriteLong(SystemCacheMemorySize);
+            writer.WriteLong(SystemCacheInitialSize);
+            writer.WriteLong(SystemCacheMaxSize);
             writer.WriteInt(PageSize);
             writer.WriteInt(ConcurrencyLevel);
             writer.WriteString(DefaultMemoryPolicyName);
@@ -129,8 +137,14 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// <summary>
         /// Gets or sets the size of a memory chunk reserved for system cache needs.
         /// </summary>
-        [DefaultValue(DefaultSystemCacheMemorySize)]
-        public long SystemCacheMemorySize { get; set; }
+        [DefaultValue(DefaultSystemCacheInitialSize)]
+        public long SystemCacheInitialSize { get; set; }
+
+        /// <summary>
+        /// Gets or sets the maximum memory region size reserved for system cache.
+        /// </summary>
+        [DefaultValue(DefaultSystemCacheMaxSize)]
+        public long SystemCacheMaxSize { get; set; }
 
         /// <summary>
         /// Gets or sets the size of the memory page.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5f2f00/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 63d9d22..8d69f8b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -1224,9 +1224,14 @@
                                 <xs:documentation>Size of the memory page.</xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
-                        <xs:attribute name="systemCacheMemorySize" type="xs:int">
+                        <xs:attribute name="systemCacheInitialSize" type="xs:int">
                             <xs:annotation>
-                                <xs:documentation>Size of a memory chunk reserved for system cache needs.</xs:documentation>
+                                <xs:documentation>Initial size of a memory chunk reserved for system cache needs.</xs:documentation>
+                            </xs:annotation>
+                        </xs:attribute>
+                        <xs:attribute name="systemCacheMaxSize" type="xs:int">
+                            <xs:annotation>
+                                <xs:documentation>Maximum size of a memory chunk reserved for system cache needs.</xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                     </xs:complexType>