ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [25/50] incubator-ignite git commit: # ignite-537
Date Sat, 11 Apr 2015 17:38:48 GMT
# ignite-537


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

Branch: refs/heads/ignite-718
Commit: c85175b7ebaf24c0c1cd3519b4c9889ca7efb071
Parents: 876beff
Author: sboikov <semen.boikov@inria.fr>
Authored: Fri Apr 10 20:43:20 2015 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Fri Apr 10 20:43:20 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c85175b7/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 117166f..d9cec3c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -2328,19 +2328,23 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
     private Map<Integer, byte[]> collectExchangeData(UUID nodeId) throws IgniteSpiException
{
         Map<Integer, Serializable> data = exchange.collect(nodeId);
 
-        Map<Integer, byte[]> data0 = U.newHashMap(data.size());
+        Map<Integer, byte[]> data0 = null;
 
-        for (Map.Entry<Integer, Serializable> entry : data.entrySet()) {
-            try {
-                byte[] bytes = marsh.marshal(entry.getValue());
+        if (data != null) {
+            data0 = U.newHashMap(data.size());
 
-                data0.put(entry.getKey(), bytes);
-            }
-            catch (IgniteCheckedException e) {
-                U.error(log, "Failed to marshal discovery data " +
-                    "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e);
+            for (Map.Entry<Integer, Serializable> entry : data.entrySet()) {
+                try {
+                    byte[] bytes = marsh.marshal(entry.getValue());
 
-                throw new IgniteSpiException("Failed to marshal discovery data.", e);
+                    data0.put(entry.getKey(), bytes);
+                }
+                catch (IgniteCheckedException e) {
+                    U.error(log, "Failed to marshal discovery data " +
+                        "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e);
+
+                    throw new IgniteSpiException("Failed to marshal discovery data.", e);
+                }
             }
         }
 


Mime
View raw message