Package org.elasticsearch.client.node
Class NodeClient
java.lang.Object
org.elasticsearch.client.support.AbstractClient
org.elasticsearch.client.node.NodeClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Client
,ElasticsearchClient
,org.elasticsearch.core.Releasable
Client that executes actions on the local node.
-
Field Summary
Fields inherited from class org.elasticsearch.client.support.AbstractClient
logger, settings
Fields inherited from interface org.elasticsearch.client.Client
CLIENT_TYPE_SETTING_S
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
<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)
The id of the localDiscoveryNode
.getRemoteClusterClient(String clusterAlias)
Returns a client to a remote cluster with the given cluster alias.void
initialize(Map<ActionType,TransportAction> actions, Supplier<String> localNodeId, RemoteClusterService remoteClusterService, NamedWriteableRegistry namedWriteableRegistry)
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
-
NodeClient
-
-
Method Details
-
initialize
public void initialize(Map<ActionType,TransportAction> actions, Supplier<String> localNodeId, RemoteClusterService remoteClusterService, NamedWriteableRegistry namedWriteableRegistry) -
close
public void close() -
doExecute
public <Request extends ActionRequest, Response extends ActionResponse> void doExecute(ActionType<Response> action, Request request, ActionListener<Response> listener)- Specified by:
doExecute
in classAbstractClient
-
executeLocally
public <Request extends ActionRequest, Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, ActionListener<Response> listener)Execute anActionType
locally, returning thatTask
used 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 theClient
interface.- Throws:
TaskCancelledException
- if the request's parent task has been cancelled already
-
executeLocally
public <Request extends ActionRequest, Response extends ActionResponse> Task executeLocally(ActionType<Response> action, Request request, TaskListener<Response> listener)Execute anActionType
locally, returning thatTask
used to track it, and linking anTaskListener
. Prefer this method if you need access to the task when listening for the response.- Throws:
TaskCancelledException
- if the request's parent task has been cancelled already
-
getLocalNodeId
The id of the localDiscoveryNode
. Useful for generating task ids from tasks returned byexecuteLocally(ActionType, ActionRequest, TaskListener)
. -
getRemoteClusterClient
Description copied from interface:Client
Returns a client to a remote cluster with the given cluster alias. -
getNamedWriteableRegistry
-