Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 37F7D200C48 for ; Thu, 16 Mar 2017 08:52:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 36BCF160B7A; Thu, 16 Mar 2017 07:52:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F1149160B91 for ; Thu, 16 Mar 2017 08:52:55 +0100 (CET) Received: (qmail 95041 invoked by uid 500); 16 Mar 2017 07:52:55 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 94951 invoked by uid 99); 16 Mar 2017 07:52:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Mar 2017 07:52:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1C18DFF72; Thu, 16 Mar 2017 07:52:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Thu, 16 Mar 2017 07:52:57 -0000 Message-Id: In-Reply-To: <292c42a9c24f466192b3490ef26b3666@git.apache.org> References: <292c42a9c24f466192b3490ef26b3666@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/8] ignite git commit: IGNITE-4716 .NET: Add IgniteUuid system type support archived-at: Thu, 16 Mar 2017 07:52:57 -0000 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-4768-1 Commit: 8e5e3cbf35976fc57652906f26c86e25a561b41a Parents: 637c18d Author: Pavel Tupitsyn Authored: Wed Mar 15 14:04:31 2017 +0300 Committer: Pavel Tupitsyn 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 /** 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 map(List subgrid, @Nullable Integer arg) { @@ -219,6 +222,9 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter 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("Enum")); Assert.AreEqual(new[] {MyEnum.Bar}, reader.ReadEnumArray("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()); Assert.AreEqual(new[] { MyEnum.Bar }, raw.ReadEnumArray()); 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 } /// + /// Tests that IgniteGuid in .NET maps to IgniteUuid in Java. + /// + [Test] + public void TestEchoTaskIgniteUuid() + { + var guid = Guid.NewGuid(); + + _grid1.GetCache(null)[EchoTypeIgniteUuid] = new IgniteGuid(guid, 25); + + var res = _grid1.GetCompute().ExecuteJavaTask(EchoTask, EchoTypeIgniteUuid); + + Assert.AreEqual(guid, res.GlobalId); + Assert.AreEqual(25, res.LocalId); + } + + /// /// Test for binary argument in Java. /// [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; /// /// Ignite guid with additional local ID. /// [Serializable] - public struct IgniteGuid : IEquatable + public struct IgniteGuid : IEquatable, IBinaryWriteAware { /** Global id. */ private readonly Guid _globalId; @@ -45,6 +47,20 @@ namespace Apache.Ignite.Core.Common } /// + /// Initializes a new instance of the struct. + /// + /// The reader. + internal IgniteGuid(IBinaryRawReader reader) + { + Debug.Assert(reader != null); + + var stream = ((BinaryReader) reader).Stream; + + _localId = stream.ReadLong(); + _globalId = BinaryUtils.ReadGuid(stream); + } + + /// /// Gets the global id. /// public Guid GlobalId @@ -90,20 +106,6 @@ namespace Apache.Ignite.Core.Common } /// - /// Reads this object from the given reader. - /// - /// Reader. - internal static IgniteGuid? Read(IBinaryRawReader r) - { - var guid = r.ReadGuid(); - - if (guid == null) - return null; - - return new IgniteGuid(guid.Value, r.ReadLong()); - } - - /// /// Implements the operator ==. /// /// First item. @@ -128,5 +130,20 @@ namespace Apache.Ignite.Core.Common { return !(a == b); } + + /// + /// Writes this object to the given writer. + /// + /// Writer. + /// + 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(); - _xid = IgniteGuid.Read(r); + _xid = r.ReadObject(); _newValue = r.ReadObject(); _oldValue = r.ReadObject(); _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 /// The reader to read data from. protected EventBase(IBinaryRawReader r) { - var id = IgniteGuid.Read(r); - Debug.Assert(id.HasValue); - _id = id.Value; + _id = r.ReadObject(); _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(); + _jobId = r.ReadObject(); _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(); _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 /** */ public Guid? ReadGuid(string fieldName) { - return ReadField(fieldName, BinaryUtils.ReadGuid, BinaryUtils.TypeGuid); + return ReadField(fieldName, r => BinaryUtils.ReadGuid(r), BinaryUtils.TypeGuid); } /** */ public Guid? ReadGuid() { - return Read(BinaryUtils.ReadGuid, BinaryUtils.TypeGuid); + return Read(r => BinaryUtils.ReadGuid(r), BinaryUtils.TypeGuid); } /** */ 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(BinaryUtils.ReadString); // 4. Guid. - ReadHandlers[BinaryUtils.TypeGuid] = new BinarySystemReader(BinaryUtils.ReadGuid); + ReadHandlers[BinaryUtils.TypeGuid] = new BinarySystemReader(s => BinaryUtils.ReadGuid(s)); // 5. Primitive arrays. ReadHandlers[BinaryUtils.TypeArrayBool] = new BinarySystemReader(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)WriteGuidFast : WriteGuidSlow; /** Guid reader. */ - public static readonly Func ReadGuid = IsGuidSequential - ? (Func)ReadGuidFast : ReadGuidSlow; + public static readonly Func ReadGuid = IsGuidSequential + ? (Func)ReadGuidFast : ReadGuidSlow; /** String mode environment variable. */ public const string IgniteBinaryMarshallerUseStringSerializationVer2 = @@ -1169,7 +1172,7 @@ namespace Apache.Ignite.Core.Impl.Binary /// /// The stream. /// Guid. - 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 /// /// The stream. /// Guid. - 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 /// /// Constructor. /// - /// Configurtaion. + /// Configuration. 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)); } } }