You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/11/02 14:18:47 UTC

[1/2] ignite git commit: wip

Repository: ignite
Updated Branches:
  refs/heads/ignite-1282 48b775d1f -> a96af3c45


wip


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

Branch: refs/heads/ignite-1282
Commit: 9f4739b7c0937328679fef60585dbe0998e645c2
Parents: 48b775d
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Mon Nov 2 16:11:27 2015 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Mon Nov 2 16:11:27 2015 +0300

----------------------------------------------------------------------
 .../Impl/Portable/PortableObjectSchemaField.cs              | 4 ++--
 .../Impl/Portable/PortableObjectSchemaHolder.cs             | 9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9f4739b7/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaField.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaField.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaField.cs
index b8ed62f..36bbf39 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaField.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaField.cs
@@ -63,9 +63,9 @@ namespace Apache.Ignite.Core.Impl.Portable
 
             if (BitConverter.IsLittleEndian)
             {
-                fixed (PortableObjectSchemaField* ptr = &fields[0])
+                fixed (PortableObjectSchemaField* ptr = &fields[start])
                 {
-                    stream.Write((byte*) ptr + start * Size, count * Size);
+                    stream.Write((byte*) ptr, count * Size);
                 }
             }
             else

http://git-wip-us.apache.org/repos/asf/ignite/blob/9f4739b7/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaHolder.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaHolder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaHolder.cs
index f577458..d909efa 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaHolder.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableObjectSchemaHolder.cs
@@ -79,15 +79,14 @@ namespace Apache.Ignite.Core.Impl.Portable
         /// <returns>True if current schema was non empty; false otherwise.</returns>
         public bool WriteAndPop(IPortableStream stream, out int schemaId)
         {
-            var count = _offsets.Pop();
+            var offset = _offsets.Pop();
+            var count = _idx - offset;
 
             if (count > 0)
             {
-                var startIdx = _idx - count;
+                PortableObjectSchemaField.WriteArray(_fields, stream, offset, count);
 
-                PortableObjectSchemaField.WriteArray(_fields, stream, startIdx, count);
-
-                schemaId = PortableUtils.GetSchemaId(_fields, startIdx, count);
+                schemaId = PortableUtils.GetSchemaId(_fields, offset, count);
 
                 _idx -= count;
 


[2/2] ignite git commit: Fix bug

Posted by vo...@apache.org.
Fix bug


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

Branch: refs/heads/ignite-1282
Commit: a96af3c4526e7cea60a5b8f7fdb1d093b36d5456
Parents: 9f4739b
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Mon Nov 2 16:14:33 2015 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Mon Nov 2 16:14:33 2015 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a96af3c4/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs
index a4ddc51..069555f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableWriterImpl.cs
@@ -1084,10 +1084,13 @@ namespace Apache.Ignite.Core.Impl.Portable
                 desc.Serializer.WritePortable(obj, this);
 
                 // Write schema
+                var schemaOffset = _stream.Position - pos;
+
                 int schemaId;
                 var hasSchema = PortableObjectSchemaHolder.Current.WriteAndPop(_stream, out schemaId);
 
-                var schemaOffset = hasSchema ? _stream.Position - pos : PortableObjectHeader.Size;
+                if (!hasSchema)
+                    schemaOffset = PortableObjectHeader.Size;
 
                 // Calculate and write header.
                 if (hasSchema && _curRawPos > 0)