IGNITE-4587 CacheAtomicWriteOrderMode.CLOCK mode is removed - fix .NET

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

Branch: refs/heads/ignite-1561-1
Commit: 7def66c46cd64fc7a402d74fddc893c60b88b681
Parents: 247282f
Author: Pavel Tupitsyn <[email protected]>
Authored: Fri Apr 14 20:02:24 2017 +0300
Committer: Pavel Tupitsyn <[email protected]>
Committed: Fri Apr 14 20:02:24 2017 +0300

----------------------------------------------------------------------
 .../Cache/CacheConfigurationTest.cs             | 16 ++++++++++----
 .../IgniteConfigurationSerializerTest.cs        | 22 +++++++++++++++-----
 .../Cache/Configuration/CacheConfiguration.cs   |  6 ------
 3 files changed, 29 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7def66c4/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 1fd7d05..7a120bc 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
@@ -28,7 +28,7 @@ namespace Apache.Ignite.Core.Tests.Cache
     using Apache.Ignite.Core.Cache.Expiry;
     using Apache.Ignite.Core.Cache.Store;
     using Apache.Ignite.Core.Common;
-    using Apache.Ignite.Core.Tests.Plugin.Cache;
+    using Apache.Ignite.Core.Plugin.Cache;
     using NUnit.Framework;
 
     /// <summary>
@@ -479,7 +479,6 @@ namespace Apache.Ignite.Core.Tests.Cache
                 CopyOnRead = true,
                 WriteBehindFlushFrequency = TimeSpan.FromSeconds(6),
                 WriteBehindFlushSize = 7,
-                AtomicWriteOrderMode = CacheAtomicWriteOrderMode.Primary,
                 AtomicityMode = CacheAtomicityMode.Atomic,
                 Backups = 8,
                 CacheMode = CacheMode.Partitioned,
@@ -547,7 +546,7 @@ namespace Apache.Ignite.Core.Tests.Cache
                 },
                 ExpiryPolicyFactory = new ExpiryFactory(),
                 EnableStatistics = true,
-                PluginConfigurations = new[] { new 
CacheJavaPluginConfiguration() }
+                PluginConfigurations = new[] { new MyPluginConfiguration() }
             };
         }
         /// <summary>
@@ -566,7 +565,6 @@ namespace Apache.Ignite.Core.Tests.Cache
                 CopyOnRead = true,
                 WriteBehindFlushFrequency = TimeSpan.FromSeconds(6),
                 WriteBehindFlushSize = 7,
-                AtomicWriteOrderMode = CacheAtomicWriteOrderMode.Clock,
                 AtomicityMode = CacheAtomicityMode.Transactional,
                 Backups = 8,
                 CacheMode = CacheMode.Partitioned,
@@ -711,5 +709,15 @@ namespace Apache.Ignite.Core.Tests.Cache
                 return new ExpiryPolicy(null, null, null);
             }
         }
+
+        private class MyPluginConfiguration : ICachePluginConfiguration
+        {
+            public int? CachePluginConfigurationClosureFactoryId { get { 
return null; } }
+
+            public void WriteBinary(IBinaryRawWriter writer)
+            {
+                throw new NotImplementedException();
+            }
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7def66c4/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 8e10539..cba5647 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -47,9 +47,9 @@ namespace Apache.Ignite.Core.Tests
     using Apache.Ignite.Core.Impl.Common;
     using Apache.Ignite.Core.Lifecycle;
     using Apache.Ignite.Core.Log;
+    using Apache.Ignite.Core.Plugin.Cache;
     using Apache.Ignite.Core.Tests.Binary;
     using Apache.Ignite.Core.Tests.Plugin;
-    using Apache.Ignite.Core.Tests.Plugin.Cache;
     using Apache.Ignite.Core.Transactions;
     using Apache.Ignite.NLog;
     using NUnit.Framework;
@@ -114,7 +114,7 @@ namespace Apache.Ignite.Core.Tests
                                     </nearConfiguration>
                                     <affinityFunction 
type='RendezvousAffinityFunction' partitions='99' excludeNeighbors='true' />
                                     <expiryPolicyFactory 
type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+MyPolicyFactory,
 Apache.Ignite.Core.Tests' />
-                                    
<pluginConfigurations><iCachePluginConfiguration 
type='Apache.Ignite.Core.Tests.Plugin.Cache.CacheJavaPluginConfiguration, 
Apache.Ignite.Core.Tests' foo='baz' /></pluginConfigurations>
+                                    
<pluginConfigurations><iCachePluginConfiguration 
type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+MyPluginConfiguration,
 Apache.Ignite.Core.Tests' /></pluginConfigurations>
                                 </cacheConfiguration>
                                 <cacheConfiguration name='secondCache' />
                             </cacheConfiguration>
@@ -241,8 +241,7 @@ namespace Apache.Ignite.Core.Tests
             Assert.IsNotNull(plugins);
             
Assert.IsNotNull(plugins.Cast<TestIgnitePluginConfiguration>().SingleOrDefault());
 
-            var cachePlugCfg = 
cacheCfg.PluginConfigurations.Cast<CacheJavaPluginConfiguration>().Single();
-            Assert.AreEqual("baz", cachePlugCfg.Foo);
+            
Assert.IsNotNull(cacheCfg.PluginConfigurations.Cast<MyPluginConfiguration>().SingleOrDefault());
 
             var eventStorage = cfg.EventStorageSpi as MemoryEventStorageSpi;
             Assert.IsNotNull(eventStorage);
@@ -677,7 +676,7 @@ namespace Apache.Ignite.Core.Tests
                         EnableStatistics = true,
                         PluginConfigurations = new[]
                         {
-                            new CacheJavaPluginConfiguration()
+                            new MyPluginConfiguration()
                         }
                     }
                 },
@@ -966,5 +965,18 @@ namespace Apache.Ignite.Core.Tests
                 throw new NotImplementedException();
             }
         }
+
+        public class MyPluginConfiguration : ICachePluginConfiguration
+        {
+            int? 
ICachePluginConfiguration.CachePluginConfigurationClosureFactoryId
+            {
+                get { return 0; }
+            }
+
+            void ICachePluginConfiguration.WriteBinary(IBinaryRawWriter writer)
+            {
+                throw new NotImplementedException();
+            }
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7def66c4/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 a16edfb..91a5b1e 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs
@@ -335,12 +335,6 @@ namespace Apache.Ignite.Core.Cache.Configuration
                     }
                     else
                     {
-                        if (!cachePlugin.GetType().IsSerializable)
-                        {
-                            throw new InvalidOperationException("Invalid cache 
configuration: " +
-                                                                
"ICachePluginConfiguration should be Serializable.");
-                        }
-
                         writer.WriteBoolean(false);
                         writer.WriteObject(cachePlugin);
                     }

Reply via email to