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 2016/09/09 09:43:20 UTC

ignite git commit: Refactoring data exchange

Repository: ignite
Updated Branches:
  refs/heads/ignite-3199-1 ee1d85cc8 -> a7ff62424


Refactoring data exchange


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

Branch: refs/heads/ignite-3199-1
Commit: a7ff62424e2eacfcf7929a25dff2e6552637c239
Parents: ee1d85c
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Sep 9 12:43:09 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Sep 9 12:43:09 2016 +0300

----------------------------------------------------------------------
 .../platform/cache/PlatformCacheInvoker.java    |   2 +-
 .../websession/PlatformDotnetSessionData.java   |  26 ++-
 .../IgniteSessionStateStoreProvider.cs          |  41 +++--
 .../Apache.Ignite.Core.Tests.csproj             |   1 -
 .../AspNet/SessionStateLockInfoTest.cs          |  64 -------
 .../Apache.Ignite.Core.csproj                   |   1 -
 .../Impl/AspNet/SessionStateData.cs             |   6 +-
 .../Impl/AspNet/SessionStateLockInfo.cs         | 166 -------------------
 .../Impl/Binary/Marshaller.cs                   |  10 +-
 9 files changed, 61 insertions(+), 256 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheInvoker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheInvoker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheInvoker.java
index df56991..74b7983 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheInvoker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheInvoker.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.platform.cache;
 
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.binary.BinaryRawReader;
-import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.processors.platform.websession.PlatformDotnetSessionData;
 import org.apache.ignite.internal.processors.platform.websession.PlatformDotnetSessionLockProcessor;
 import org.apache.ignite.internal.processors.platform.websession.PlatformDotnetSessionSetAndUnlockProcessor;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
index d198ebf..85ceec8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
@@ -103,6 +103,24 @@ public class PlatformDotnetSessionData implements Binarylizable {
         return lockTime != null;
     }
 
