Repository: ignite Updated Branches: refs/heads/ignite-4003-1 ad5b5a168 -> 0c13c3e68
ignite-4003 Changes in GridNioServer for async connect Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0c13c3e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0c13c3e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0c13c3e6 Branch: refs/heads/ignite-4003-1 Commit: 0c13c3e68c8e51f74c63a16383d7918750603179 Parents: ad5b5a1 Author: sboikov <[email protected]> Authored: Thu Aug 24 16:29:06 2017 +0300 Committer: sboikov <[email protected]> Committed: Thu Aug 24 16:29:06 2017 +0300 ---------------------------------------------------------------------- .../communication/tcp/TcpCommunicationSpi.java | 25 ++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/0c13c3e6/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 0e712ae..7a54666 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -2980,14 +2980,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati } /** - * Establish TCP connection to remote node and returns client. - * - * @param node Remote node. - * @param connIdx Connection index. - * @return Client. - * @throws IgniteCheckedException If failed. + * @param node Node. + * @return Node addresses. + * @throws IgniteCheckedException If node does not have addresses. */ - protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) throws IgniteCheckedException { + private LinkedHashSet<InetSocketAddress> nodeAddresses(ClusterNode node) throws IgniteCheckedException { Collection<String> rmtAddrs0 = node.attribute(createSpiAttributeName(ATTR_ADDRS)); Collection<String> rmtHostNames0 = node.attribute(createSpiAttributeName(ATTR_HOST_NAMES)); Integer boundPort = node.attribute(createSpiAttributeName(ATTR_PORT)); @@ -3052,6 +3049,20 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati log.debug("Addresses to connect for node [rmtNode=" + node.id() + ", addrs=" + addrs.toString() + ']'); } + return addrs; + } + + /** + * Establish TCP connection to remote node and returns client. + * + * @param node Remote node. + * @param connIdx Connection index. + * @return Client. + * @throws IgniteCheckedException If failed. + */ + protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) throws IgniteCheckedException { + LinkedHashSet<InetSocketAddress> addrs = nodeAddresses(node); + boolean conn = false; GridCommunicationClient client = null; IgniteCheckedException errs = null;
