本文整理了Java中org.elasticsearch.transport.TransportService.getRequestHandler()
方法的一些代码示例,展示了TransportService.getRequestHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TransportService.getRequestHandler()
方法的具体详情如下:
包路径:org.elasticsearch.transport.TransportService
类名称:TransportService
方法名:getRequestHandler
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
protected void doStart() {
assert this.updateSnapshotStatusHandler != null;
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME) != null;
if (DiscoveryNode.isMasterNode(settings)) {
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6) != null;
}
}
代码示例来源:origin: org.elasticsearch/elasticsearch
/**
* 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));
}
代码示例来源:origin: org.elasticsearch/elasticsearch
/**
* 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));
}
代码示例来源:origin: org.elasticsearch/elasticsearch
onRequestSent(localNode, requestId, action, request, options);
onRequestReceived(requestId, action);
final RequestHandlerRegistry reg = getRequestHandler(action);
if (reg == null) {
throw new ActionNotFoundTransportException("Action [" + action + "] not found");
代码示例来源:origin: apache/servicemix-bundles
@Override
protected void doStart() {
assert this.updateSnapshotStatusHandler != null;
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME) != null;
if (DiscoveryNode.isMasterNode(settings)) {
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6) != null;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
protected void doStart() {
assert this.updateSnapshotStatusHandler != null;
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME) != null;
if (DiscoveryNode.isMasterNode(settings)) {
assert transportService.getRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6) != null;
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
/**
* 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));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
/**
* 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));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
/**
* 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));
}
代码示例来源:origin: apache/servicemix-bundles
/**
* 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));
}
代码示例来源:origin: apache/servicemix-bundles
/**
* 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));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
onRequestSent(localNode, requestId, action, request, options);
onRequestReceived(requestId, action);
final RequestHandlerRegistry reg = getRequestHandler(action);
if (reg == null) {
throw new ActionNotFoundTransportException("Action [" + action + "] not found");
内容来源于网络,如有侵权,请联系作者删除!