ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/28] ignite git commit: IGNITE-3827: Removed double marshalling of keys in DataStreamerImpl.addData(Map) method.
Date Wed, 07 Sep 2016 09:25:32 GMT
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/7a84ab6a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7a84ab6a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7a84ab6a

Branch: refs/heads/ignite-1.6.7-test
Commit: 7a84ab6a9163ca31fbcfcc6d7ff27e06bf9babef
Parents: fbbcaf4
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Sep 2 18:05:16 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Sep 2 18:05:16 2016 +0300

----------------------------------------------------------------------
 .../datastreamer/DataStreamerImpl.java          | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7a84ab6a/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);
 


Mime
View raw message