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/26 11:14:19 UTC
[1/2] ignite git commit: .NET: Add default memory policy tests
Repository: ignite
Updated Branches:
refs/heads/ignite-5024 eac6762b2 -> 259208850
.NET: Add default memory policy tests
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/095eda9f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/095eda9f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/095eda9f
Branch: refs/heads/ignite-5024
Commit: 095eda9f5d9b6f1096b9b45f0555af7e6f9c24cd
Parents: eac6762
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Apr 26 14:12:13 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Apr 26 14:12:13 2017 +0300
----------------------------------------------------------------------
.../platform/utils/PlatformConfigurationUtils.java | 6 ++----
.../Apache.Ignite.Core.Tests/Config/spring-test.xml | 15 +++++++++++++++
.../IgniteConfigurationTest.cs | 15 +++++++++++++++
3 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/095eda9f/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 b0d75ad..11ea7b5 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
@@ -644,7 +644,8 @@ public class PlatformConfigurationUtils {
break;
}
- cfg.setMemoryConfiguration(readMemoryConfiguration(in));
+ if (in.readBoolean())
+ cfg.setMemoryConfiguration(readMemoryConfiguration(in));
readPluginConfiguration(cfg, in);
}
@@ -1324,9 +1325,6 @@ public class PlatformConfigurationUtils {
* @return Config.
*/
private static MemoryConfiguration readMemoryConfiguration(BinaryRawReader in) {
- if (!in.readBoolean())
- return null;
-
MemoryConfiguration res = new MemoryConfiguration();
res.setSystemCacheMemorySize(in.readLong())
http://git-wip-us.apache.org/repos/asf/ignite/blob/095eda9f/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
index 2bf7478..484b758 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
@@ -42,5 +42,20 @@
<property name="socketTimeout" value="300" />
</bean>
</property>
+
+ <property name="memoryConfiguration">
+ <bean class="org.apache.ignite.configuration.MemoryConfiguration">
+ <property name="systemCacheMemorySize" value="#{40 * 1024 * 1024}"/>
+ <property name="defaultMemoryPolicyName" value="dfltPlc"/>
+
+ <property name="memoryPolicies">
+ <list>
+ <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
+ <property name="name" value="dfltPlc"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
</bean>
</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/095eda9f/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 c574849..8dec4ed 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -246,6 +246,21 @@ namespace Apache.Ignite.Core.Tests
var disco = resCfg.DiscoverySpi as TcpDiscoverySpi;
Assert.IsNotNull(disco);
Assert.AreEqual(TimeSpan.FromMilliseconds(300), disco.SocketTimeout);
+
+ // Check memory configuration defaults.
+ var mem = resCfg.MemoryConfiguration;
+
+ Assert.IsNotNull(mem);
+ Assert.AreEqual("dfltPlc", mem.DefaultMemoryPolicyName);
+ Assert.AreEqual(MemoryConfiguration.DefaultPageSize, mem.PageSize);
+ Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheMemorySize, mem.SystemCacheMemorySize);
+
+ var plc = mem.MemoryPolicies.Single();
+ Assert.AreEqual("dfltPlc", plc.Name);
+ Assert.AreEqual(MemoryPolicyConfiguration.DefaultEmptyPagesPoolSize, plc.EmptyPagesPoolSize);
+ Assert.AreEqual(MemoryPolicyConfiguration.DefaultEvictionThreshold, plc.EvictionThreshold);
+ Assert.AreEqual(MemoryPolicyConfiguration.DefaultInitialSize, plc.InitialSize);
+ Assert.AreEqual(MemoryPolicyConfiguration.DefaultMaxSize, plc.MaxSize);
}
}
[2/2] ignite git commit: .NET: Fix test
Posted by pt...@apache.org.
.NET: Fix test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/25920885
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/25920885
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/25920885
Branch: refs/heads/ignite-5024
Commit: 259208850540ee7443115ba3202de7bbdcf5fa5a
Parents: 095eda9
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Apr 26 14:13:29 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Apr 26 14:13:29 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/25920885/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
index 484b758..dd0669a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
@@ -45,7 +45,6 @@
<property name="memoryConfiguration">
<bean class="org.apache.ignite.configuration.MemoryConfiguration">
- <property name="systemCacheMemorySize" value="#{40 * 1024 * 1024}"/>
<property name="defaultMemoryPolicyName" value="dfltPlc"/>
<property name="memoryPolicies">