Package org.elasticsearch.client.node
Class NodeClient
java.lang.Object
org.elasticsearch.client.support.AbstractClient
org.elasticsearch.client.node.NodeClient
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Client,ElasticsearchClient,Releasable
public class NodeClient extends AbstractClient
Client that executes actions on the local node.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NodeClient(Settings settings, ThreadPool threadPool) -
Method Summary
Modifier and Type Method Description voidclose()<Request extends ActionRequest, Response extends ActionResponse>
voiddoExecute(ActionType<Response> action, Request request, ActionListener<Response> listener)<Request extends ActionRequest, Response extends ActionResponse>
TaskexecuteLocally(ActionType<Response> action, Request request, ActionListener<Response> listener)<Request extends ActionRequest, Response extends ActionResponse>
TaskexecuteLocally(ActionType<Response> action, Request request, TaskListener<Response> listener)SearchTaskexecuteSearchLocally(SearchRequest request, SearchProgressActionListener listener)Execute aSearchRequestlocally and track the progress of the request through aSearchProgressActionListener.java.lang.StringgetLocalNodeId()The id of the localDiscoveryNode.ClientgetRemoteClusterClient(java.lang.String clusterAlias)Returns a client to a remote cluster with the given cluster alias.voidinitialize(java.util.Map<ActionType,TransportAction> actions, TaskManager taskManager, java.util.function.Supplier<java.lang.String> localNodeId, RemoteClusterService remoteClusterService)Methods inherited from class org.elasticsearch.client.support.AbstractClient
admin, bulk, bulk, clearScroll, clearScroll, delete, delete, execute, execute, explain, explain, fieldCaps, fieldCaps, filterWithHeader, get, get, index, index, multiGet, multiGet, multiSearch, multiSearch, multiTermVectors, multiTermVectors, prepareBulk, prepareBulk, prepareClearScroll, prepareDelete, prepareDelete, prepareExplain, prepareFieldCaps, prepareGet, prepareGet, prepareIndex, prepareIndex, prepareIndex, prepareMultiGet, prepareMultiSearch, prepareMultiTermVectors, prepareSearch, prepareSearchScroll, prepareTermVectors, prepareTermVectors, prepareUpdate, prepareUpdate, search, search, searchScroll, searchScroll, settings, termVectors, termVectors, threadPool, update, update
-
Constructor Details
-
Method Details
-
initialize
public void initialize(java.util.Map<ActionType,TransportAction> actions, TaskManager taskManager, java.util.function.Supplier<java.lang.String> localNodeId, RemoteClusterService remoteClusterService) -
close
public void close() -
doExecute
public <Request extends ActionRequest, Response extends ActionResponse> void doExecute(ActionType<Response> action, Request request, ActionListener<Response> listener)- Specified by:
doExecutein classAbstractClient
-
executeLocally
public <Request extends ActionRequest, Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, ActionListener<Response> listener)Execute anActionTypelocally, returning thatTaskused to track it, and linking anActionListener. Prefer this method if you don't need access to the task when listening for the response. This is the method used to implement theClientinterface. -
executeLocally
public <Request extends ActionRequest, Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, TaskListener<Response> listener)Execute anActionTypelocally, returning thatTaskused to track it, and linking anTaskListener. Prefer this method if you need access to the task when listening for the response. -
executeSearchLocally
public SearchTask executeSearchLocally(SearchRequest request, SearchProgressActionListener listener)Execute aSearchRequestlocally and track the progress of the request through aSearchProgressActionListener. -
getLocalNodeId
public java.lang.String getLocalNodeId()The id of the localDiscoveryNode. Useful for generating task ids from tasks returned byexecuteLocally(ActionType, ActionRequest, TaskListener). -
getRemoteClusterClient
Description copied from interface:ClientReturns a client to a remote cluster with the given cluster alias.
-