Repository: ignite Updated Branches: refs/heads/ignite-1561-1 84d4dec1f -> 2610fc0b8
IGNITE-3827: Removed double marshalling of keys in DataStreamerImpl.addData(Map) method. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8c56e451 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8c56e451 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8c56e451 Branch: refs/heads/ignite-1561-1 Commit: 8c56e4516e55c7ed9c14779f0e77e00f055d9a81 Parents: 12fd497 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Fri Sep 2 18:05:16 2016 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Fri Sep 2 18:25:49 2016 +0300 ---------------------------------------------------------------------- .../datastreamer/DataStreamerImpl.java | 23 ++++++++------------ 1 file changed, 9 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/8c56e451/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java index e565cba..a3bae24 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java @@ -87,7 +87,6 @@ import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl; import org.apache.ignite.internal.util.lang.GridPeerDeployAware; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; -import org.apache.ignite.internal.util.typedef.C1; import org.apache.ignite.internal.util.typedef.CI1; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.A; @@ -513,23 +512,19 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed activeFuts.add(resFut); - Collection<KeyCacheObject> keys = null; + Collection<KeyCacheObject> keys = + new GridConcurrentHashSet<>(entries.size(), U.capacity(entries.size()), 1); - if (entries.size() > 1) { - keys = new GridConcurrentHashSet<>(entries.size(), U.capacity(entries.size()), 1); + Collection<DataStreamerEntry> entries0 = new ArrayList<>(entries.size()); - for (Map.Entry<K, V> entry : entries) - keys.add(cacheObjProc.toCacheKeyObject(cacheObjCtx, null, entry.getKey(), true)); - } + for (Map.Entry<K, V> entry : entries) { + KeyCacheObject key = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, entry.getKey(), true); + CacheObject val = cacheObjProc.toCacheObject(cacheObjCtx, entry.getValue(), true); - Collection<? extends DataStreamerEntry> entries0 = F.viewReadOnly(entries, new C1<Entry<K, V>, DataStreamerEntry>() { - @Override public DataStreamerEntry apply(Entry<K, V> e) { - KeyCacheObject key = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, e.getKey(), true); - CacheObject val = cacheObjProc.toCacheObject(cacheObjCtx, e.getValue(), true); + keys.add(key); - return new DataStreamerEntry(key, val); - } - }); + entries0.add(new DataStreamerEntry(key, val)); + } load0(entries0, resFut, keys, 0);