ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [05/11] ignite git commit: IGNITE-5522 .NET: IgniteConfiguration.ActiveOnStart
Date Wed, 21 Jun 2017 10:26:05 GMT
IGNITE-5522 .NET: IgniteConfiguration.ActiveOnStart


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

Branch: refs/heads/ignite-2.1.2-exchange
Commit: 9440fe6c5aa6cce6bf3e219504b6c822a040d15b
Parents: 1c1dbbd
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Tue Jun 20 13:19:33 2017 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Tue Jun 20 13:19:33 2017 +0300

----------------------------------------------------------------------
 .../utils/PlatformConfigurationUtils.java       |  4 ++++
 .../Cache/PersistentStoreTest.cs                | 18 ++++++++++++++++-
 .../IgniteConfigurationSerializerTest.cs        |  6 ++++--
 .../IgniteConfigurationTest.cs                  |  2 ++
 .../Apache.Ignite.Core/IgniteConfiguration.cs   | 21 ++++++++++++++++++++
 .../IgniteConfigurationSection.xsd              |  5 +++++
 6 files changed, 53 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/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 7d01b70..23106ba 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
@@ -568,6 +568,8 @@ public class PlatformConfigurationUtils {
             cfg.setClientFailureDetectionTimeout(in.readLong());
         if (in.readBoolean())
             cfg.setLongQueryWarningTimeout(in.readLong());
+        if (in.readBoolean())
+            cfg.setActiveOnStart(in.readBoolean());
 
         // Thread pools.
         if (in.readBoolean())
@@ -1014,6 +1016,8 @@ public class PlatformConfigurationUtils {
         w.writeLong(cfg.getClientFailureDetectionTimeout());
         w.writeBoolean(true);
         w.writeLong(cfg.getLongQueryWarningTimeout());
+        w.writeBoolean(true);
+        w.writeBoolean(cfg.isActiveOnStart());
 
         // Thread pools.
         w.writeBoolean(true);

http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
index e764b3a..cc72147 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs
@@ -56,7 +56,10 @@ namespace Apache.Ignite.Core.Tests.Cache
         [Test]
         public void TestGridActivationNoPersistence()
         {
-            using (var ignite = Ignition.Start(TestUtils.GetTestConfiguration()))
+            var cfg = TestUtils.GetTestConfiguration();
+            Assert.IsTrue(cfg.IsActiveOnStart);
+
+            using (var ignite = Ignition.Start(cfg))
             {
                 CheckIsActive(ignite, true);
 
@@ -66,6 +69,19 @@ namespace Apache.Ignite.Core.Tests.Cache
                 ignite.SetActive(true);
                 CheckIsActive(ignite, true);
             }
+
+            cfg.IsActiveOnStart = false;
+
+            using (var ignite = Ignition.Start(cfg))
+            {
+                CheckIsActive(ignite, false);
+
+                ignite.SetActive(true);
+                CheckIsActive(ignite, true);
+
+                ignite.SetActive(false);
+                CheckIsActive(ignite, false);
+            }
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/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 888d5d4..3d0bb56 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -68,7 +68,7 @@ namespace Apache.Ignite.Core.Tests
         [Test]
         public void TestPredefinedXml()
         {
-            var xml = @"<igniteConfig workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10'
isDaemon='true' isLateAffinityAssignment='false' springConfigUrl='c:\myconfig.xml' autoGenerateIgniteInstanceName='true'
peerAssemblyLoadingMode='CurrentAppDomain' longQueryWarningTimeout='1:2:3'>
+            var xml = @"<igniteConfig workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10'
isDaemon='true' isLateAffinityAssignment='false' springConfigUrl='c:\myconfig.xml' autoGenerateIgniteInstanceName='true'
peerAssemblyLoadingMode='CurrentAppDomain' longQueryWarningTimeout='1:2:3' isActiveOnStart='false'>
                             <localhost>127.1.1.1</localhost>
                             <binaryConfiguration compactFooter='false' keepDeserialized='true'>
                                 <nameMapper type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+NameMapper'
bar='testBar' />
@@ -170,6 +170,7 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual(@"c:\myconfig.xml", cfg.SpringConfigUrl);
             Assert.IsTrue(cfg.AutoGenerateIgniteInstanceName);
             Assert.AreEqual(new TimeSpan(1, 2, 3), cfg.LongQueryWarningTimeout);
+            Assert.IsFalse(cfg.IsActiveOnStart);
 
             Assert.AreEqual("secondCache", cfg.CacheConfiguration.Last().Name);
 
@@ -907,7 +908,8 @@ namespace Apache.Ignite.Core.Tests
                     WalSegments = 6,
                     WalSegmentSize = 5 * 1024 * 1024,
                     WalStorePath = Path.GetTempPath()
-                }
+                },
+                IsActiveOnStart = false
             };
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/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 67254fb..578d923 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -505,6 +505,7 @@ namespace Apache.Ignite.Core.Tests
                 cfg.ClientFailureDetectionTimeout);
             Assert.AreEqual(IgniteConfiguration.DefaultLongQueryWarningTimeout, cfg.LongQueryWarningTimeout);
             Assert.AreEqual(IgniteConfiguration.DefaultIsLateAffinityAssignment, cfg.IsLateAffinityAssignment);
