public <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, TransportRequestOptions.EMPTY, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public final <T extends TransportResponse> void sendChildRequest(final DiscoveryNode node, final String action, final TransportRequest request, final Task parentTask, final TransportRequestOptions options, final TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendChildRequest(connection, action, request, parentTask, options, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public final <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportRequestOptions options, TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, options, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
/** * Returns a connection to the given node on the provided cluster. If the cluster alias is <code>null</code> the node will be resolved * against the local cluster. * @param clusterAlias the cluster alias the node should be resolve against * @param node the node to resolve * @return a connection to the given node belonging to the cluster with the provided alias. */ Transport.Connection getConnection(String clusterAlias, DiscoveryNode node) { if (clusterAlias == null) { return transportService.getConnection(node); } else { return transportService.getRemoteClusterService().getConnection(node, clusterAlias); } }
public <T extends TransportResponse> TransportFuture<T> submitRequest(DiscoveryNode node, String action, TransportRequest request, TransportRequestOptions options, TransportResponseHandler<T> handler) throws TransportException { PlainTransportFuture<T> futureHandler = new PlainTransportFuture<>(handler); try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, options, futureHandler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler futureHandler.handleException(ex); } return futureHandler; }
/** * Used by {@link TransportSearchAction} to send the expand queries (field collapsing). */ void sendExecuteMultiSearch(final MultiSearchRequest request, SearchTask task, final ActionListener<MultiSearchResponse> listener) { final Transport.Connection connection = transportService.getConnection(transportService.getLocalNode()); transportService.sendChildRequest(connection, MultiSearchAction.NAME, request, task, new ConnectionCountingHandler<>(listener, MultiSearchResponse::new, clientConnections, connection.getNode().getId())); }
@Override protected void doRun() throws Exception { Connection connection = null; if (transportService.nodeConnected(node)) { try { // concurrency can still cause disconnects connection = transportService.getConnection(node); } catch (NodeNotConnectedException e) { logger.trace("[{}] node [{}] just disconnected, will create a temp connection", pingingRound.id(), node); } } if (connection == null) { connection = pingingRound.getOrConnect(node); } logger.trace("[{}] sending to {}", pingingRound.id(), node); transportService.sendRequest(connection, ACTION_NAME, pingRequest, TransportRequestOptions.builder().withTimeout((long) (timeout.millis() * 1.25)).build(), getPingResponseHandler(pingingRound, node)); }
if (nodes.contains(nodeToPing)) { try { pingConnection = transportService.getConnection(nodeToPing); } catch (NodeNotConnectedException e) {
/** * Returns either a real transport connection or a local node connection if we are using the local node optimization. * @throws NodeNotConnectedException if the given node is not connected */ public Transport.Connection getConnection(DiscoveryNode node) { if (isLocalNode(node)) { return localNodeConnection; } else { return transport.getConnection(node); } }
Transport.Connection getConnection() { DiscoveryNode discoveryNode = connectedNodes.get(); return transportService.getConnection(discoveryNode); }
public final <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportRequestOptions options, TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, options, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public final <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportRequestOptions options, TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, options, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public final <T extends TransportResponse> void sendChildRequest(final DiscoveryNode node, final String action, final TransportRequest request, final Task parentTask, final TransportRequestOptions options, final TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendChildRequest(connection, action, request, parentTask, options, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, TransportRequestOptions.EMPTY, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
public void sendExecuteScrollQuery(DiscoveryNode node, final InternalScrollSearchRequest request, SearchTask task, final SearchActionListener<ScrollQuerySearchResult> listener) { transportService.sendChildRequest(transportService.getConnection(node), QUERY_SCROLL_ACTION_NAME, request, task, new ActionListenerResponseHandler<>(listener, ScrollQuerySearchResult::new)); }
public void sendExecuteScrollFetch(DiscoveryNode node, final InternalScrollSearchRequest request, SearchTask task, final SearchActionListener<ScrollQueryFetchSearchResult> listener) { transportService.sendChildRequest(transportService.getConnection(node), QUERY_FETCH_SCROLL_ACTION_NAME, request, task, new ActionListenerResponseHandler<>(listener, ScrollQueryFetchSearchResult::new)); }
public <T extends TransportResponse> void sendRequest(final DiscoveryNode node, final String action, final TransportRequest request, final TransportResponseHandler<T> handler) { try { Transport.Connection connection = getConnection(node); sendRequest(connection, action, request, TransportRequestOptions.EMPTY, handler); } catch (NodeNotConnectedException ex) { // the caller might not handle this so we invoke the handler handler.handleException(ex); } }
/** * Returns a connection to the given node on the provided cluster. If the cluster alias is <code>null</code> the node will be resolved * against the local cluster. * @param clusterAlias the cluster alias the node should be resolve against * @param node the node to resolve * @return a connection to the given node belonging to the cluster with the provided alias. */ Transport.Connection getConnection(String clusterAlias, DiscoveryNode node) { if (clusterAlias == null) { return transportService.getConnection(node); } else { return transportService.getRemoteClusterService().getConnection(node, clusterAlias); } }
/** * Used by {@link TransportSearchAction} to send the expand queries (field collapsing). */ void sendExecuteMultiSearch(final MultiSearchRequest request, SearchTask task, final ActionListener<MultiSearchResponse> listener) { transportService.sendChildRequest(transportService.getConnection(transportService.getLocalNode()), MultiSearchAction.NAME, request, task, new ActionListenerResponseHandler<>(listener, MultiSearchResponse::new)); }
/** * Used by {@link TransportSearchAction} to send the expand queries (field collapsing). */ void sendExecuteMultiSearch(final MultiSearchRequest request, SearchTask task, final ActionListener<MultiSearchResponse> listener) { final Transport.Connection connection = transportService.getConnection(transportService.getLocalNode()); transportService.sendChildRequest(connection, MultiSearchAction.NAME, request, task, new ConnectionCountingHandler<>(listener, MultiSearchResponse::new, clientConnections, connection.getNode().getId())); }