Class TransportMasterNodeAction<Request extends MasterNodeRequest<Request>,Response extends ActionResponse>
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- org.elasticsearch.action.support.HandledTransportAction<Request,Response>
-
- org.elasticsearch.action.support.master.TransportMasterNodeAction<Request,Response>
-
- Direct Known Subclasses:
CompletionPersistentTaskAction.TransportAction
,DeletePipelineTransportAction
,PutPipelineTransportAction
,RemovePersistentTaskAction.TransportAction
,StartPersistentTaskAction.TransportAction
,TransportCloseIndexAction
,TransportClusterAllocationExplainAction
,TransportClusterRerouteAction
,TransportClusterUpdateSettingsAction
,TransportCreateIndexAction
,TransportCreateSnapshotAction
,TransportDeleteIndexAction
,TransportDeleteIndexTemplateAction
,TransportDeleteRepositoryAction
,TransportDeleteSnapshotAction
,TransportDeleteStoredScriptAction
,TransportGetSnapshotsAction
,TransportIndicesAliasesAction
,TransportMasterNodeReadAction
,TransportOpenIndexAction
,TransportPutIndexTemplateAction
,TransportPutMappingAction
,TransportPutRepositoryAction
,TransportPutStoredScriptAction
,TransportResizeAction
,TransportRestoreSnapshotAction
,TransportRolloverAction
,TransportSnapshotsStatusAction
,TransportUpdateSettingsAction
,TransportUpgradeSettingsAction
,TransportVerifyRepositoryAction
,UpdatePersistentTaskStatusAction.TransportAction
public abstract class TransportMasterNodeAction<Request extends MasterNodeRequest<Request>,Response extends ActionResponse> extends HandledTransportAction<Request,Response>
A base class for operations that needs to be performed on the master node.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClusterService
clusterService
protected TransportService
transportService
-
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, indexNameExpressionResolver, taskManager, threadPool
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransportMasterNodeAction(Settings settings, java.lang.String actionName, boolean canTripCircuitBreaker, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request)
protected
TransportMasterNodeAction(Settings settings, java.lang.String actionName, boolean canTripCircuitBreaker, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader<Request> request, IndexNameExpressionResolver indexNameExpressionResolver)
protected
TransportMasterNodeAction(Settings settings, java.lang.String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request)
protected
TransportMasterNodeAction(Settings settings, java.lang.String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader<Request> request, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
Modifier and Type Method Description protected abstract ClusterBlockException
checkBlock(Request request, ClusterState state)
protected void
doExecute(Task task, Request request, ActionListener<Response> listener)
protected void
doExecute(Request request, ActionListener<Response> listener)
protected abstract java.lang.String
executor()
protected java.lang.String
getMasterActionName(DiscoveryNode node)
Allows to conditionally return a different master node action name in the case an action gets renamed.protected boolean
localExecute(Request request)
protected void
masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)
Override this operation if access to the task parameter is neededprotected abstract void
masterOperation(Request request, ClusterState state, ActionListener<Response> listener)
protected abstract Response
newResponse()
Deprecated.new implementors should overrideread(StreamInput)
and use theWriteable.Reader
interface.protected Response
read(StreamInput in)
-
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute, execute
-
-
-
-
Field Detail
-
transportService
protected final TransportService transportService
-
clusterService
protected final ClusterService clusterService
-
-
Constructor Detail
-
TransportMasterNodeAction
protected TransportMasterNodeAction(Settings settings, java.lang.String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request)
-
TransportMasterNodeAction
protected TransportMasterNodeAction(Settings settings, java.lang.String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader<Request> request, IndexNameExpressionResolver indexNameExpressionResolver)
-
TransportMasterNodeAction
protected TransportMasterNodeAction(Settings settings, java.lang.String actionName, boolean canTripCircuitBreaker, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request)
-
TransportMasterNodeAction
protected TransportMasterNodeAction(Settings settings, java.lang.String actionName, boolean canTripCircuitBreaker, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader<Request> request, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Detail
-
executor
protected abstract java.lang.String executor()
-
newResponse
@Deprecated protected abstract Response newResponse()
Deprecated.new implementors should overrideread(StreamInput)
and use theWriteable.Reader
interface.- Returns:
- a new response instance. Typically this is used for serialization using the
Streamable.readFrom(StreamInput)
method.
-
read
protected Response read(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
masterOperation
protected abstract void masterOperation(Request request, ClusterState state, ActionListener<Response> listener) throws java.lang.Exception
- Throws:
java.lang.Exception
-
masterOperation
protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener) throws java.lang.Exception
Override this operation if access to the task parameter is needed- Throws:
java.lang.Exception
-
localExecute
protected boolean localExecute(Request request)
-
checkBlock
protected abstract ClusterBlockException checkBlock(Request request, ClusterState state)
-
doExecute
protected final void doExecute(Request request, ActionListener<Response> listener)
- Specified by:
doExecute
in classTransportAction<Request extends MasterNodeRequest<Request>,Response extends ActionResponse>
-
doExecute
protected void doExecute(Task task, Request request, ActionListener<Response> listener)
- Overrides:
doExecute
in classTransportAction<Request extends MasterNodeRequest<Request>,Response extends ActionResponse>
-
getMasterActionName
protected java.lang.String getMasterActionName(DiscoveryNode node)
Allows to conditionally return a different master node action name in the case an action gets renamed. This mainly for backwards compatibility should be used rarely
-
-