+            Assert.AreEqual(IgniteConfiguration.DefaultIsActiveOnStart, cfg.IsActiveOnStart);
 
             // Thread pools.
             Assert.AreEqual(IgniteConfiguration.DefaultManagementThreadPoolSize, cfg.ManagementThreadPoolSize);
@@ -648,6 +649,7 @@ namespace Apache.Ignite.Core.Tests
                 FailureDetectionTimeout = TimeSpan.FromSeconds(3.5),
                 ClientFailureDetectionTimeout = TimeSpan.FromMinutes(12.3),
                 LongQueryWarningTimeout = TimeSpan.FromMinutes(1.23),
+                IsActiveOnStart = true,
                 BinaryConfiguration = new BinaryConfiguration
                 {
                     CompactFooter = false,

http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/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 1a1083d..8173642 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -186,6 +186,9 @@ namespace Apache.Ignite.Core
         /** */
         private TimeSpan? _longQueryWarningTimeout;
 
+        /** */
+        private bool? _isActiveOnStart;
+
         /// <summary>
         /// Default network retry count.
         /// </summary>
@@ -197,6 +200,11 @@ namespace Apache.Ignite.Core
         public const bool DefaultIsLateAffinityAssignment = true;
 
         /// <summary>
+        /// Default value for <see cref="IsActiveOnStart"/> property.
+        /// </summary>
+        public const bool DefaultIsActiveOnStart = true;
+
+        /// <summary>
         /// Initializes a new instance of the <see cref="IgniteConfiguration"/> class.
         /// </summary>
         public IgniteConfiguration()
@@ -269,6 +277,7 @@ namespace Apache.Ignite.Core
             writer.WriteTimeSpanAsLongNullable(_failureDetectionTimeout);
             writer.WriteTimeSpanAsLongNullable(_clientFailureDetectionTimeout);
             writer.WriteTimeSpanAsLongNullable(_longQueryWarningTimeout);
+            writer.WriteBooleanNullable(_isActiveOnStart);
 
             // Thread pools
             writer.WriteIntNullable(_publicThreadPoolSize);
@@ -519,6 +528,7 @@ namespace Apache.Ignite.Core
             _failureDetectionTimeout = r.ReadTimeSpanNullable();
             _clientFailureDetectionTimeout = r.ReadTimeSpanNullable();
             _longQueryWarningTimeout = r.ReadTimeSpanNullable();
+            _isActiveOnStart = r.ReadBooleanNullable();
 
             // Thread pools
             _publicThreadPoolSize = r.ReadIntNullable();
@@ -1202,5 +1212,16 @@ namespace Apache.Ignite.Core
         /// Gets or sets the persistent store configuration.
         /// </summary>
         public PersistentStoreConfiguration PersistentStoreConfiguration { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether grid should be active on start.
+        /// See also <see cref="IIgnite.IsActive"/> and <see cref="IIgnite.SetActive"/>.
+        /// </summary>
+        [DefaultValue(DefaultIsActiveOnStart)]
+        public bool IsActiveOnStart
+        {
+            get { return _isActiveOnStart ?? DefaultIsActiveOnStart; }
+            set { _isActiveOnStart = value; }
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9440fe6c/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 cbc253a..919f303 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -1633,6 +1633,11 @@
                     <xs:documentation>Size of the query thread pool.</xs:documentation>
                 </xs:annotation>
             </xs:attribute>
+            <xs:attribute name="isActiveOnStart" type="xs:boolean">
+                <xs:annotation>
+                    <xs:documentation>Whether grid should be active on start.</xs:documentation>
+                </xs:annotation>
+            </xs:attribute>
         </xs:complexType>
     </xs:element>
 </xs:schema>


Mime
View raw message