ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptupit...@apache.org
Subject ignite git commit: IGNITE-6715 .NET: DataStorageConfiguration.WalAutoArchiveAfterInactivity
Date Fri, 22 Dec 2017 10:12:44 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 51e175b8a -> 0e8224f9c


IGNITE-6715 .NET: DataStorageConfiguration.WalAutoArchiveAfterInactivity


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

Branch: refs/heads/master
Commit: 0e8224f9c5ef06c1b1700379be3beb8996443558
Parents: 51e175b
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Fri Dec 22 13:12:36 2017 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Fri Dec 22 13:12:36 2017 +0300

----------------------------------------------------------------------
 .../platform/utils/PlatformConfigurationUtils.java    |  4 +++-
 .../ApiParity/DataStorageConfigurationParityTest.cs   |  9 +--------
 .../Apache.Ignite.Core.Tests/Config/full-config.xml   |  2 +-
 .../IgniteConfigurationSerializerTest.cs              |  2 ++
 .../IgniteConfigurationTest.cs                        |  3 +++
 .../Configuration/DataStorageConfiguration.cs         | 14 ++++++++++++++
 .../Apache.Ignite.Core/IgniteConfigurationSection.xsd |  5 +++++
 7 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/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 0a278d1..49d8c18 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
@@ -1684,7 +1684,8 @@ public class PlatformConfigurationUtils {
                 .setSystemRegionInitialSize(in.readLong())
                 .setSystemRegionMaxSize(in.readLong())
                 .setPageSize(in.readInt())
-                .setConcurrencyLevel(in.readInt());
+                .setConcurrencyLevel(in.readInt())
+                .setWalAutoArchiveAfterInactivity(in.readLong());
 
         int cnt = in.readInt();
 
@@ -1780,6 +1781,7 @@ public class PlatformConfigurationUtils {
             w.writeLong(cfg.getSystemRegionMaxSize());
             w.writeInt(cfg.getPageSize());
             w.writeInt(cfg.getConcurrencyLevel());
+            w.writeLong(cfg.getWalAutoArchiveAfterInactivity());
 
             if (cfg.getDataRegionConfigurations() != null) {
                 w.writeInt(cfg.getDataRegionConfigurations().length);

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageConfigurationParityTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageConfigurationParityTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageConfigurationParityTest.cs
index db53e2e..10cba72 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageConfigurationParityTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/DataStorageConfigurationParityTest.cs
@@ -31,12 +31,6 @@ namespace Apache.Ignite.Core.Tests.ApiParity
             "FileIOFactory"
         };
 
-        /** Properties that are missing on .NET side. */
-        private static readonly string[] MissingProperties =
-        {
-            "WalAutoArchiveAfterInactivity"
-        };
-
         /// <summary>
         /// Tests the ignite configuration parity.
         /// </summary>
@@ -46,8 +40,7 @@ namespace Apache.Ignite.Core.Tests.ApiParity
             ParityTest.CheckConfigurationParity(
                 @"modules\core\src\main\java\org\apache\ignite\configuration\DataStorageConfiguration.java",

                 typeof(DataStorageConfiguration),
-                UnneededProperties,
-                MissingProperties);
+                UnneededProperties);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
index 24f519e..1fc42ad 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/full-config.xml
@@ -143,7 +143,7 @@
                               walThreadLocalBufferSize="11"
                               walArchivePath="abc" walFlushFrequency="00:00:12" walFsyncDelayNanos="13"
walHistorySize="14"
                               walMode="Background" walRecordIteratorBufferSize="15" walSegments="16"
walSegmentSize="17"
-                              walPath="wal-store" writeThrottlingEnabled="true">
+                              walPath="wal-store" writeThrottlingEnabled="true" walAutoArchiveAfterInactivity="00:00:18">
         <dataRegionConfigurations>
             <dataRegionConfiguration emptyPagesPoolSize="1" evictionThreshold="2" initialSize="3"
metricsEnabled="true"
                                      maxSize="4" name="reg2" pageEvictionMode="RandomLru"
metricsRateTimeInterval="00:00:01"

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/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 7be7acd..167854d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -307,6 +307,7 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual(16, ds.WalSegments);
             Assert.AreEqual(17, ds.WalSegmentSize);
             Assert.AreEqual("wal-store", ds.WalPath);
+            Assert.AreEqual(TimeSpan.FromSeconds(18), ds.WalAutoArchiveAfterInactivity);
             Assert.IsTrue(ds.WriteThrottlingEnabled);
 
             var dr = ds.DataRegionConfigurations.Single();
@@ -956,6 +957,7 @@ namespace Apache.Ignite.Core.Tests
                     SystemRegionMaxSize = 128 * 1024 * 1024,
                     ConcurrencyLevel = 1,
                     PageSize = 5 * 1024,
+                    WalAutoArchiveAfterInactivity = TimeSpan.FromSeconds(19),
                     DefaultDataRegionConfiguration = new DataRegionConfiguration
                     {
                         Name = "reg1",

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/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 49d9c44..4d71929 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -560,6 +560,8 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual(DataStorageConfiguration.DefaultSystemRegionMaxSize, cfg.SystemRegionMaxSize);
             Assert.AreEqual(DataStorageConfiguration.DefaultPageSize, cfg.PageSize);
             Assert.AreEqual(DataStorageConfiguration.DefaultConcurrencyLevel, cfg.ConcurrencyLevel);
+            Assert.AreEqual(DataStorageConfiguration.DefaultWalAutoArchiveAfterInactivity,

+                cfg.WalAutoArchiveAfterInactivity);
         }
 
         /// <summary>
@@ -785,6 +787,7 @@ namespace Apache.Ignite.Core.Tests
                     SystemRegionMaxSize = 128 * 1024 * 1024,
                     ConcurrencyLevel = 1,
                     PageSize = 8 * 1024,
+                    WalAutoArchiveAfterInactivity = TimeSpan.FromMinutes(5),
                     DefaultDataRegionConfiguration = new DataRegionConfiguration
                     {
                         Name = "reg1",

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/modules/platforms/dotnet/Apache.Ignite.Core/Configuration/DataStorageConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Configuration/DataStorageConfiguration.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Configuration/DataStorageConfiguration.cs
index ae3c0ed..e1be111 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Configuration/DataStorageConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Configuration/DataStorageConfiguration.cs
@@ -104,6 +104,11 @@ namespace Apache.Ignite.Core.Configuration
         public const int DefaultMetricsSubIntervalCount = 5;
 
         /// <summary>
+        /// Default value for <see cref="WalFlushFrequency"/>.
+        /// </summary>
+        public static readonly TimeSpan DefaultWalAutoArchiveAfterInactivity = TimeSpan.FromMilliseconds(-1);
+
+        /// <summary>
         /// The default rate time interval.
         /// </summary>
         public static readonly TimeSpan DefaultMetricsRateTimeInterval = TimeSpan.FromSeconds(60);
@@ -183,6 +188,7 @@ namespace Apache.Ignite.Core.Configuration
             SystemRegionInitialSize = DefaultSystemRegionInitialSize;
             SystemRegionMaxSize = DefaultSystemRegionMaxSize;
             PageSize = DefaultPageSize;
+            WalAutoArchiveAfterInactivity = DefaultWalAutoArchiveAfterInactivity;
         }
 
         /// <summary>
@@ -219,6 +225,7 @@ namespace Apache.Ignite.Core.Configuration
             SystemRegionMaxSize = reader.ReadLong();
             PageSize = reader.ReadInt();
             ConcurrencyLevel = reader.ReadInt();
+            WalAutoArchiveAfterInactivity = reader.ReadLongAsTimespan();
 
             var count = reader.ReadInt();
 
@@ -269,6 +276,7 @@ namespace Apache.Ignite.Core.Configuration
             writer.WriteLong(SystemRegionMaxSize);
             writer.WriteInt(PageSize);
             writer.WriteInt(ConcurrencyLevel);
+            writer.WriteTimeSpanAsLong(WalAutoArchiveAfterInactivity);
 
             if (DataRegionConfigurations != null)
             {
@@ -460,6 +468,12 @@ namespace Apache.Ignite.Core.Configuration
         public int ConcurrencyLevel { get; set; }
 
         /// <summary>
+        /// Gets or sets the inactivity time after which to run WAL segment auto archiving.
+        /// </summary>
+        [DefaultValue(typeof(TimeSpan), "-00:00:00.001")]
+        public TimeSpan WalAutoArchiveAfterInactivity { get; set; }
+
+        /// <summary>
         /// Gets or sets the data region configurations.
         /// </summary>
         [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e8224f9/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 c6eb3c1..5d76cde 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -1831,6 +1831,11 @@
                                 <xs:documentation>Number of concurrent segments in
Ignite internal page mapping tables.</xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
+                        <xs:attribute name="walAutoArchiveAfterInactivity" type="xs:string">
+                            <xs:annotation>
+                                <xs:documentation>Inactivity time after which to run
WAL segment auto archiving.</xs:documentation>
+                            </xs:annotation>
+                        </xs:attribute>
                     </xs:complexType>
                 </xs:element>
                 <xs:element name="pluginConfigurations" minOccurs="0">


Mime
View raw message