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/03/15 11:04:40 UTC

ignite git commit: IGNITE-4716 .NET: Add IgniteUuid system type support

Repository: ignite
Updated Branches:
  refs/heads/ignite-2.0 637c18de1 -> 8e5e3cbf3


IGNITE-4716 .NET: Add IgniteUuid system type support

This closes #1618


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

Branch: refs/heads/ignite-2.0
Commit: 8e5e3cbf35976fc57652906f26c86e25a561b41a
Parents: 637c18d
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Mar 15 14:04:31 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Mar 15 14:04:31 2017 +0300

----------------------------------------------------------------------
 .../platform/PlatformContextImpl.java           | 10 ++---
 .../platform/PlatformComputeEchoTask.java       |  6 +++
 .../Binary/BinaryReaderWriterTest.cs            |  8 ++++
 .../Compute/ComputeApiTest.cs                   | 19 ++++++++
 .../Apache.Ignite.Core/Common/IgniteGuid.cs     | 47 +++++++++++++-------
 .../Apache.Ignite.Core/Events/CacheEvent.cs     |  2 +-
 .../Apache.Ignite.Core/Events/EventBase.cs      |  4 +-
 .../Apache.Ignite.Core/Events/JobEvent.cs       |  4 +-
 .../Apache.Ignite.Core/Events/TaskEvent.cs      |  2 +-
 .../Impl/Binary/BinaryReader.cs                 |  4 +-
 .../Impl/Binary/BinarySystemHandlers.cs         |  2 +-
 .../Impl/Binary/BinaryUtils.cs                  | 11 +++--
 .../Impl/Binary/Marshaller.cs                   |  4 +-
 13 files changed, 88 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