+    /**
+     * Ctor.
+     *
+     * @param timeout Timeout.
+     */
+    public PlatformDotnetSessionData(int timeout) {
+        this.timeout = timeout;
+    }
+
+    /**
+     * Locks the session state data.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     * @param lockTime Lock time.
+     *
+     * @return Unlocked data copy.
+     */
     public PlatformDotnetSessionData lock(UUID lockNodeId, long lockId, Timestamp lockTime) {
         assert !isLocked();
 
@@ -116,11 +134,12 @@ public class PlatformDotnetSessionData implements Binarylizable {
     }
 
     /**
-     * Unlock session state data.
+     * Unlocks the session state data.
      *
      * @param lockNodeId Lock node ID.
      * @param lockId Lock ID.
-     * @return Unlocked data.
+     *
+     * @return Unlocked data copy.
      */
     public PlatformDotnetSessionData unlock(UUID lockNodeId, long lockId) {
         assert isLocked();
@@ -177,11 +196,10 @@ public class PlatformDotnetSessionData implements Binarylizable {
      * @return Copied state data.
      */
     private PlatformDotnetSessionData copyWithoutLockInfo() {
-        PlatformDotnetSessionData res = new PlatformDotnetSessionData();
+        PlatformDotnetSessionData res = new PlatformDotnetSessionData(timeout);
 
         res.staticObjects = staticObjects;
         res.items = items;
-        res.timeout = timeout;
 
         return res;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
index 1b559f9..1b85fd9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
@@ -26,6 +26,7 @@ namespace Apache.Ignite.AspNet
     using System.Web.SessionState;
     using Apache.Ignite.AspNet.Impl;
     using Apache.Ignite.Core;
+    using Apache.Ignite.Core.Binary;
     using Apache.Ignite.Core.Cache;
     using Apache.Ignite.Core.Impl.AspNet;
     using Apache.Ignite.Core.Impl.Cache;
@@ -49,11 +50,11 @@ namespace Apache.Ignite.AspNet
         /// <summary>
         /// Op codes.
         /// </summary>
-        private enum Op
+        private enum Op   // TODO: Move this to core to maintain a single list of codes.
         {
             Lock = 1,
             Unlock = 2,
-            SetAndUnlock = 3
+            SetAndUnlock = 3,
         }
 
         /** Application id config parameter. */
@@ -357,9 +358,17 @@ namespace Apache.Ignite.AspNet
 
             var cache = _expiryCacheHolder.GetCacheWithExpiry((long) timeout * 60);
 
-            var data = new SessionStateData {Timeout =  timeout};
+            var key = GetKey(id);
+
+            var data = new SessionStateData { Timeout = timeout };
+
+            cache[key] = data;
 
-            cache[GetKey(id)] = data;
+            //((ICacheInternal) cache).Invoke<object>((int) Op.CreateEmpty, w =>
+            //{
+            //    w.WriteString(key);
+            //    w.WriteInt(timeout);
+            //});
         }
 
         /// <summary>
@@ -396,11 +405,15 @@ namespace Apache.Ignite.AspNet
         }
 
         /// <summary>
-        /// Gets the lock info.
+        /// Writes the lock info.
         /// </summary>
-        private SessionStateLockInfo GetLockInfo(long lockId)
+        private void WriteLockInfo(IBinaryRawWriter writer, long lockId, bool writeTime = false)
         {
-            return new SessionStateLockInfo(lockId, Cache.Ignite.GetCluster().GetLocalNode().Id, DateTime.UtcNow);
+            writer.WriteGuid(Cache.Ignite.GetCluster().GetLocalNode().Id);
+            writer.WriteLong(lockId);
+
+            if (writeTime)
+                writer.WriteTimestamp(DateTime.UtcNow);
         }
 
         /// <summary>
@@ -437,7 +450,7 @@ namespace Apache.Ignite.AspNet
             return ((ICacheInternal) Cache).Invoke<SessionStateLockResult>((int) Op.Lock, w =>
             {
                 w.WriteString(key);
-                w.WriteObject(GetLockInfo(lockId));
+                WriteLockInfo(w, lockId, true);
             });
         }
 
@@ -448,8 +461,9 @@ namespace Apache.Ignite.AspNet
         {
             ((ICacheInternal) Cache).Invoke<object>((int) Op.Unlock, w =>
             {
+                WriteLockInfo(w, lockId);
+                w.WriteBoolean(false);  // Only unlock.
                 w.WriteString(key);
-                w.WriteObject(GetLockInfo(lockId));
             });
         }
 
@@ -464,8 +478,15 @@ namespace Apache.Ignite.AspNet
 
             ((ICacheInternal) cache).Invoke<object>((int) Op.SetAndUnlock, w =>
             {
+                WriteLockInfo(w, data.LockId);
+                w.WriteBoolean(true);  // Unlock and update.
                 w.WriteString(key);
-                w.WriteObject(data);
+
+                // TODO: Refactor
+                data.Items.WriteBinary((IBinaryWriter) w);
+
+                w.WriteByteArray(data.StaticObjects);
+                w.WriteInt(data.Timeout);
             });
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 79d939d..d74fdf4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -64,7 +64,6 @@
     <Compile Include="AspNet\IgniteSessionStateItemCollectionTest.cs" />
     <Compile Include="AspNet\IgniteSessionStateStoreDataTest.cs" />
     <Compile Include="AspNet\IgniteSessionStateStoreProviderTest.cs" />
-    <Compile Include="AspNet\SessionStateLockInfoTest.cs" />
     <Compile Include="Binary\BinaryReaderWriterTest.cs" />
     <Compile Include="Binary\IO\BinaryStreamsTest.cs" />
     <Compile Include="Binary\JavaTypeMappingTest.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/SessionStateLockInfoTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/SessionStateLockInfoTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/SessionStateLockInfoTest.cs
deleted file mode 100644
index 161f32b..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/SessionStateLockInfoTest.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-\ufeff/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Apache.Ignite.Core.Tests.AspNet
-{
-    using System;
-    using Apache.Ignite.Core.Impl.AspNet;
-    using NUnit.Framework;
-
-    /// <summary>
-    /// Tests for <see cref="SessionStateLockInfo"/>.
-    /// </summary>
-    public class SessionStateLockInfoTest
-    {
-        /// <summary>
-        /// Tests the equality.
-        /// </summary>
-        [Test]
-        public void TestEquality()
-        {
-            var lock1 = new SessionStateLockInfo(1, Guid.NewGuid(), DateTime.UtcNow);
-            var lock2 = new SessionStateLockInfo(2, Guid.NewGuid(), DateTime.UtcNow.AddDays(1));
-            var lock3 = new SessionStateLockInfo(lock1.LockId, lock1.LockNodeId, lock1.LockTime);
-
-            Assert.AreEqual(lock1, lock3);
-            Assert.AreEqual(lock1.GetHashCode(), lock3.GetHashCode());
-
-            Assert.IsTrue(lock1 == lock3);
-            Assert.IsFalse(lock1 != lock3);
-
-            Assert.AreNotEqual(lock1, lock2);
-            Assert.AreNotEqual(lock1.GetHashCode(), lock2.GetHashCode());
-
-            Assert.IsFalse(lock1 == lock2);
-            Assert.IsTrue(lock1 != lock2);
-        }
-
-        /// <summary>
-        /// Tests the serialization.
-        /// </summary>
-        [Test]
-        public void TestSerialization()
-        {
-            var lock1 = new SessionStateLockInfo(2, Guid.NewGuid(), DateTime.UtcNow.AddDays(1));
-            var lock2 = TestUtils.SerializeDeserialize(lock1);
-
-            Assert.AreEqual(lock1, lock2);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index f546c21..4be28ac 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -92,7 +92,6 @@
     <Compile Include="Discovery\Tcp\Static\Package-Info.cs" />
     <Compile Include="Impl\AspNet\SessionStateData.cs" />
     <Compile Include="Impl\AspNet\SessionStateLockResult.cs" />
-    <Compile Include="Impl\AspNet\SessionStateLockInfo.cs" />
     <Compile Include="Impl\Binary\BinaryReflectiveSerializerInternal.cs" />
     <Compile Include="Impl\Binary\IBinarySerializerInternal.cs" />
     <Compile Include="Binary\Package-Info.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateData.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateData.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateData.cs
index da4d96b..761f1cb 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateData.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateData.cs
@@ -35,13 +35,13 @@ namespace Apache.Ignite.Core.Impl.AspNet
         /// Initializes a new instance of the <see cref="SessionStateData"/> class.
         /// </summary>
         /// <param name="reader">The reader.</param>
-        internal SessionStateData(IBinaryRawReader reader)
+        internal SessionStateData(BinaryReader reader)
         {
             Timeout = reader.ReadInt();
             LockNodeId = reader.ReadGuid();
             LockId = reader.ReadLong();
             LockTime = reader.ReadTimestamp();
-            _items = reader.ReadObject<KeyValueDirtyTrackedCollection>();
+            _items = new KeyValueDirtyTrackedCollection(reader);
             StaticObjects = reader.ReadByteArray();
         }
 
@@ -98,7 +98,7 @@ namespace Apache.Ignite.Core.Impl.AspNet
             raw.WriteGuid(LockNodeId);
             raw.WriteLong(LockId);
             raw.WriteTimestamp(LockTime);
-            raw.WriteObject(Items);
+            Items.WriteBinary(writer);
             raw.WriteByteArray(StaticObjects);
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockInfo.cs
deleted file mode 100644
index 194c0db..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockInfo.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-\ufeff/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Apache.Ignite.Core.Impl.AspNet
-{
-    using System;
-    using System.Diagnostics;
-    using Apache.Ignite.Core.Binary;
-    using Apache.Ignite.Core.Impl.Binary;
-    
-    /// <summary>
-    /// Lock info.
-    /// </summary>
-    public struct SessionStateLockInfo : IBinaryWriteAware, IEquatable<SessionStateLockInfo>
-    {
-        /** */
-        private readonly long _lockId;
-        
-        /** */
-        private readonly Guid _lockNodeId;
-
-        /** */
-        private readonly DateTime _lockTime;
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="SessionStateLockInfo"/> struct.
-        /// </summary>
-        /// <param name="lockId">The lock identifier.</param>
-        /// <param name="lockNodeId">The lock node identifier.</param>
-        /// <param name="lockTime">The lock time.</param>
-        public SessionStateLockInfo(long lockId, Guid lockNodeId, DateTime lockTime)
-        {
-            _lockId = lockId;
-            _lockNodeId = lockNodeId;
-            _lockTime = lockTime;
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="SessionStateLockInfo"/> struct.
-        /// </summary>
-        /// <param name="reader">The reader.</param>
-        public SessionStateLockInfo(IBinaryRawReader reader)
-        {
-            _lockId = reader.ReadLong();
-
-            var guid = reader.ReadGuid();
-            Debug.Assert(guid != null);
-            _lockNodeId = guid.Value;
-
-            var time = reader.ReadTimestamp();
-            Debug.Assert(time != null);
-            _lockTime = time.Value;
-        }
-
-        /// <summary>
-        /// Gets or sets the lock node id. Null means not locked.
-        /// </summary>
-        public Guid LockNodeId
-        {
-            get { return _lockNodeId; }
-        }
-
-        /// <summary>
-        /// Gets or sets the lock id.
-        /// </summary>
-        public long LockId
-        {
-            get { return _lockId; }
-        }
-
-        /// <summary>
-        /// Gets or sets the lock time.
-        /// </summary>
-        public DateTime LockTime
-        {
-            get { return _lockTime; }
-        }
-
-        /// <summary>
-        /// Writes this object to the given writer.
-        /// </summary>
-        /// <param name="writer">Writer.</param>
-        public void WriteBinary(IBinaryWriter writer)
-        {
-            var raw = writer.GetRawWriter();
-
-            raw.WriteLong(_lockId);
-            raw.WriteGuid(_lockNodeId);
-            raw.WriteTimestamp(_lockTime);
-        }
-
-        /// <summary>
-        /// Indicates whether the current object is equal to another object of the same type.
-        /// </summary>
-        /// <param name="other">An object to compare with this object.</param>
-        /// <returns>
-        /// true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
-        /// </returns>
-        public bool Equals(SessionStateLockInfo other)
-        {
-            return _lockTime.Equals(other._lockTime) && _lockId == other._lockId 
-                && _lockNodeId.Equals(other._lockNodeId);
-        }
-
-        /// <summary>
-        /// Determines whether the specified <see cref="object" />, is equal to this instance.
-        /// </summary>
-        /// <param name="obj">The <see cref="object" /> to compare with this instance.</param>
-        /// <returns>
-        /// <c>true</c> if the specified <see cref="object" /> is equal to this instance; otherwise, <c>false</c>.
-        /// </returns>
-        public override bool Equals(object obj)
-        {
-            if (ReferenceEquals(null, obj)) return false;
-            return obj is SessionStateLockInfo && Equals((SessionStateLockInfo) obj);
-        }
-
-        /// <summary>
-        /// Returns a hash code for this instance.
-        /// </summary>
-        /// <returns>
-        /// A hash code for this instance, suitable for use in hashing algorithms 
-        /// and data structures like a hash table. 
-        /// </returns>
-        public override int GetHashCode()
-        {
-            unchecked
-            {
-                var hashCode = _lockTime.GetHashCode();
-                hashCode = (hashCode*397) ^ _lockId.GetHashCode();
-                hashCode = (hashCode*397) ^ _lockNodeId.GetHashCode();
-                return hashCode;
-            }
-        }
-
-        /// <summary>
-        /// Implements the operator ==.
-        /// </summary>
-        public static bool operator ==(SessionStateLockInfo left, SessionStateLockInfo right)
-        {
-            return left.Equals(right);
-        }
-
-        /// <summary>
-        /// Implements the operator !=.
-        /// </summary>
-        public static bool operator !=(SessionStateLockInfo left, SessionStateLockInfo right)
-        {
-            return !left.Equals(right);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7ff6242/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 03dbe2f..e3b9cea 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@ -557,7 +557,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// Adds a predefined system type.
         /// </summary>
         private void AddSystemType<T>(int typeId, Func<BinaryReader, T> ctor, string affKeyFldName = null, 
-            IBinarySerializerInternal serializer = null)
+            IBinarySerializerInternal serializer = null, string typeNameOverride = null)
             where T : IBinaryWriteAware
         {
             var type = typeof(T);
@@ -565,7 +565,7 @@ namespace Apache.Ignite.Core.Impl.Binary
             serializer = serializer ?? new BinarySystemTypeSerializer<T>(ctor);
 
             if (typeId == 0)
-                typeId = BinaryUtils.TypeId(type.Name, null, null);
+                typeId = BinaryUtils.TypeId(typeNameOverride ?? type.Name, null, null);
 
             AddType(type, typeId, BinaryUtils.GetTypeName(type), false, false, null, null, serializer, affKeyFldName,
                 false);
@@ -596,10 +596,8 @@ 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(0, r => new KeyValueDirtyTrackedCollection(r));
-            AddSystemType(0, r => new SessionStateData(r));
-            AddSystemType(0, r => new SessionStateLockInfo(r));
-            AddSystemType(0, r => new SessionStateLockResult(r));
+            AddSystemType(0, r => new SessionStateData(r), "PlatformDotnetSessionData");
+            AddSystemType(0, r => new SessionStateLockResult(r), "PlatformDotnetSessionLockResult");
         }
     }
 }