Transport.Connection getConnection() { return connectionManager.getConnection(getAnyConnectedNode()); }
private void fetchShardsInternal(ClusterSearchShardsRequest searchShardsRequest, final ActionListener<ClusterSearchShardsResponse> listener) { final DiscoveryNode node = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(node); transportService.sendRequest(connection, ClusterSearchShardsAction.NAME, searchShardsRequest, TransportRequestOptions.EMPTY, new TransportResponseHandler<ClusterSearchShardsResponse>() { @Override public ClusterSearchShardsResponse read(StreamInput in) throws IOException { return new ClusterSearchShardsResponse(in); } @Override public void handleResponse(ClusterSearchShardsResponse clusterSearchShardsResponse) { listener.onResponse(clusterSearchShardsResponse); } @Override public void handleException(TransportException e) { listener.onFailure(e); } @Override public String executor() { return ThreadPool.Names.SEARCH; } }); }
/** * Returns a connection to the remote cluster, preferably a direct connection to the provided {@link DiscoveryNode}. * If such node is not connected, the returned connection will be a proxy connection that redirects to it. */ Transport.Connection getConnection(DiscoveryNode remoteClusterNode) { if (connectionManager.nodeConnected(remoteClusterNode)) { return connectionManager.getConnection(remoteClusterNode); } DiscoveryNode discoveryNode = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(discoveryNode); return new ProxyConnection(connection, remoteClusterNode); }
request.nodes(true); request.local(true); // run this on the node that gets the request it's as good as any other final DiscoveryNode node = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(node); transportService.sendRequest(connection, ClusterStateAction.NAME, request, TransportRequestOptions.EMPTY,
Transport.Connection getConnection() { return connectionManager.getConnection(getAnyConnectedNode()); }
Transport.Connection getConnection() { return transportService.getConnection(getAnyConnectedNode()); }
private void fetchShardsInternal(ClusterSearchShardsRequest searchShardsRequest, final ActionListener<ClusterSearchShardsResponse> listener) { final DiscoveryNode node = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(node); transportService.sendRequest(connection, ClusterSearchShardsAction.NAME, searchShardsRequest, TransportRequestOptions.EMPTY, new TransportResponseHandler<ClusterSearchShardsResponse>() { @Override public ClusterSearchShardsResponse newInstance() { return new ClusterSearchShardsResponse(); } @Override public void handleResponse(ClusterSearchShardsResponse clusterSearchShardsResponse) { listener.onResponse(clusterSearchShardsResponse); } @Override public void handleException(TransportException e) { listener.onFailure(e); } @Override public String executor() { return ThreadPool.Names.SEARCH; } }); }
/** * Returns a connection to the remote cluster, preferably a direct connection to the provided {@link DiscoveryNode}. * If such node is not connected, the returned connection will be a proxy connection that redirects to it. */ Transport.Connection getConnection(DiscoveryNode remoteClusterNode) { if (connectionManager.nodeConnected(remoteClusterNode)) { return connectionManager.getConnection(remoteClusterNode); } DiscoveryNode discoveryNode = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(discoveryNode); return new ProxyConnection(connection, remoteClusterNode); }
request.nodes(true); request.local(true); // run this on the node that gets the request it's as good as any other final DiscoveryNode node = getAnyConnectedNode(); Transport.Connection connection = connectionManager.getConnection(node); transportService.sendRequest(connection, ClusterStateAction.NAME, request, TransportRequestOptions.EMPTY,