Module org.elasticsearch.xcore
Class AbstractTransportSetUpgradeModeAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.HandledTransportAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.master.TransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction<SetUpgradeModeActionRequest>
org.elasticsearch.xpack.core.action.AbstractTransportSetUpgradeModeAction
- All Implemented Interfaces:
ActionWithReservedState<SetUpgradeModeActionRequest>
public abstract class AbstractTransportSetUpgradeModeAction
extends AcknowledgedTransportMasterNodeAction<SetUpgradeModeActionRequest>
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
clusterService, executor, threadPool, transportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTransportSetUpgradeModeAction(String actionName, String taskQueuePrefix, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, ProjectResolver projectResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClusterBlockExceptioncheckBlock(SetUpgradeModeActionRequest request, ClusterState state) protected abstract Consumer<ProjectMetadata.Builder> createProjectUpdate(SetUpgradeModeActionRequest request, ProjectMetadata project) This is called from the ClusterState updater and is expected to return quickly.protected abstract StringDefine the feature name, used in log messages and naming the task on the task queue.protected abstract booleanisUpgradeMode(ProjectMetadata project) Read the upgradeMode boolean from the project's custom metadata.protected voidmasterOperation(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) protected abstract voidupgradeModeSuccessfullyChanged(Task task, SetUpgradeModeActionRequest request, ProjectMetadata project, ActionListener<AcknowledgedResponse> listener) This method is only called when the cluster state was successfully changed.Methods inherited from class org.elasticsearch.action.support.master.TransportMasterNodeAction
doExecute, localExecute, validateForReservedStateMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, executeDirect, localOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.reservedstate.ActionWithReservedState
modifiedKeys, reservedStateHandlerName, validateForReservedState
-
Constructor Details
-
AbstractTransportSetUpgradeModeAction
public AbstractTransportSetUpgradeModeAction(String actionName, String taskQueuePrefix, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, ProjectResolver projectResolver)
-
-
Method Details
-
masterOperation
protected void masterOperation(Task task, SetUpgradeModeActionRequest request, ClusterState state, ActionListener<AcknowledgedResponse> listener) throws Exception - Specified by:
masterOperationin classTransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse> - Throws:
Exception
-
featureName
Define the feature name, used in log messages and naming the task on the task queue. -
isUpgradeMode
Read the upgradeMode boolean from the project's custom metadata. -
createProjectUpdate
protected abstract Consumer<ProjectMetadata.Builder> createProjectUpdate(SetUpgradeModeActionRequest request, ProjectMetadata project) This is called from the ClusterState updater and is expected to return quickly. Returns a project-scoped mutation that the parent applies to the ClusterState. -
upgradeModeSuccessfullyChanged
protected abstract void upgradeModeSuccessfullyChanged(Task task, SetUpgradeModeActionRequest request, ProjectMetadata project, ActionListener<AcknowledgedResponse> listener) This method is only called when the cluster state was successfully changed. If we failed to update for any reason, this will not be called. The project param is from the previous ClusterState before we called update. -
checkBlock
- Specified by:
checkBlockin classTransportMasterNodeAction<SetUpgradeModeActionRequest,AcknowledgedResponse>
-