Repository: incubator-ignite Updated Branches: refs/heads/ignite-709_2 5a983ffc7 -> defc8b0d6
# IGNITE-709 Collect discovery data from client on client join topology. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/defc8b0d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/defc8b0d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/defc8b0d Branch: refs/heads/ignite-709_2 Commit: defc8b0d62d17b009a7087931a049f314bf4b914 Parents: 5a983ff Author: sevdokimov <sevdoki...@gridgain.com> Authored: Fri May 15 20:24:55 2015 +0300 Committer: sevdokimov <sevdoki...@gridgain.com> Committed: Fri May 15 20:24:55 2015 +0300 ---------------------------------------------------------------------- .../discovery/tcp/TcpClientDiscoverySpi.java | 2 +- .../spi/discovery/tcp/TcpDiscoverySpi.java | 28 -------------------- .../discovery/tcp/TcpDiscoverySpiAdapter.java | 27 +++++++++++++++++++ 3 files changed, 28 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/defc8b0d/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java index e9ddbfd..bd7528a 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java @@ -532,7 +532,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp TcpDiscoveryAbstractMessage msg = recon ? new TcpDiscoveryClientReconnectMessage(getLocalNodeId(), rmtNodeId, lastMsgId) : - new TcpDiscoveryJoinRequestMessage(locNode, null); + new TcpDiscoveryJoinRequestMessage(locNode, collectExchangeData(getLocalNodeId())); msg.client(true); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/defc8b0d/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 170670f..bd9d572 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 @@ -2235,34 +2235,6 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov } /** - * @param nodeId Node ID. - * @return Marshalled exchange data. - */ - private Map<Integer, byte[]> collectExchangeData(UUID nodeId) { - Map<Integer, Serializable> data = exchange.collect(nodeId); - - Map<Integer, byte[]> data0 = null; - - if (data != null) { - data0 = U.newHashMap(data.size()); - - for (Map.Entry<Integer, Serializable> entry : data.entrySet()) { - try { - byte[] bytes = marsh.marshal(entry.getValue()); - - data0.put(entry.getKey(), bytes); - } - catch (IgniteCheckedException e) { - U.error(log, "Failed to marshal discovery data " + - "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e); - } - } - } - - return data0; - } - - /** * @param msg Message. * @param nodeId Node ID. */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/defc8b0d/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java index 181065d..1b22aaa 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java @@ -782,6 +782,33 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov } /** + * @param nodeId Node ID. + * @return Marshalled exchange data. + */ + protected Map<Integer, byte[]> collectExchangeData(UUID nodeId) { + Map<Integer, Serializable> data = exchange.collect(nodeId); + + if (data == null) + return null; + + Map<Integer, byte[]> data0 = U.newHashMap(data.size()); + + for (Map.Entry<Integer, Serializable> entry : data.entrySet()) { + try { + byte[] bytes = marsh.marshal(entry.getValue()); + + data0.put(entry.getKey(), bytes); + } + catch (IgniteCheckedException e) { + U.error(log, "Failed to marshal discovery data " + + "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e); + } + } + + return data0; + } + + /** * @param joiningNodeID Joining node ID. * @param nodeId Remote node ID for which data is provided. * @param data Collection of marshalled discovery data objects from different components.