ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [06/17] ignite git commit: IGNITE-1572: .Net: Removed unnecessary wrappers.
Date Wed, 28 Oct 2015 08:42:41 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/9d67c20c/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/SerializableObjectHolder.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/SerializableObjectHolder.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/SerializableObjectHolder.cs
index 0c9ecc5..a33ea24 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/SerializableObjectHolder.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/SerializableObjectHolder.cs
@@ -17,6 +17,9 @@
 
 namespace Apache.Ignite.Core.Impl.Portable
 {
+    using System.Diagnostics;
+    using System.Runtime.Serialization.Formatters.Binary;
+    using Apache.Ignite.Core.Impl.Portable.IO;
     using Apache.Ignite.Core.Portable;
 
     /// <summary>
@@ -47,9 +50,11 @@ namespace Apache.Ignite.Core.Impl.Portable
         /** <inheritDoc /> */
         public void WritePortable(IPortableWriter writer)
         {
+            Debug.Assert(writer != null);
+
             var writer0 = (PortableWriterImpl)writer.GetRawWriter();
 
-            writer0.WithDetach(w => PortableUtils.WriteSerializable(w, Item));
+            writer0.WithDetach(w => new BinaryFormatter().Serialize(new PortableStreamAdapter(w.Stream),
Item));
         }
 
         /// <summary>
@@ -58,7 +63,11 @@ namespace Apache.Ignite.Core.Impl.Portable
         /// <param name="reader">The reader.</param>
         public SerializableObjectHolder(IPortableReader reader)
         {
-            _item = PortableUtils.ReadSerializable<object>((PortableReaderImpl)reader.GetRawReader());
+            Debug.Assert(reader != null);
+
+            var reader0 = (PortableReaderImpl) reader.GetRawReader();
+
+            _item = new BinaryFormatter().Deserialize(new PortableStreamAdapter(reader0.Stream),
null);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d67c20c/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Services/Services.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Services/Services.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Services/Services.cs
index 38a7175..ac65807f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Services/Services.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Services/Services.cs
@@ -192,9 +192,9 @@ namespace Apache.Ignite.Core.Impl.Services
                 w.WriteObject(configuration.AffinityKey);
 
                 if (configuration.NodeFilter != null)
-                    w.WriteObject(new PortableOrSerializableObjectHolder(configuration.NodeFilter));
+                    w.WriteObject(configuration.NodeFilter);
                 else
-                    w.WriteObject<PortableOrSerializableObjectHolder>(null);
+                    w.WriteObject<object>(null);
             });
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d67c20c/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
index 3295904..9d986ec 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs
@@ -978,7 +978,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
                 {
                     var reader = _ignite.Marshaller.StartUnmarshal(stream);
 
-                    var filter = (IClusterNodeFilter) reader.ReadObject<PortableOrSerializableObjectHolder>().Item;
+                    var filter = reader.ReadObject<IClusterNodeFilter>();
 
                     return filter.Invoke(_ignite.GetNode(reader.ReadGuid())) ? 1 : 0;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d67c20c/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableBuilder.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableBuilder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableBuilder.cs
index 4f65840..44a7137 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableBuilder.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableBuilder.cs
@@ -17,8 +17,6 @@
 
 namespace Apache.Ignite.Core.Portable
 {
-    using System.Diagnostics.CodeAnalysis;
-
     /// <summary>
     /// Portable object builder. Provides ability to build portable objects dynamically
     /// without having class definitions.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d67c20c/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
index f8acb01..3dba104 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
@@ -72,7 +72,7 @@ namespace Apache.Ignite.ExamplesDll.Compute
             long sum = 0;
             int count = 0;
 
-            foreach (var t in results.Select(result => result.Data()))
+            foreach (var t in results.Select(result => result.Data))
             {
                 sum += t.Item1;
                 count += t.Item2;


Mime
View raw message