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/12/09 15:46:44 UTC
[1/2] ignite git commit: IGNITE-2099: Finalization.
Repository: ignite
Updated Branches:
refs/heads/ignite-2099 1c8208e0d -> 22322fa0d
IGNITE-2099: Finalization.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/821953dd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/821953dd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/821953dd
Branch: refs/heads/ignite-2099
Commit: 821953dd30796fd2edada6147761023a134ac8ce
Parents: 1c8208e
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Dec 9 17:34:30 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 9 17:34:30 2015 +0300
----------------------------------------------------------------------
.../portable/builder/PortableBuilderSerializer.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/821953dd/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderSerializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderSerializer.java
index ee35ab2..d5923ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderSerializer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderSerializer.java
@@ -19,14 +19,15 @@ package org.apache.ignite.internal.portable.builder;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.internal.portable.BinaryMetadata;
-import org.apache.ignite.internal.portable.GridPortableMarshaller;
import org.apache.ignite.internal.portable.BinaryObjectExImpl;
+import org.apache.ignite.internal.portable.BinaryWriterExImpl;
+import org.apache.ignite.internal.portable.GridPortableMarshaller;
import org.apache.ignite.internal.portable.PortableContext;
import org.apache.ignite.internal.portable.PortableUtils;
-import org.apache.ignite.internal.portable.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.*;
-import java.util.*;
+import java.util.Collection;
+import java.util.IdentityHashMap;
+import java.util.Map;
/**
*
[2/2] ignite git commit: IGNITE-2099: Finished .NET part.
Posted by vo...@apache.org.
IGNITE-2099: Finished .NET part.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/22322fa0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/22322fa0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/22322fa0
Branch: refs/heads/ignite-2099
Commit: 22322fa0dced1dae4d859f3d3b09dc7027824d96
Parents: 821953d
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Dec 9 17:47:30 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Dec 9 17:47:30 2015 +0300
----------------------------------------------------------------------
.../Impl/Binary/BinaryUtils.cs | 64 +++-----------------
1 file changed, 7 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/22322fa0/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 55e7dfe..1ae5722 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
@@ -19,7 +19,6 @@ namespace Apache.Ignite.Core.Impl.Binary
{
using System;
using System.Collections;
- using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
@@ -196,34 +195,13 @@ namespace Apache.Ignite.Core.Impl.Binary
/** Collection: linked list. */
public const byte CollectionLinkedList = 2;
-
- /** Collection: hash set. */
- public const byte CollectionHashSet = 3;
-
- /** Collection: hash set. */
- public const byte CollectionLinkedHashSet = 4;
-
- /** Collection: sorted set. */
- public const byte CollectionSortedSet = 5;
-
- /** Collection: concurrent bag. */
- public const byte CollectionConcurrentBag = 6;
-
+
/** Map: custom. */
public const byte MapCustom = 0;
/** Map: hash map. */
public const byte MapHashMap = 1;
-
- /** Map: linked hash map. */
- public const byte MapLinkedHashMap = 2;
-
- /** Map: sorted map. */
- public const byte MapSortedMap = 3;
-
- /** Map: concurrent hash map. */
- public const byte MapConcurrentHashMap = 4;
-
+
/** Byte "0". */
public const byte ByteZero = 0;
@@ -1093,10 +1071,6 @@ namespace Apache.Ignite.Core.Impl.Binary
colType = CollectionArrayList;
else if (genType == typeof (LinkedList<>))
colType = CollectionLinkedList;
- else if (genType == typeof (SortedSet<>))
- colType = CollectionSortedSet;
- else if (genType == typeof (ConcurrentBag<>))
- colType = CollectionConcurrentBag;
else
colType = CollectionCustom;
}
@@ -1144,10 +1118,6 @@ namespace Apache.Ignite.Core.Impl.Binary
{
if (colType == CollectionLinkedList)
res = new LinkedList<object>();
- else if (colType == CollectionSortedSet)
- res = new SortedSet<object>();
- else if (colType == CollectionConcurrentBag)
- res = new ConcurrentBag<object>();
else
res = new ArrayList(len);
}
@@ -1178,14 +1148,7 @@ namespace Apache.Ignite.Core.Impl.Binary
{
var genType = valType.GetGenericTypeDefinition();
- if (genType == typeof (Dictionary<,>))
- dictType = MapHashMap;
- else if (genType == typeof (SortedDictionary<,>))
- dictType = MapSortedMap;
- else if (genType == typeof (ConcurrentDictionary<,>))
- dictType = MapConcurrentHashMap;
- else
- dictType = MapCustom;
+ dictType = genType == typeof (Dictionary<,>) ? MapHashMap : MapCustom;
}
else
dictType = valType == typeof (Hashtable) ? MapHashMap : MapCustom;
@@ -1218,29 +1181,16 @@ namespace Apache.Ignite.Core.Impl.Binary
* <param name="factory">Factory delegate.</param>
* <returns>Dictionary.</returns>
*/
- public static IDictionary ReadDictionary(BinaryReader ctx,
- DictionaryFactory factory)
+ public static IDictionary ReadDictionary(BinaryReader ctx, DictionaryFactory factory)
{
IBinaryStream stream = ctx.Stream;
int len = stream.ReadInt();
- byte colType = ctx.Stream.ReadByte();
-
- IDictionary res;
-
- if (factory == null)
- {
- if (colType == MapSortedMap)
- res = new SortedDictionary<object, object>();
- else if (colType == MapConcurrentHashMap)
- res = new ConcurrentDictionary<object, object>(Environment.ProcessorCount, len);
- else
- res = new Hashtable(len);
- }
- else
- res = factory.Invoke(len);
+ // Skip dictionary type as we can do nothing with it here.
+ ctx.Stream.ReadByte();
+ var res = factory == null ? new Hashtable(len) : factory.Invoke(len);
for (int i = 0; i < len; i++)
{