@Override public void sendRequest(long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException { proxyConnection.sendRequest(requestId, TransportActionProxy.getProxyAction(action), TransportActionProxy.wrapRequest(targetNode, request), options); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type is always the same (most of the cases). */ public static void registerProxyAction(TransportService service, String action, Writeable.Reader<? extends TransportResponse> reader) { RequestHandlerRegistry<? extends TransportRequest> requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), ThreadPool.Names.SAME, true, false, in -> new ProxyRequest<>(in, requestHandler::newRequest), new ProxyRequestHandler<>(service, action, request -> reader)); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type changes based on the upcoming request (quite rare) */ public static void registerProxyActionWithDynamicResponseType(TransportService service, String action, Function<TransportRequest, Writeable.Reader<? extends TransportResponse>> responseFunction) { RequestHandlerRegistry<? extends TransportRequest> requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), ThreadPool.Names.SAME, true, false, in -> new ProxyRequest<>(in, requestHandler::newRequest), new ProxyRequestHandler<>(service, action, responseFunction)); }
@Override public void sendRequest(long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException { proxyConnection.sendRequest(requestId, TransportActionProxy.getProxyAction(action), TransportActionProxy.wrapRequest(targetNode, request), options); }
@Override public void sendRequest(long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException { proxyConnection.sendRequest(requestId, TransportActionProxy.getProxyAction(action), TransportActionProxy.wrapRequest(targetNode, request), options); }
@Override public void sendRequest(long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException { connection.sendRequest(requestId, TransportActionProxy.getProxyAction(action), TransportActionProxy.wrapRequest(remoteClusterNode, request), options); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. */ public static void registerProxyAction(TransportService service, String action, Supplier<TransportResponse> responseSupplier) { RequestHandlerRegistry requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), () -> new ProxyRequest(requestHandler::newRequest), ThreadPool.Names.SAME, true, false, new ProxyRequestHandler<>(service, action, responseSupplier)); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type is always the same (most of the cases). */ public static void registerProxyAction(TransportService service, String action, Supplier<TransportResponse> responseSupplier) { RequestHandlerRegistry requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), () -> new ProxyRequest(requestHandler::newRequest), ThreadPool.Names.SAME, true, false, new ProxyRequestHandler<>(service, action, request -> responseSupplier)); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type changes based on the upcoming request (quite rare) */ public static void registerProxyAction(TransportService service, String action, Function<TransportRequest, Supplier<TransportResponse>> responseFunction) { RequestHandlerRegistry requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), () -> new ProxyRequest(requestHandler::newRequest), ThreadPool.Names.SAME, true, false, new ProxyRequestHandler<>(service, action, responseFunction)); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type changes based on the upcoming request (quite rare) */ public static void registerProxyAction(TransportService service, String action, Function<TransportRequest, Supplier<TransportResponse>> responseFunction) { RequestHandlerRegistry requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), () -> new ProxyRequest(requestHandler::newRequest), ThreadPool.Names.SAME, true, false, new ProxyRequestHandler<>(service, action, responseFunction)); }
/** * Registers a proxy request handler that allows to forward requests for the given action to another node. To be used when the * response type is always the same (most of the cases). */ public static void registerProxyAction(TransportService service, String action, Supplier<TransportResponse> responseSupplier) { RequestHandlerRegistry requestHandler = service.getRequestHandler(action); service.registerRequestHandler(getProxyAction(action), () -> new ProxyRequest(requestHandler::newRequest), ThreadPool.Names.SAME, true, false, new ProxyRequestHandler<>(service, action, request -> responseSupplier)); }