From d3c4a3e61a32343aeee012c1b751a96b490fb1bc Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 16:03:48 +0300 Subject: [PATCH 1/8] IGNITE-6627 .NET: Fix structure tracker optimization --- .../Impl/Binary/Structure/BinaryStructureTracker.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs index 3517342be28cf..54555223057f5 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs @@ -115,16 +115,6 @@ public void UpdateWriterStructure(BinaryWriter writer) writer.SaveMetadata(_desc, fields); } } - else - { - // Special case when the object is with no properties. - // Save meta to Marshaller. - writer.Marshaller.GetBinaryTypeHandler(_desc); - - // Save meta to cluster. - writer.SaveMetadata(_desc, null); - return; - } } /// From 01efdaadbcc9d51dc2c767a1067107ac4e2f2657 Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 16:12:49 +0300 Subject: [PATCH 2/8] fix error code --- .../client/binary/ClientBinaryTypeGetRequest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java index 72f9f58fd65e6..a044a3ae6a902 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java @@ -22,6 +22,8 @@ import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext; import org.apache.ignite.internal.processors.platform.client.ClientRequest; import org.apache.ignite.internal.processors.platform.client.ClientResponse; +import org.apache.ignite.internal.processors.platform.client.ClientStatus; +import org.apache.ignite.internal.processors.platform.client.IgniteClientException; /** * Binary type schema request. @@ -43,7 +45,11 @@ public ClientBinaryTypeGetRequest(BinaryRawReader reader) { /** {@inheritDoc} */ @Override public ClientResponse process(ClientConnectionContext ctx) { - BinaryTypeImpl type = (BinaryTypeImpl)ctx.kernalContext().cacheObjects().binary().type( typeId); + BinaryTypeImpl type = (BinaryTypeImpl)ctx.kernalContext().cacheObjects().binary().type(typeId); + + if (type == null) { + throw new IgniteClientException(ClientStatus.FAILED, "Binary type not found: " + typeId); + } return new ClientBinaryTypeGetResponse(requestId(), type.metadata()); } From 91a723b0f9bcfa821fd83bbd4b4207e33d58d3d1 Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 16:22:12 +0300 Subject: [PATCH 3/8] wip tests --- .../Binary/Serializable/BasicSerializableObjectsTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/BasicSerializableObjectsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/BasicSerializableObjectsTest.cs index e9b557695d00d..846cd4c53fd19 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/BasicSerializableObjectsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/BasicSerializableObjectsTest.cs @@ -44,12 +44,13 @@ public void TestEmptyObject() public void TestEmptyObjectOnline() { using (var ignite = Ignition.Start(TestUtils.GetTestConfiguration())) + using (var ignite2 = Ignition.Start(TestUtils.GetTestConfiguration(name: "1"))) { var cache = ignite.CreateCache("c"); cache[1] = new EmptyObject(); - var res = cache[1]; + var res = ignite2.GetCache("c")[1]; Assert.IsNotNull(res); } From ff25679fc33605c9a33c33415515fde6ef69d0ea Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 16:36:22 +0300 Subject: [PATCH 4/8] Refactor structure tracker --- .../Impl/Binary/BinaryFullTypeDescriptor.cs | 15 +- .../Binary/BinarySurrogateTypeDescriptor.cs | 8 +- .../Impl/Binary/IBinaryTypeDescriptor.cs | 6 +- .../Impl/Binary/Structure/BinaryStructure.cs | 145 +++++++++--------- .../Structure/BinaryStructureTracker.cs | 8 +- 5 files changed, 90 insertions(+), 92 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs index e38b5ba0fc865..52ed81016ee0c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs @@ -230,22 +230,25 @@ public BinaryStructure ReaderTypeStructure } /** */ - public void UpdateWriteStructure(BinaryStructure exp, int pathIdx, - IList updates) + public void UpdateWriteStructure(int pathIdx, IList updates) { lock (this) { - _writerTypeStruct = _writerTypeStruct.Merge(exp, pathIdx, updates); + if (_writerTypeStruct == null) + { + _writerTypeStruct = BinaryStructure.CreateEmpty(); + } + + _writerTypeStruct = _writerTypeStruct.Merge(pathIdx, updates); } } /** */ - public void UpdateReadStructure(BinaryStructure exp, int pathIdx, - IList updates) + public void UpdateReadStructure(int pathIdx, IList updates) { lock (this) { - _readerTypeStructure = _readerTypeStructure.Merge(exp, pathIdx, updates); + _readerTypeStructure = _readerTypeStructure.Merge(pathIdx, updates); } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs index 737c7c452d326..6fece77805562 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs @@ -134,20 +134,20 @@ public BinaryStructure ReaderTypeStructure } /** */ - public void UpdateWriteStructure(BinaryStructure exp, int pathIdx, IList updates) + public void UpdateWriteStructure(int pathIdx, IList updates) { lock (this) { - _writerTypeStruct = _writerTypeStruct.Merge(exp, pathIdx, updates); + _writerTypeStruct = _writerTypeStruct.Merge(pathIdx, updates); } } /** */ - public void UpdateReadStructure(BinaryStructure exp, int pathIdx, IList updates) + public void UpdateReadStructure(int pathIdx, IList updates) { lock (this) { - _readerTypeStructure = _readerTypeStructure.Merge(exp, pathIdx, updates); + _readerTypeStructure = _readerTypeStructure.Merge(pathIdx, updates); } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryTypeDescriptor.cs index 4bd7e73777051..840fc0859d7ee 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryTypeDescriptor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryTypeDescriptor.cs @@ -90,18 +90,16 @@ internal interface IBinaryTypeDescriptor /// /// Update write type structure. /// - /// Expected type structure. /// Path index. /// Recorded updates. - void UpdateWriteStructure(BinaryStructure exp, int pathIdx, IList updates); + void UpdateWriteStructure(int pathIdx, IList updates); /// /// Update read type structure. /// - /// Expected type structure. /// Path index. /// Recorded updates. - void UpdateReadStructure(BinaryStructure exp, int pathIdx, IList updates); + void UpdateReadStructure(int pathIdx, IList updates); /// /// Gets the schema. diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs index 92c841c2d5b55..bb80bbf8e5159 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs @@ -118,12 +118,10 @@ public int GetFieldId(string fieldName, byte fieldType, ref int pathIdx, int act /// /// Merge updates into a new type structure. /// - /// Expected type structure to apply updates to /// Path index. /// Updates. /// New type structure with updates. - public BinaryStructure Merge(BinaryStructure exp, int pathIdx, - IList updates) + public BinaryStructure Merge(int pathIdx, IList updates) { if (updates.Count == 0) return this; @@ -137,102 +135,97 @@ public int GetFieldId(string fieldName, byte fieldType, ref int pathIdx, int act // Note that field types are merged anyway to avoid metadata clashes. BinaryStructure res = MergeFieldTypes(updates); + BinaryStructureUpdate firstUpdate = updates[0]; - if (ReferenceEquals(exp, this)) + if (firstUpdate.Index == 0) { - BinaryStructureUpdate firstUpdate = updates[0]; + // Special case: the very first structure update. Simply attach all updates. + Debug.Assert(_paths.Length == 1); + Debug.Assert(_paths[0].Length == 0); + Debug.Assert(pathIdx == 0); - if (firstUpdate.Index == 0) - { - // Special case: the very first structure update. Simply attach all updates. - Debug.Assert(_paths.Length == 1); - Debug.Assert(_paths[0].Length == 0); - Debug.Assert(pathIdx == 0); - - var newPaths = CopyPaths(updates.Count, 0); + var newPaths = CopyPaths(updates.Count, 0); - ApplyUpdatesToPath(newPaths[0], updates); - - res = new BinaryStructure(newPaths, _jumps, res._fieldTypes); - } - else - { - // Get entry where updates should start. - BinaryStructureEntry[] path = _paths[pathIdx]; + ApplyUpdatesToPath(newPaths[0], updates); - BinaryStructureEntry startEntry = default(BinaryStructureEntry); - - if (firstUpdate.Index < path.Length) - startEntry = path[firstUpdate.Index]; + res = new BinaryStructure(newPaths, _jumps, res._fieldTypes); + } + else + { + // Get entry where updates should start. + BinaryStructureEntry[] path = _paths[pathIdx]; - if (startEntry.IsEmpty) - { - // We are on the empty/non-existent entry. Continue the path without branching. - var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 0); + BinaryStructureEntry startEntry = default(BinaryStructureEntry); - ApplyUpdatesToPath(newPaths[pathIdx], updates); + if (firstUpdate.Index < path.Length) + startEntry = path[firstUpdate.Index]; - res = new BinaryStructure(newPaths, _jumps, res._fieldTypes); - } - else if (startEntry.IsJumpTable) - { - // We are on the jump table. Add a new path and record it in the jump table. - - // 1. Prepare new structures. - var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 1); - var newJumps = CopyJumps(0); + if (startEntry.IsEmpty) + { + // We are on the empty/non-existent entry. Continue the path without branching. + var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 0); - // New path will be the last one. - int newPathIdx = newPaths.Length - 1; + ApplyUpdatesToPath(newPaths[pathIdx], updates); - // Apply updates to the new path. - ApplyUpdatesToPath(newPaths[newPathIdx], updates); + res = new BinaryStructure(newPaths, _jumps, res._fieldTypes); + } + else if (startEntry.IsJumpTable) + { + // We are on the jump table. Add a new path and record it in the jump table. - // Add the jump to the table. - newJumps[startEntry.Id] = - newJumps[startEntry.Id].CopyAndAdd(firstUpdate.FieldName, newPathIdx); + // 1. Prepare new structures. + var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 1); + var newJumps = CopyJumps(0); - res = new BinaryStructure(newPaths, newJumps, res._fieldTypes); - } - else - { - // We are on existing entry. Need to create a new jump table here and two new paths. + // New path will be the last one. + int newPathIdx = newPaths.Length - 1; - // 1. Prepaare new structures. - var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 2); - var newJumps = CopyJumps(1); + // Apply updates to the new path. + ApplyUpdatesToPath(newPaths[newPathIdx], updates); - // Old path will be moved here. - int oldPathIdx = newPaths.Length - 2; + // Add the jump to the table. + newJumps[startEntry.Id] = + newJumps[startEntry.Id].CopyAndAdd(firstUpdate.FieldName, newPathIdx); - // New path will reside here. - int newPathIdx = newPaths.Length - 1; + res = new BinaryStructure(newPaths, newJumps, res._fieldTypes); + } + else + { + // We are on existing entry. Need to create a new jump table here and two new paths. - // Create new jump table. - int newJumpIdx = newJumps.Length - 1; + // 1. Prepaare new structures. + var newPaths = CopyPaths(firstUpdate.Index + updates.Count, 2); + var newJumps = CopyJumps(1); - newJumps[newJumpIdx] = new BinaryStructureJumpTable(startEntry.Name, oldPathIdx, - firstUpdate.FieldName, newPathIdx); + // Old path will be moved here. + int oldPathIdx = newPaths.Length - 2; - // Re-create old path in two steps: move old path to the new place, then clean the old path. - for (int i = firstUpdate.Index; i < path.Length; i++) - { - newPaths[oldPathIdx][i] = newPaths[pathIdx][i]; + // New path will reside here. + int newPathIdx = newPaths.Length - 1; - if (i == firstUpdate.Index) - // Inject jump table ... - newPaths[pathIdx][i] = new BinaryStructureEntry(newJumpIdx); - else - // ... or just reset. - newPaths[pathIdx][i] = new BinaryStructureEntry(); - } + // Create new jump table. + int newJumpIdx = newJumps.Length - 1; - // Apply updates to the new path. - ApplyUpdatesToPath(newPaths[newPaths.Length - 1], updates); + newJumps[newJumpIdx] = new BinaryStructureJumpTable(startEntry.Name, oldPathIdx, + firstUpdate.FieldName, newPathIdx); - res = new BinaryStructure(newPaths, newJumps, res._fieldTypes); + // Re-create old path in two steps: move old path to the new place, then clean the old path. + for (int i = firstUpdate.Index; i < path.Length; i++) + { + newPaths[oldPathIdx][i] = newPaths[pathIdx][i]; + + if (i == firstUpdate.Index) + // Inject jump table ... + newPaths[pathIdx][i] = new BinaryStructureEntry(newJumpIdx); + else + // ... or just reset. + newPaths[pathIdx][i] = new BinaryStructureEntry(); } + // Apply updates to the new path. + ApplyUpdatesToPath(newPaths[newPaths.Length - 1], updates); + + res = new BinaryStructure(newPaths, newJumps, res._fieldTypes); } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs index 54555223057f5..01ab293850482 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs @@ -86,7 +86,7 @@ public int GetFieldId(string fieldName, byte fieldTypeId = 0) public void UpdateReaderStructure() { if (_curStructUpdates != null) - _desc.UpdateReadStructure(_desc.ReaderTypeStructure, _curStructPath, _curStructUpdates); + _desc.UpdateReadStructure(_curStructPath, _curStructUpdates); } /// @@ -97,7 +97,7 @@ public void UpdateWriterStructure(BinaryWriter writer) { if (_curStructUpdates != null) { - _desc.UpdateWriteStructure(_desc.WriterTypeStructure, _curStructPath, _curStructUpdates); + _desc.UpdateWriteStructure(_curStructPath, _curStructUpdates); var marsh = writer.Marshaller; @@ -115,6 +115,10 @@ public void UpdateWriterStructure(BinaryWriter writer) writer.SaveMetadata(_desc, fields); } } + else + { + // TODO + } } /// From f41ef04275596c71db8a28661c8b056083be5934 Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 16:48:27 +0300 Subject: [PATCH 5/8] Fixing empty types handling --- .../Impl/Binary/BinaryFullTypeDescriptor.cs | 2 +- .../Impl/Binary/Structure/BinaryStructure.cs | 2 +- .../Impl/Binary/Structure/BinaryStructureTracker.cs | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs index 52ed81016ee0c..f74523ee9883d 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs @@ -55,7 +55,7 @@ internal class BinaryFullTypeDescriptor : IBinaryTypeDescriptor private readonly string _affKeyFieldName; /** Type structure. */ - private volatile BinaryStructure _writerTypeStruct = BinaryStructure.CreateEmpty(); + private volatile BinaryStructure _writerTypeStruct; /** Type structure. */ private volatile BinaryStructure _readerTypeStructure = BinaryStructure.CreateEmpty(); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs index bb80bbf8e5159..908059abdce77 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs @@ -123,7 +123,7 @@ public int GetFieldId(string fieldName, byte fieldType, ref int pathIdx, int act /// New type structure with updates. public BinaryStructure Merge(int pathIdx, IList updates) { - if (updates.Count == 0) + if (updates == null || updates.Count == 0) return this; // Algorithm ensures that updates are applied to the same type structure, diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs index 01ab293850482..26624724ab721 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs @@ -68,7 +68,7 @@ public int GetFieldId(string fieldName, byte fieldTypeId = 0) { _curStructAction++; - if (_curStructUpdates == null) + if (_curStructUpdates == null && _portStruct != null) { var fieldId = _portStruct.GetFieldId(fieldName, fieldTypeId, ref _curStructPath, _curStructAction); @@ -115,9 +115,12 @@ public void UpdateWriterStructure(BinaryWriter writer) writer.SaveMetadata(_desc, fields); } } - else + else if (_desc.WriterTypeStructure == null) { - // TODO + // Empty object (no fields). + // Null WriterTypeStructure indicates that meta has never been sent for this type. + writer.SaveMetadata(_desc, null); + _desc.UpdateWriteStructure(_curStructPath, null); } } From d339b53d3424f4279b7d2438c7cae28190f0bb9b Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 17:18:51 +0300 Subject: [PATCH 6/8] Fix meta handler --- .../Impl/Binary/Structure/BinaryStructureTracker.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs index 26624724ab721..ee2e7e17047df 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructureTracker.cs @@ -119,6 +119,7 @@ public void UpdateWriterStructure(BinaryWriter writer) { // Empty object (no fields). // Null WriterTypeStructure indicates that meta has never been sent for this type. + writer.Marshaller.GetBinaryTypeHandler(_desc); writer.SaveMetadata(_desc, null); _desc.UpdateWriteStructure(_curStructPath, null); } From 93cd79fa1de865635bbd6a451b0d093c21109dd5 Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 17:23:51 +0300 Subject: [PATCH 7/8] Cleanup --- .../client/binary/ClientBinaryTypeGetRequest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java index a044a3ae6a902..72f9f58fd65e6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java @@ -22,8 +22,6 @@ import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext; import org.apache.ignite.internal.processors.platform.client.ClientRequest; import org.apache.ignite.internal.processors.platform.client.ClientResponse; -import org.apache.ignite.internal.processors.platform.client.ClientStatus; -import org.apache.ignite.internal.processors.platform.client.IgniteClientException; /** * Binary type schema request. @@ -45,11 +43,7 @@ public ClientBinaryTypeGetRequest(BinaryRawReader reader) { /** {@inheritDoc} */ @Override public ClientResponse process(ClientConnectionContext ctx) { - BinaryTypeImpl type = (BinaryTypeImpl)ctx.kernalContext().cacheObjects().binary().type(typeId); - - if (type == null) { - throw new IgniteClientException(ClientStatus.FAILED, "Binary type not found: " + typeId); - } + BinaryTypeImpl type = (BinaryTypeImpl)ctx.kernalContext().cacheObjects().binary().type( typeId); return new ClientBinaryTypeGetResponse(requestId(), type.metadata()); } From 0d1d39099f6cb35ac75b4eb747b79ba537876e08 Mon Sep 17 00:00:00 2001 From: Pavel Tupitsyn Date: Wed, 18 Oct 2017 17:32:10 +0300 Subject: [PATCH 8/8] wip comments --- .../Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs index f74523ee9883d..50c8c275b4fc2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryFullTypeDescriptor.cs @@ -236,6 +236,8 @@ public void UpdateWriteStructure(int pathIdx, IList updat { if (_writerTypeStruct == null) { + // Null struct serves as an indication of a binary type that has never been sent to the cluster, + // which is important for types without any fields. _writerTypeStruct = BinaryStructure.CreateEmpty(); }