index 6cec7a1..8f7d5de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
@@ -510,7 +510,7 @@ public class PlatformContextImpl implements PlatformContext {
             writer.writeBoolean(event0.isNear());
             writeNode(writer, event0.eventNode());
             writer.writeObject(event0.key());
-            PlatformUtils.writeIgniteUuid(writer, event0.xid());
+            writer.writeObject(event0.xid());
             writer.writeObject(event0.newValue());
             writer.writeObject(event0.oldValue());
             writer.writeBoolean(event0.hasOldValue());
@@ -589,8 +589,8 @@ public class PlatformContextImpl implements PlatformContext {
 
             writer.writeString(event0.taskName());
             writer.writeString(event0.taskClassName());
-            PlatformUtils.writeIgniteUuid(writer, event0.taskSessionId());
-            PlatformUtils.writeIgniteUuid(writer, event0.jobId());
+            writer.writeObject(event0.taskSessionId());
+            writer.writeObject(event0.jobId());
             writeNode(writer, event0.taskNode());
             writer.writeUuid(event0.taskSubjectId());
         }
@@ -610,7 +610,7 @@ public class PlatformContextImpl implements PlatformContext {
 
             writer.writeString(event0.taskName());
             writer.writeString(event0.taskClassName());
-            PlatformUtils.writeIgniteUuid(writer, event0.taskSessionId());
+            writer.writeObject(event0.taskSessionId());
             writer.writeBoolean(event0.internal());
             writer.writeUuid(event0.subjectId());
         }
@@ -625,7 +625,7 @@ public class PlatformContextImpl implements PlatformContext {
      * @param evt Event.
      */
     private void writeCommonEventData(BinaryRawWriterEx writer, EventAdapter evt) {
-        PlatformUtils.writeIgniteUuid(writer, evt.id());
+        writer.writeObject(evt.id());
         writer.writeLong(evt.localOrder());
         writeNode(writer, evt.node());
         writer.writeString(evt.message());

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
index 036491f..540daa2 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
@@ -107,6 +107,9 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
     /** Type: enum array from cache. */
     private static final int TYPE_ENUM_ARRAY_FROM_CACHE = 21;
 
+    /** Type: ignite uuid. */
+    private static final int TYPE_IGNITE_UUID = 22;
+
     /** {@inheritDoc} */
     @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
         @Nullable Integer arg) {
@@ -219,6 +222,9 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
                 case TYPE_AFFINITY_KEY:
                     return new AffinityKey<>("interopAffinityKey");
 
+                case TYPE_IGNITE_UUID:
+                    return ignite.cache(null).get(TYPE_IGNITE_UUID);
+
                 default:
                     throw new IgniteException("Unknown type: " + type);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryReaderWriterTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryReaderWriterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryReaderWriterTest.cs
index c17caff..ffbd084 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryReaderWriterTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryReaderWriterTest.cs
@@ -92,12 +92,14 @@ namespace Apache.Ignite.Core.Tests.Binary
                 writer.WriteDouble("Double", 1);
                 writer.WriteDoubleArray("DoubleArray", new double[] {1});
                 writer.WriteDecimal("Decimal", 1);
+                writer.WriteDecimal("DecimalN", null);
                 writer.WriteDecimalArray("DecimalArray", new decimal?[] {1});
                 writer.WriteTimestamp("Timestamp", Date);
                 writer.WriteTimestampArray("TimestampArray", new DateTime?[] {Date});
                 writer.WriteString("String", "1");
                 writer.WriteStringArray("StringArray", new[] {"1"});
                 writer.WriteGuid("Guid", Guid);
+                writer.WriteGuid("GuidN", null);
                 writer.WriteGuidArray("GuidArray", new Guid?[] {Guid});
                 writer.WriteEnum("Enum", MyEnum.Bar);
                 writer.WriteEnumArray("EnumArray", new[] {MyEnum.Bar});
@@ -121,12 +123,14 @@ namespace Apache.Ignite.Core.Tests.Binary
                 raw.WriteDouble(1);
                 raw.WriteDoubleArray(new double[] {1});
                 raw.WriteDecimal(1);
+                raw.WriteDecimal(null);
                 raw.WriteDecimalArray(new decimal?[] {1});
                 raw.WriteTimestamp(Date);
                 raw.WriteTimestampArray(new DateTime?[] {Date});
                 raw.WriteString("1");
                 raw.WriteStringArray(new[] {"1"});
                 raw.WriteGuid(Guid);
+                raw.WriteGuid(null);
                 raw.WriteGuidArray(new Guid?[] {Guid});
                 raw.WriteEnum(MyEnum.Bar);
                 raw.WriteEnumArray(new[] {MyEnum.Bar});
@@ -151,12 +155,14 @@ namespace Apache.Ignite.Core.Tests.Binary
                 Assert.AreEqual(1, reader.ReadDouble("Double"));
                 Assert.AreEqual(new double[] {1}, reader.ReadDoubleArray("DoubleArray"));
                 Assert.AreEqual(1, reader.ReadDecimal("Decimal"));
+                Assert.AreEqual(null, reader.ReadDecimal("DecimalN"));
                 Assert.AreEqual(new decimal?[] {1}, reader.ReadDecimalArray("DecimalArray"));
                 Assert.AreEqual(Date, reader.ReadTimestamp("Timestamp"));
                 Assert.AreEqual(new DateTime?[] {Date}, reader.ReadTimestampArray("TimestampArray"));
                 Assert.AreEqual("1", reader.ReadString("String"));
                 Assert.AreEqual(new[] {"1"}, reader.ReadStringArray("StringArray"));
                 Assert.AreEqual(Guid, reader.ReadGuid("Guid"));
+                Assert.AreEqual(null, reader.ReadGuid("GuidN"));
                 Assert.AreEqual(new Guid?[] {Guid}, reader.ReadGuidArray("GuidArray"));
                 Assert.AreEqual(MyEnum.Bar, reader.ReadEnum<MyEnum>("Enum"));
                 Assert.AreEqual(new[] {MyEnum.Bar}, reader.ReadEnumArray<MyEnum>("EnumArray"));
@@ -180,12 +186,14 @@ namespace Apache.Ignite.Core.Tests.Binary
                 Assert.AreEqual(1, raw.ReadDouble());
                 Assert.AreEqual(new double[] { 1 }, raw.ReadDoubleArray());
                 Assert.AreEqual(1, raw.ReadDecimal());
+                Assert.AreEqual(null, raw.ReadDecimal());
                 Assert.AreEqual(new decimal?[] { 1 }, raw.ReadDecimalArray());
                 Assert.AreEqual(Date, raw.ReadTimestamp());
                 Assert.AreEqual(new DateTime?[] { Date }, raw.ReadTimestampArray());
                 Assert.AreEqual("1", raw.ReadString());
                 Assert.AreEqual(new[] { "1" }, raw.ReadStringArray());
                 Assert.AreEqual(Guid, raw.ReadGuid());
+                Assert.AreEqual(null, raw.ReadGuid());
                 Assert.AreEqual(new Guid?[] { Guid }, raw.ReadGuidArray());
                 Assert.AreEqual(MyEnum.Bar, raw.ReadEnum<MyEnum>());
                 Assert.AreEqual(new[] { MyEnum.Bar }, raw.ReadEnumArray<MyEnum>());

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
index da3ef1a..0125466 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
@@ -118,6 +118,9 @@ namespace Apache.Ignite.Core.Tests.Compute
 
         /** Type: enum array from cache. */
         private const int EchoTypeEnumArrayFromCache = 21;
+                
+        /** Echo type: IgniteUuid. */
+        private const int EchoTypeIgniteUuid = 22;
 
         /** First node. */
         private IIgnite _grid1;
@@ -1032,6 +1035,22 @@ namespace Apache.Ignite.Core.Tests.Compute
         }
 
         /// <summary>
+        /// Tests that IgniteGuid in .NET maps to IgniteUuid in Java.
+        /// </summary>
+        [Test]
+        public void TestEchoTaskIgniteUuid()
+        {
+            var guid = Guid.NewGuid();
+
+            _grid1.GetCache<int, object>(null)[EchoTypeIgniteUuid] = new IgniteGuid(guid, 25);
+
+            var res = _grid1.GetCompute().ExecuteJavaTask<IgniteGuid>(EchoTask, EchoTypeIgniteUuid);
+
+            Assert.AreEqual(guid, res.GlobalId);
+            Assert.AreEqual(25, res.LocalId);
+        }
+
+        /// <summary>
         /// Test for binary argument in Java.
         /// </summary>
         [Test]

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
index 10fbb2e..b686f9b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
@@ -18,14 +18,16 @@
 namespace Apache.Ignite.Core.Common
 {
     using System;
+    using System.Diagnostics;
     using System.Globalization;
     using Apache.Ignite.Core.Binary;
+    using Apache.Ignite.Core.Impl.Binary;
 
     /// <summary>
     /// Ignite guid with additional local ID.
     /// </summary>
     [Serializable]
-    public struct IgniteGuid : IEquatable<IgniteGuid>
+    public struct IgniteGuid : IEquatable<IgniteGuid>, IBinaryWriteAware
     {
         /** Global id. */
         private readonly Guid _globalId;
@@ -45,6 +47,20 @@ namespace Apache.Ignite.Core.Common
         }
 
         /// <summary>
+        /// Initializes a new instance of the <see cref="IgniteGuid"/> struct.
+        /// </summary>
+        /// <param name="reader">The reader.</param>
+        internal IgniteGuid(IBinaryRawReader reader)
+        {
+            Debug.Assert(reader != null);
+
+            var stream = ((BinaryReader) reader).Stream;
+
+            _localId = stream.ReadLong();
+            _globalId = BinaryUtils.ReadGuid(stream);
+        }
+
+        /// <summary>
         /// Gets the global id.
         /// </summary>
         public Guid GlobalId
@@ -90,20 +106,6 @@ namespace Apache.Ignite.Core.Common
         }
 
         /// <summary>
-        /// Reads this object from the given reader.
-        /// </summary> 
-        /// <param name="r">Reader.</param>
-        internal static IgniteGuid? Read(IBinaryRawReader r)
-        {
-            var guid = r.ReadGuid();
-
-            if (guid == null)
-                return null;
-
-            return new IgniteGuid(guid.Value, r.ReadLong());
-        }
-
-        /// <summary>
         /// Implements the operator ==.
         /// </summary>
         /// <param name="a">First item.</param>
@@ -128,5 +130,20 @@ namespace Apache.Ignite.Core.Common
         {
             return !(a == b);
         }
+
+        /// <summary>
+        /// Writes this object to the given writer.
+        /// </summary>
+        /// <param name="writer">Writer.</param>
+        /// <exception cref="System.NotImplementedException"></exception>
+        void IBinaryWriteAware.WriteBinary(IBinaryWriter writer)
+        {
+            Debug.Assert(writer != null);
+
+            var stream = ((BinaryWriter) writer.GetRawWriter()).Stream;
+
+            stream.WriteLong(_localId);
+            BinaryUtils.WriteGuid(_globalId, stream);
+        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs
index ec22fad..62687b9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs
@@ -79,7 +79,7 @@ namespace Apache.Ignite.Core.Events
             _isNear = r.ReadBoolean();
             _eventNode = ReadNode(r);
             _key = r.ReadObject<object>();
-            _xid = IgniteGuid.Read(r);
+            _xid = r.ReadObject<IgniteGuid?>();
             _newValue = r.ReadObject<object>();
             _oldValue = r.ReadObject<object>();
             _hasOldValue = r.ReadBoolean();

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs
index 4992266..8aa446a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs
@@ -58,9 +58,7 @@ namespace Apache.Ignite.Core.Events
         /// <param name="r">The reader to read data from.</param>
         protected EventBase(IBinaryRawReader r)
         {
-            var id = IgniteGuid.Read(r);
-            Debug.Assert(id.HasValue);
-            _id = id.Value;
+            _id = r.ReadObject<IgniteGuid>();
 
             _localOrder = r.ReadLong();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs
index 06512c5..878562f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/JobEvent.cs
@@ -54,8 +54,8 @@ namespace Apache.Ignite.Core.Events
         {
             _taskName = r.ReadString();
             _taskClassName = r.ReadString();
-            _taskSessionId = IgniteGuid.Read(r);
-            _jobId = IgniteGuid.Read(r);
+            _taskSessionId = r.ReadObject<IgniteGuid?>();
+            _jobId = r.ReadObject<IgniteGuid?>();
             _taskNode = ReadNode(r);
             _taskSubjectId = r.ReadGuid();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs
index aa03969..e2b9eaf 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/TaskEvent.cs
@@ -50,7 +50,7 @@ namespace Apache.Ignite.Core.Events
         {
             _taskName = r.ReadString();
             _taskClassName = r.ReadString();
-            _taskSessionId = IgniteGuid.Read(r);
+            _taskSessionId = r.ReadObject<IgniteGuid?>();
             _internal = r.ReadBoolean();
             _subjectId = r.ReadGuid();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
index 2a59c06..092eb72 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
@@ -354,13 +354,13 @@ namespace Apache.Ignite.Core.Impl.Binary
         /** <inheritdoc /> */
         public Guid? ReadGuid(string fieldName)
         {
-            return ReadField(fieldName, BinaryUtils.ReadGuid, BinaryUtils.TypeGuid);
+            return ReadField<Guid?>(fieldName, r => BinaryUtils.ReadGuid(r), BinaryUtils.TypeGuid);
         }
 
         /** <inheritdoc /> */
         public Guid? ReadGuid()
         {
-            return Read(BinaryUtils.ReadGuid, BinaryUtils.TypeGuid);
+            return Read<Guid?>(r => BinaryUtils.ReadGuid(r), BinaryUtils.TypeGuid);
         }
 
         /** <inheritdoc /> */

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySystemHandlers.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySystemHandlers.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySystemHandlers.cs
index f601a34..beb2668 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySystemHandlers.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySystemHandlers.cs
@@ -102,7 +102,7 @@ namespace Apache.Ignite.Core.Impl.Binary
             ReadHandlers[BinaryUtils.TypeString] = new BinarySystemReader<string>(BinaryUtils.ReadString);
 
             // 4. Guid.
-            ReadHandlers[BinaryUtils.TypeGuid] = new BinarySystemReader<Guid?>(BinaryUtils.ReadGuid);
+            ReadHandlers[BinaryUtils.TypeGuid] = new BinarySystemReader<Guid?>(s => BinaryUtils.ReadGuid(s));
 
             // 5. Primitive arrays.
             ReadHandlers[BinaryUtils.TypeArrayBool] = new BinarySystemReader<bool[]>(BinaryUtils.ReadBooleanArray);

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
index 09c3ad4..f00b8f9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
@@ -190,6 +190,9 @@ namespace Apache.Ignite.Core.Impl.Binary
         /** Type: platform object proxy. */
         public const byte TypePlatformJavaObjectFactoryProxy = 99;
 
+        /** Type: platform object proxy. */
+        public const int TypeIgniteUuid = 2018070327;
+
         /** Collection: custom. */
         public const byte CollectionCustom = 0;
 
@@ -254,8 +257,8 @@ namespace Apache.Ignite.Core.Impl.Binary
             ? (Action<Guid, IBinaryStream>)WriteGuidFast : WriteGuidSlow;
 
         /** Guid reader. */
-        public static readonly Func<IBinaryStream, Guid?> ReadGuid = IsGuidSequential
-            ? (Func<IBinaryStream, Guid?>)ReadGuidFast : ReadGuidSlow;
+        public static readonly Func<IBinaryStream, Guid> ReadGuid = IsGuidSequential
+            ? (Func<IBinaryStream, Guid>)ReadGuidFast : ReadGuidSlow;
 
         /** String mode environment variable. */
         public const string IgniteBinaryMarshallerUseStringSerializationVer2 =
@@ -1169,7 +1172,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// </summary>
         /// <param name="stream">The stream.</param>
         /// <returns>Guid.</returns>
-        public static unsafe Guid? ReadGuidFast(IBinaryStream stream)
+        public static unsafe Guid ReadGuidFast(IBinaryStream stream)
         {
             JavaGuid jguid;
 
@@ -1187,7 +1190,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// </summary>
         /// <param name="stream">The stream.</param>
         /// <returns>Guid.</returns>
-        public static unsafe Guid? ReadGuidSlow(IBinaryStream stream)
+        public static unsafe Guid ReadGuidSlow(IBinaryStream stream)
         {
             byte* jBytes = stackalloc byte[16];
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e5e3cbf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
index 6dee998..9ec4216 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@ -23,6 +23,7 @@ namespace Apache.Ignite.Core.Impl.Binary
     using System.Linq;
     using Apache.Ignite.Core.Binary;
     using Apache.Ignite.Core.Cache.Affinity;
+    using Apache.Ignite.Core.Common;
     using Apache.Ignite.Core.Impl.Binary.IO;
     using Apache.Ignite.Core.Impl.Binary.Metadata;
     using Apache.Ignite.Core.Impl.Cache;
@@ -60,7 +61,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// <summary>
         /// Constructor.
         /// </summary>
-        /// <param name="cfg">Configurtaion.</param>
+        /// <param name="cfg">Configuration.</param>
         public Marshaller(BinaryConfiguration cfg)
         {
             // Validation.
@@ -609,6 +610,7 @@ namespace Apache.Ignite.Core.Impl.Binary
             AddSystemType(0, r => new AffinityKey(r), "affKey");
             AddSystemType(BinaryUtils.TypePlatformJavaObjectFactoryProxy, r => new PlatformJavaObjectFactoryProxy());
             AddSystemType(0, r => new ObjectInfoHolder(r));
+            AddSystemType(BinaryUtils.TypeIgniteUuid, r => new IgniteGuid(r));
         }
     }
 }